From patchwork Fri May 13 02:17:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeerLite X-Patchwork-Id: 2297 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id E5F4127BBEA; Fri, 13 May 2022 03:18:11 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id AC35C27BBE9 for ; Fri, 13 May 2022 03:18:11 +0100 (BST) Received: from localhost ([::1]:38002 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npKsc-0008Q1-Rk for patchwork@mira.cbaines.net; Thu, 12 May 2022 22:18:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43576) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npKsU-0008OS-BL for guix-patches@gnu.org; Thu, 12 May 2022 22:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48740) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npKsU-0000Tw-1z for guix-patches@gnu.org; Thu, 12 May 2022 22:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npKsT-00037A-Uf for guix-patches@gnu.org; Thu, 12 May 2022 22:18:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54221] [PATCH v2 1/2] gnu: vim: Use native-search-paths to search for plugins. References: In-Reply-To: Resent-From: SeerLite Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 May 2022 02:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54221 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54221@debbugs.gnu.org Cc: SeerLite Received: via spool by 54221-submit@debbugs.gnu.org id=B54221.165240827011946 (code B ref 54221); Fri, 13 May 2022 02:18:01 +0000 Received: (at 54221) by debbugs.gnu.org; 13 May 2022 02:17:50 +0000 Received: from localhost ([127.0.0.1]:42635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npKsI-00036W-Fm for submit@debbugs.gnu.org; Thu, 12 May 2022 22:17:50 -0400 Received: from mx.nixnet.email ([94.16.121.167]:55252) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npKsE-00036L-QD for 54221@debbugs.gnu.org; Thu, 12 May 2022 22:17:48 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mx.nixnet.email (Postfix) with ESMTPSA id 13E3E20054B; Thu, 12 May 2022 22:17:43 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nixnet.email; s=202002021149; t=1652408265; h=from:from:reply-to:subject:subject:to:to:cc:cc; bh=LXG6RQ6+7qp2sKzcaoBWx25sESpiYLsDuzYRIDeVvRM=; b=WLdZiaXv7upE1gpkVcYNNpw7sRxDMgWzs3M8v83UZ124uKYofTiwjvxu7ChrzDSbdR//YX l8yeFYSn9Gbm9iz3XzQPggCPfsl1coFyQq+UQYjfbPWepWtkVPsba+u+Y21/1XneDr+uSE EeRwmeOuy2NTxFQtmTuLlBvk+g1Jq0E= Date: Thu, 12 May 2022 22:17:26 -0400 Message-Id: <84af4a68a12d4838fa88e99e6c654930e33694fa.1652408245.git.seerlite@nixnet.email> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: SeerLite X-ACL-Warn: , SeerLite via Guix-patches X-Patchwork-Original-From: SeerLite via Guix-patches via From: SeerLite X-getmail-retrieved-from-mailbox: Patches Previously a hardcoded list of directories was used, which albeit quite accurate during normal use, didn't fully respect the active Guix environment and didn't make use of Guix's search-paths feature. * gnu/packages/aux-files/guix.vim: Use 'GUIX_VIMRUNTIME' to set the runtimepath. * gnu/packages/vim.scm (vim)[native-search-paths]: Add search path specification for 'GUIX_VIMRUNTIME'. --- gnu/packages/aux-files/guix.vim | 11 ++++------- gnu/packages/vim.scm | 6 ++++++ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/gnu/packages/aux-files/guix.vim b/gnu/packages/aux-files/guix.vim index 9397c53701..3c13a16b7d 100644 --- a/gnu/packages/aux-files/guix.vim +++ b/gnu/packages/aux-files/guix.vim @@ -1,10 +1,7 @@ -" This appends all of the vim plugins to the end of Vim's runtimepath. -for directory in ["/run/current-system/profile", $HOME . "/.guix-profile", $HOME ."/.guix-home/profile", $GUIX_PROFILE, $GUIX_ENVIRONMENT] - let vimplugins = directory . "/share/vim/vimfiles" - if isdirectory(vimplugins) - let &rtp = join([&rtp,vimplugins], ',') - endif -endfor +if !empty($GUIX_VIMRUNTIME) + set rtp+=$GUIX_VIMRUNTIME +endif + " Unconditionally add */after directories last, as intended by upstream " TODO: Remove duplicate */after directories for directory in [$VIM . "/vimfiles", $HOME ."/.vim"] diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index bb459933b0..0c8e689b5a 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm @@ -13,6 +13,7 @@ ;;; Copyright © 2021 Tissevert ;;; Copyright © 2021 Foo Chuan Wei ;;; Copyright © 2022 Luis Henrique Gomes Higino +;;; Copyright © 2022 SeerLite ;;; ;;; This file is part of GNU Guix. ;;; @@ -147,6 +148,11 @@ (define-public vim (mkdir-p vimdir) (copy-file (assoc-ref inputs "guix.vim") (string-append vimdir "/vimrc")))))))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_VIMRUNTIME") + (separator ",") + (files (list "share/vim/vimfiles"))))) (inputs (list gawk ncurses perl tcsh)) ; For runtime/tools/vim32 (native-inputs From patchwork Fri May 13 02:17:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeerLite X-Patchwork-Id: 2298 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 88FFF27BBEA; Fri, 13 May 2022 03:18:13 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 5480527BBE9 for ; Fri, 13 May 2022 03:18:13 +0100 (BST) Received: from localhost ([::1]:38102 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1npKse-0008UH-FO for patchwork@mira.cbaines.net; Thu, 12 May 2022 22:18:12 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43578) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1npKsU-0008PD-Nq for guix-patches@gnu.org; Thu, 12 May 2022 22:18:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48741) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1npKsU-0000U2-Em for guix-patches@gnu.org; Thu, 12 May 2022 22:18:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1npKsU-00037H-Ap for guix-patches@gnu.org; Thu, 12 May 2022 22:18:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54221] [PATCH v2 2/2] gnu: neovim: Search and use installed plugins, like vim. Resent-From: SeerLite Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 13 May 2022 02:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54221 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 54221@debbugs.gnu.org Cc: SeerLite Received: via spool by 54221-submit@debbugs.gnu.org id=B54221.165240827411958 (code B ref 54221); Fri, 13 May 2022 02:18:02 +0000 Received: (at 54221) by debbugs.gnu.org; 13 May 2022 02:17:54 +0000 Received: from localhost ([127.0.0.1]:42637 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npKsL-00036n-RB for submit@debbugs.gnu.org; Thu, 12 May 2022 22:17:54 -0400 Received: from mx.nixnet.email ([94.16.121.167]:55256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1npKsI-00036V-8V for 54221@debbugs.gnu.org; Thu, 12 May 2022 22:17:50 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mx.nixnet.email (Postfix) with ESMTPSA id 9DA102005FD; Thu, 12 May 2022 22:17:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nixnet.email; s=202002021149; t=1652408267; h=from:from:reply-to:subject:subject:to:to:cc:cc; bh=8+U49ZqsnG/a3Gl+GsEs/4YRY0Ip2jE01t1XHH95Mhw=; b=nACAaL8DPqI1UWe4IbrbpsQIbr+1BxRt0vmNwmJ+K33QTrEy7+8Ob67tH6Q5uZVvcQo1c7 DUWynENeFdsYBRsSA7TVwPQMtoQvPFG732MrjN3wWpbaBVehhse3vxkdFBbsrf+5BGLZmP X+FxV1AmIzqczCf8uouWJ13feimYNbI= Date: Thu, 12 May 2022 22:17:27 -0400 Message-Id: <2d93d3dd08699c95c26aa59783a17d8c5cf8635c.1652408245.git.seerlite@nixnet.email> X-Mailer: git-send-email 2.36.0 In-Reply-To: <84af4a68a12d4838fa88e99e6c654930e33694fa.1652408245.git.seerlite@nixnet.email> References: <84af4a68a12d4838fa88e99e6c654930e33694fa.1652408245.git.seerlite@nixnet.email> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: SeerLite X-ACL-Warn: , SeerLite via Guix-patches X-Patchwork-Original-From: SeerLite via Guix-patches via From: SeerLite X-getmail-retrieved-from-mailbox: Patches * gnu/packages/vim.scm (neovim)[phases]{install-guix.vim}: New phase. [native-search-paths]: Add search path specification for 'GUIX_VIMRUNTIME'. --- gnu/packages/vim.scm | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index 0c8e689b5a..530303a318 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm @@ -717,7 +717,18 @@ (define-public neovim ;; doubles its size. We remove the refirence here. (substitute* "cmake/GetCompileFlags.cmake" (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc")) - #t))))) + #t)) + (add-after 'install 'install-guix.vim + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((nvimdir (string-append (assoc-ref outputs "out") "/share/nvim"))) + (mkdir-p nvimdir) + (copy-file (assoc-ref inputs "guix.vim") + (string-append nvimdir "/sysinit.vim")))))))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_VIMRUNTIME") + (separator ",") + (files (list "share/vim/vimfiles"))))) (inputs `(("libuv" ,libuv) ("msgpack" ,msgpack) @@ -739,7 +750,8 @@ (define-public neovim (native-inputs `(("pkg-config" ,pkg-config) ("gettext" ,gettext-minimal) - ("gperf" ,gperf))) + ("gperf" ,gperf) + ("guix.vim" ,(search-auxiliary-file "guix.vim")))) (home-page "https://neovim.io") (synopsis "Fork of vim focused on extensibility and agility") (description "Neovim is a project that seeks to aggressively