From patchwork Thu May 19 01:08:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: SeerLite X-Patchwork-Id: 39516 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 4FE0527BBEA; Thu, 19 May 2022 02:09:10 +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 1107727BBE9 for ; Thu, 19 May 2022 02:09:10 +0100 (BST) Received: from localhost ([::1]:49308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrUf7-0004nM-5o for patchwork@mira.cbaines.net; Wed, 18 May 2022 21:09:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51814) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrUf0-0004n5-Me for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrUf0-0004u7-E2 for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrUf0-0002Gm-4Q for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54221] [PATCH v4 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: Thu, 19 May 2022 01:09: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.16529225048666 (code B ref 54221); Thu, 19 May 2022 01:09:02 +0000 Received: (at 54221) by debbugs.gnu.org; 19 May 2022 01:08:24 +0000 Received: from localhost ([127.0.0.1]:33979 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrUeO-0002Fg-CA for submit@debbugs.gnu.org; Wed, 18 May 2022 21:08:24 -0400 Received: from mx.nixnet.email ([94.16.121.167]:40250) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrUeM-0002FX-C0 for 54221@debbugs.gnu.org; Wed, 18 May 2022 21:08:23 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mx.nixnet.email (Postfix) with ESMTPSA id A9A3F200882; Wed, 18 May 2022 21:08:19 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nixnet.email; s=202002021149; t=1652922500; h=from:from:reply-to:subject:subject:to:to:cc:cc; bh=KqK7bjunYRJpvtwYeJL85IKNh9AjR+gIhkHnXmsRBCo=; b=EGt3khi591oeS5+WupdYI6GO2orbTK14nBrxy9onV4FBZAYAtuUcF1TPo5xFILSGtp6zQh nbUDJnaIg/oolpUltPgpoJ5yh/zkwbWSwcxT+uM1Jsn4/OsCkVmKz7NfPRU1kAlXlZV3QM Pdo+a+2DKcAXpi8EHoYf28A2oumnZmI= Date: Wed, 18 May 2022 21:08:15 -0400 Message-Id: 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'. [phases]: Search for tzdata files in the correct input fields. --- gnu/packages/aux-files/guix.vim | 11 ++++------- gnu/packages/vim.scm | 8 +++++++- 2 files changed, 11 insertions(+), 8 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 caf9ea85b3..011521babd 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. ;;; @@ -111,7 +112,7 @@ (define-public vim (lambda* (#:key inputs #:allow-other-keys) ;; One of the tests tests timezone-dependent functions. (setenv "TZDIR" - (search-input-directory inputs "share/zoneinfo")) + (search-input-directory (or native-inputs inputs) "share/zoneinfo")) ;; Make sure the TERM environment variable is set for the tests (setenv "TERM" "xterm"))) @@ -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 Thu May 19 01:08:16 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeerLite X-Patchwork-Id: 39517 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 386F927BBEA; Thu, 19 May 2022 02:09:12 +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 0355E27BBE9 for ; Thu, 19 May 2022 02:09:12 +0100 (BST) Received: from localhost ([::1]:49340 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nrUf9-0004ot-5v for patchwork@mira.cbaines.net; Wed, 18 May 2022 21:09:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51818) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nrUf0-0004nC-U7 for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:40086) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nrUf0-0004uB-Lj for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nrUf0-0002Gt-Gg for guix-patches@gnu.org; Wed, 18 May 2022 21:09:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#54221] [PATCH v4 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: Thu, 19 May 2022 01:09: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.16529225088681 (code B ref 54221); Thu, 19 May 2022 01:09:02 +0000 Received: (at 54221) by debbugs.gnu.org; 19 May 2022 01:08:28 +0000 Received: from localhost ([127.0.0.1]:33982 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrUeR-0002Fx-M9 for submit@debbugs.gnu.org; Wed, 18 May 2022 21:08:27 -0400 Received: from mx.nixnet.email ([94.16.121.167]:40254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nrUeO-0002Fh-Op for 54221@debbugs.gnu.org; Wed, 18 May 2022 21:08:25 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) by mx.nixnet.email (Postfix) with ESMTPSA id 1F9412007B5; Wed, 18 May 2022 21:08:20 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nixnet.email; s=202002021149; t=1652922502; h=from:from:reply-to:subject:subject:to:to:cc:cc; bh=BPTsV1dglvHVga2mf8yh6Iov7l6DcnLhUGRHxf7148k=; b=j7gFzf4t1JZOPggiAZ4E1sjM25y42MuyWR9EBvzEn9qpvT5rA7ZBch1Tqp8K7HQlsKX0Bs eUgDtl8G7GCHMr/dJEnSOCvNR8pOvkdvQ4dXg7CP2CZfDbMxI9M9rUceLf5uHQ5IuOLdXE yQNTLpnBNFYI2Yy1ir/XIiPO9UCwMNM= Date: Wed, 18 May 2022 21:08:16 -0400 Message-Id: <1548e2407322432808e83389d07cfc6b92379cae.1652922494.git.seerlite@nixnet.email> X-Mailer: git-send-email 2.36.0 In-Reply-To: References: 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]: Add 'install-guix.vim phase and remove trailing #t's. [native-search-paths]: Add search path specification for 'GUIX_VIMRUNTIME'. --- gnu/packages/vim.scm | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm index 011521babd..7697a03ef6 100644 --- a/gnu/packages/vim.scm +++ b/gnu/packages/vim.scm @@ -716,16 +716,25 @@ (define-public neovim (setenv "LUA_PATH" (string-join (map lua-path-spec lua-inputs) ";")) (setenv "LUA_CPATH" - (string-join (map lua-cpath-spec lua-inputs) ";")) - #t))) + (string-join (map lua-cpath-spec lua-inputs) ";"))))) (add-after 'unpack 'prevent-embedding-gcc-store-path (lambda _ ;; nvim remembers its build options, including the compiler with ;; its complete path. This adds gcc to the closure of nvim, which ;; doubles its size. We remove the refirence here. (substitute* "cmake/GetCompileFlags.cmake" - (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc")) - #t))))) + (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc")))) + (add-after 'install 'install-guix.vim + (lambda* (#:key inputs outputs #:allow-other-keys) + (let ((vimdir (string-append (assoc-ref outputs "out") "/share/nvim")) + (vimrc #$(local-file (search-auxiliary-file "guix.vim")))) + (mkdir-p vimdir) + (copy-file vimrc (string-append nvimdir "/sysinit.vim"))))))) + (native-search-paths + (list (search-path-specification + (variable "GUIX_VIMRUNTIME") + (separator ",") + (files (list "share/vim/vimfiles"))))) (inputs (list libuv-for-luv msgpack libtermkey