unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths.
@ 2022-03-02 13:11 SeerLite via Guix-patches via
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
                   ` (6 more replies)
  0 siblings, 7 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-02 13:11 UTC (permalink / raw)
  To: 54221

Hi!

These patches make Vim use native-search-paths to search for plugins, 
instead of manually searching for them in a set of hardcoded paths, 
which is how it was done up till now.

I've added the same search paths to Neovim, which unlike Vim, wasn't 
auto-detecting Vim plugins at all before.

Neovim also searches XDG_DATA_DIRS for Neovim-specific plugins, so I'd 
appreciate if <https://issues.guix.gnu.org/48112> was merged too.

Finally, I've updated the package definitions to use the new style with 
gexps and label-less inputs.

SeerLite




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
@ 2022-03-02 13:17 ` SeerLite via Guix-patches via
  2022-03-02 13:17   ` [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
                     ` (3 more replies)
  2022-05-13  2:17 ` [bug#54221] [PATCH v2 1/2] " SeerLite via Guix-patches via
                   ` (5 subsequent siblings)
  6 siblings, 4 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-02 13:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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 28944dd640..7407ae71d7 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
 ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -150,6 +151,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
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim.
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-03-02 13:17   ` SeerLite via Guix-patches via
  2022-03-02 18:30     ` Maxime Devos
  2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-02 13:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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 7407ae71d7..3997797201 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -714,7 +714,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)
@@ -730,7 +741,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
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2022-03-02 13:17   ` [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2022-03-02 13:17   ` SeerLite via Guix-patches via
  2022-03-02 18:25     ` Maxime Devos
                       ` (2 more replies)
  2022-03-02 13:17   ` [bug#54221] [PATCH 4/4] gnu: neovim: Update package style SeerLite via Guix-patches via
  2022-03-02 18:33   ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins Maxime Devos
  3 siblings, 3 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-02 13:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* gnu/packages/vim.scm (vim)[native-inputs]: Remove "guix.vim" gexp and remove
labels.
[arguments]: Convert to list of gexps and inline the "guix.vim" gexp.
---
 gnu/packages/vim.scm | 127 +++++++++++++++++++++----------------------
 1 file changed, 62 insertions(+), 65 deletions(-)

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 3997797201..d5d8b412f7 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -89,68 +89,69 @@ (define-public vim
                "1jppzgmngcdd7jfb5rnkkvf5d47svnjbn7qj4mvjacd9az3c7s9r"))))
     (build-system gnu-build-system)
     (arguments
-     `(#:test-target "test"
-       #:parallel-tests? #f
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'configure 'patch-absolute-paths
-           (lambda _
-             (substitute* "runtime/tools/mve.awk"
-               (("/usr/bin/nawk") (which "gawk")))
-             (substitute* '("src/testdir/Makefile"
-                            "src/testdir/test_normal.vim"
-                            "src/testdir/test_popupwin.vim"
-                            "src/testdir/test_shell.vim"
-                            "src/testdir/test_system.vim"
-                            "src/testdir/test_terminal.vim"
-                            "src/testdir/test_terminal2.vim")
-               (("/bin/sh") (which "sh")))
-             (substitute* "src/testdir/test_autocmd.vim"
-               (("/bin/kill") (which "kill")))))
-         (add-before 'check 'set-environment-variables
-           (lambda* (#:key inputs #:allow-other-keys)
-             ;; One of the tests tests timezone-dependent functions.
-             (setenv "TZDIR"
-                     (search-input-directory inputs "share/zoneinfo"))
+     (list
+      #:test-target "test"
+      #:parallel-tests? #f
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'configure 'patch-absolute-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "runtime/tools/mve.awk"
+                (("/usr/bin/nawk") (search-input-file inputs "bin/gawk")))
+              (substitute* '("src/testdir/Makefile"
+                             "src/testdir/test_normal.vim"
+                             "src/testdir/test_popupwin.vim"
+                             "src/testdir/test_shell.vim"
+                             "src/testdir/test_system.vim"
+                             "src/testdir/test_terminal.vim"
+                             "src/testdir/test_terminal2.vim")
+                (("/bin/sh") (search-input-file inputs "bin/sh")))
+              (substitute* "src/testdir/test_autocmd.vim"
+                (("/bin/kill") (search-input-file inputs "bin/kill")))))
+          (add-before 'check 'set-environment-variables
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; One of the tests tests timezone-dependent functions.
+              (setenv "TZDIR"
+                      (search-input-directory inputs "share/zoneinfo"))
 
-             ;; Make sure the TERM environment variable is set for the tests
-             (setenv "TERM" "xterm")))
-         (add-before 'check 'skip-or-fix-failing-tests
-           (lambda _
-             ;; This test assumes that PID 1 is run as root and that the user
-             ;; running the test suite does not have permission to kill(1, 0)
-             ;; it.  This is not true in the build container, where both PID 1
-             ;; and the test suite are run as the same user.  Skip the test.
-             ;; An alternative fix would be to patch the PID used to a random
-             ;; 32-bit value and hope it never shows up in the test environment.
-             (substitute* "src/testdir/test_swap.vim"
-               (("if !IsRoot\\(\\)") "if 0"))
+              ;; Make sure the TERM environment variable is set for the tests
+              (setenv "TERM" "xterm")))
+          (add-before 'check 'skip-or-fix-failing-tests
+            (lambda _
+              ;; This test assumes that PID 1 is run as root and that the user
+              ;; running the test suite does not have permission to kill(1, 0)
+              ;; it.  This is not true in the build container, where both PID 1
+              ;; and the test suite are run as the same user.  Skip the test.
+              ;; An alternative fix would be to patch the PID used to a random
+              ;; 32-bit value and hope it never shows up in the test environment.
+              (substitute* "src/testdir/test_swap.vim"
+                (("if !IsRoot\\(\\)") "if 0"))
 
-             ;; These tests check how the terminal looks after executing some
-             ;; actions.  The path of the bash binary is shown, which results in
-             ;; a difference being detected.  Patching the expected result is
-             ;; non-trivial due to the special format used, so skip the test.
-             (substitute* "src/testdir/test_terminal.vim"
-               ((".*Test_open_term_from_cmd.*" line)
-                (string-append line "return\n"))
-               ((".*Test_terminal_postponed_scrollback.*" line)
-                (string-append line "return\n"))
-               ((".*Test_combining_double_width.*" line)
-                (string-append line "return\n")))
-             (substitute* "src/testdir/test_popupwin.vim"
-               ((".*Test_popup_drag_termwin.*" line)
-                (string-append line "return\n")))))
-         (add-before 'install 'fix-installman.sh
-           (lambda _
-             (substitute* "src/installman.sh"
-               (("/bin/sh")
-                (which "sh")))))
-         (add-after 'install 'install-guix.vim
-           (lambda* (#:key inputs outputs #:allow-other-keys)
-             (let ((vimdir (string-append (assoc-ref outputs "out") "/share/vim")))
-               (mkdir-p vimdir)
-               (copy-file (assoc-ref inputs "guix.vim")
-                          (string-append vimdir "/vimrc"))))))))
+              ;; These tests check how the terminal looks after executing some
+              ;; actions.  The path of the bash binary is shown, which results in
+              ;; a difference being detected.  Patching the expected result is
+              ;; non-trivial due to the special format used, so skip the test.
+              (substitute* "src/testdir/test_terminal.vim"
+                ((".*Test_open_term_from_cmd.*" line)
+                 (string-append line "return\n"))
+                ((".*Test_terminal_postponed_scrollback.*" line)
+                 (string-append line "return\n"))
+                ((".*Test_combining_double_width.*" line)
+                 (string-append line "return\n")))
+              (substitute* "src/testdir/test_popupwin.vim"
+                ((".*Test_popup_drag_termwin.*" line)
+                 (string-append line "return\n")))))
+          (add-before 'install 'fix-installman.sh
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "src/installman.sh"
+                (("/bin/sh")
+                 (search-input-file inputs "bin/sh")))))
+          (add-after 'install 'install-guix.vim
+            (lambda _
+              (let ((vimdir (string-append #$output "/share/vim"))
+                    (vimrc #$(local-file (search-auxiliary-file "guix.vim"))))
+                (mkdir-p vimdir)
+                (copy-file vimrc (string-append vimdir "/vimrc"))))))))
     (native-search-paths
      (list (search-path-specification
             (variable "GUIX_VIMRUNTIME")
@@ -159,11 +160,7 @@ (define-public vim
     (inputs
      (list gawk ncurses perl tcsh))                 ; For runtime/tools/vim32
     (native-inputs
-     `(("libtool" ,libtool)
-       ("guix.vim" ,(search-auxiliary-file "guix.vim"))
-
-       ;; For tests.
-       ("tzdata" ,tzdata-for-tests)))
+     (list libtool tzdata-for-tests))
     (home-page "https://www.vim.org/")
     (synopsis "Text editor based on vi")
     ;; The description shares language with the vim-full package. When making
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 4/4] gnu: neovim: Update package style.
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2022-03-02 13:17   ` [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
@ 2022-03-02 13:17   ` SeerLite via Guix-patches via
  2022-03-02 18:40     ` Maxime Devos
  2022-03-02 18:33   ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins Maxime Devos
  3 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-02 13:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* gnu/packages/vim.scm (neovim)[inputs]: Remove labels.
[native-inputs]: Remove "guix.vim" gexp and remove labels.
[arguments]: Convert to list of gexps, inline the "guix.vim" gexp, adjust lua
input names and remove trailing #t's.
---
 gnu/packages/vim.scm | 114 +++++++++++++++++++++----------------------
 1 file changed, 55 insertions(+), 59 deletions(-)

diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index d5d8b412f7..5e6439ed00 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -676,70 +676,66 @@ (define-public neovim
         (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
     (build-system cmake-build-system)
     (arguments
-     `(#:modules ((srfi srfi-26)
+     (list
+      #:modules `((srfi srfi-26)
                   (guix build cmake-build-system)
                   (guix build utils))
-       #:configure-flags '("-DPREFER_LUA:BOOL=YES")
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'set-lua-paths
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((lua-version "5.1")
-                    (lua-cpath-spec
-                     (lambda (prefix)
-                       (let ((path (string-append prefix "/lib/lua/" lua-version)))
-                         (string-append path "/?.so;" path "/?/?.so"))))
-                    (lua-path-spec
-                     (lambda (prefix)
-                       (let ((path (string-append prefix "/share/lua/" lua-version)))
-                         (string-append path "/?.lua;" path "/?/?.lua"))))
-                    (lua-inputs (map (cute assoc-ref inputs <>)
-                                     '("lua"
-                                       "lua-luv"
-                                       "lua-lpeg"
-                                       "lua-bitop"
-                                       "lua-libmpack"))))
-               (setenv "LUA_PATH"
-                       (string-join (map lua-path-spec lua-inputs) ";"))
-               (setenv "LUA_CPATH"
-                       (string-join (map lua-cpath-spec lua-inputs) ";"))
-               #t)))
-         (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))
-         (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"))))))))
+      #:configure-flags #~(list "-DPREFER_LUA:BOOL=YES")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-lua-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (let* ((lua-version "5.1")
+                     (lua-cpath-spec
+                      (lambda (prefix)
+                        (let ((path (string-append prefix "/lib/lua/" lua-version)))
+                          (string-append path "/?.so;" path "/?/?.so"))))
+                     (lua-path-spec
+                      (lambda (prefix)
+                        (let ((path (string-append prefix "/share/lua/" lua-version)))
+                          (string-append path "/?.lua;" path "/?/?.lua"))))
+                     (lua-inputs (map (cute assoc-ref inputs <>)
+                                      '("lua"
+                                        "lua5.1-luv"
+                                        "lua5.1-lpeg"
+                                        "lua5.1-bitop"
+                                        "lua5.1-libmpack"))))
+                (setenv "LUA_PATH"
+                        (string-join (map lua-path-spec lua-inputs) ";"))
+                (setenv "LUA_CPATH"
+                        (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"))))
+          (add-after 'install 'install-guix.vim
+             (lambda _
+               (let ((vimdir (string-append #$output "/share/nvim"))
+                     (vimrc #$(local-file (search-auxiliary-file "guix.vim"))))
+                 (mkdir-p vimdir)
+                 (copy-file vimrc (string-append vimdir "/sysinit.vim"))))))))
     (native-search-paths
-      (list (search-path-specification
-             (variable "GUIX_VIMRUNTIME")
-             (separator ",")
-             (files (list "share/vim/vimfiles")))))
+     (list (search-path-specification
+            (variable "GUIX_VIMRUNTIME")
+            (separator ",")
+            (files (list "share/vim/vimfiles")))))
     (inputs
-     `(("libuv" ,libuv)
-       ("msgpack" ,msgpack)
-       ("libtermkey" ,libtermkey)
-       ("libvterm" ,libvterm)
-       ("unibilium" ,unibilium)
-       ("jemalloc" ,jemalloc)
-       ("lua" ,lua-5.1)
-       ("lua-luv" ,lua5.1-luv)
-       ("lua-lpeg" ,lua5.1-lpeg)
-       ("lua-bitop" ,lua5.1-bitop)
-       ("lua-libmpack" ,lua5.1-libmpack)))
+     (list libuv
+           msgpack
+           libtermkey
+           libvterm
+           unibilium
+           jemalloc
+           lua-5.1
+           lua5.1-luv
+           lua5.1-lpeg
+           lua5.1-bitop
+           lua5.1-libmpack))
     (native-inputs
-     `(("pkg-config" ,pkg-config)
-       ("gettext" ,gettext-minimal)
-       ("gperf" ,gperf)
-       ("guix.vim" ,(search-auxiliary-file "guix.vim"))))
+     (list pkg-config gettext-minimal gperf))
     (home-page "https://neovim.io")
     (synopsis "Fork of vim focused on extensibility and agility")
     (description "Neovim is a project that seeks to aggressively
-- 
2.34.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
@ 2022-03-02 18:25     ` Maxime Devos
  2022-03-02 18:29     ` Maxime Devos
  2022-03-02 18:35     ` Maxime Devos
  2 siblings, 0 replies; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:25 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +          (add-before 'check 'set-environment-variables
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              ;; One of the tests tests timezone-dependent functions.
> +              (setenv "TZDIR"
> +                      (search-input-directory inputs "share/zoneinfo"))
>  
> -             ;; Make sure the TERM environment variable is set for the tests
> -             (setenv "TERM" "xterm")))

The tzdata in in 'native-inputs', not 'inputs', so this code needs to
look in '(or native-inputs inputs)', not 'inputs', otherwise this code
will fail with a '&search-path' exception from 'search-input-directory'
when cross-compiling (untested).

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
  2022-03-02 18:25     ` Maxime Devos
@ 2022-03-02 18:29     ` Maxime Devos
  2022-03-03 16:49       ` SeerLite via Guix-patches via
  2022-03-02 18:35     ` Maxime Devos
  2 siblings, 1 reply; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:29 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 1711 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              [this [bracketed line] seems irrelevant for my comment]
> +              (substitute* '("src/testdir/Makefile"
> +                             "src/testdir/test_normal.vim"
> +                             "src/testdir/test_popupwin.vim"
> +                             "src/testdir/test_shell.vim"
> +                             "src/testdir/test_system.vim"
> +                             "src/testdir/test_terminal.vim"
> +                             "src/testdir/test_terminal2.vim")
> +                (("/bin/sh") (search-input-file inputs "bin/sh")))
> +              (substitute* "src/testdir/test_autocmd.vim"
> +                (("/bin/kill") (search-input-file inputs "bin/kill")))))

This is test stuff, and these binaries do not seem to be present in
'inputs', they would be in the implicit 'native-inputs', so these would
need to search in '(or native-inputs inputs)' instead of 'inputs' to
avoid &search-path exceptions when cross-compiling:

(substitute* '("src/testdir/...")
  (("/bin/sh") (search-input-file (or native-inputs inputs) "bin/sh")))

Or simpler, there's a procedure for looking for 'bin/TOOL' in native-
inputs: 'which'!

;; the original code!
(substitute* '("src/testdir/...")
  (("/bin/sh") (which "sh")))

Why the change from 'which' to 'search-input-file'?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim.
  2022-03-02 13:17   ` [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2022-03-02 18:30     ` Maxime Devos
  0 siblings, 0 replies; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:30 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 424 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +    (native-search-paths
> +      (list (search-path-specification
> +             (variable "GUIX_VIMRUNTIME")
> +             (separator ",")
> +             (files (list "share/vim/vimfiles")))))

this can be simplified:

  (native-search-paths (package-native-search-paths vim))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
                     ` (2 preceding siblings ...)
  2022-03-02 13:17   ` [bug#54221] [PATCH 4/4] gnu: neovim: Update package style SeerLite via Guix-patches via
@ 2022-03-02 18:33   ` Maxime Devos
  3 siblings, 0 replies; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:33 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 785 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> -" 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

Nice!  That would make the "--pure" option in
"guix shell --pure vim perhaps-some-vim-plugins ... -- vim" actually
work! (untested, I'm just _looking_ at the patches, not actually
testing them)

Greetings,
Maxime.


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
  2022-03-02 18:25     ` Maxime Devos
  2022-03-02 18:29     ` Maxime Devos
@ 2022-03-02 18:35     ` Maxime Devos
  2022-03-03 17:40       ` SeerLite via Guix-patches via
  2 siblings, 1 reply; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:35 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 638 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +          (add-before 'install 'fix-installman.sh
> +            (lambda* (#:key inputs #:allow-other-keys)
> +              (substitute* "src/installman.sh"
> +                (("/bin/sh")
> +                 (search-input-file inputs "bin/sh")))))

Is "installman.sh" used during the build, or when vim is run?
In the former case, this should look into (or native-inputs
inputs) instead for cross-compilation reasons, and could be simplified
to:

(("/bin/sh") (which "sh"))

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 4/4] gnu: neovim: Update package style.
  2022-03-02 13:17   ` [bug#54221] [PATCH 4/4] gnu: neovim: Update package style SeerLite via Guix-patches via
@ 2022-03-02 18:40     ` Maxime Devos
  2022-03-03 17:36       ` SeerLite via Guix-patches via
  0 siblings, 1 reply; 34+ messages in thread
From: Maxime Devos @ 2022-03-02 18:40 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 594 bytes --]

SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
0300]:
> +                     (vimrc #$(local-file (search-auxiliary-file "guix.vim"))))

This stops package transformations from being able to change the
guix.vim used.  WDYT of using a variant of 'search-input-file', that
strips the /gnu/store/HASH- part of the store item names and tests
if the remainder equals the string "guix.vim"?  Such a procedure does
not currently exist to my knowledge, but it could be written and would
be useful outside the neovim definition.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 18:29     ` Maxime Devos
@ 2022-03-03 16:49       ` SeerLite via Guix-patches via
  2022-03-03 17:46         ` Maxime Devos
  0 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-03 16:49 UTC (permalink / raw)
  To: Maxime Devos, 54221

Hi, thanks for the review!

On 3/2/22 14:29, Maxime Devos wrote:
> This is test stuff, and these binaries do not seem to be present in
> 'inputs', they would be in the implicit 'native-inputs', so these would
> need to search in '(or native-inputs inputs)' instead of 'inputs' to
> avoid &search-path exceptions when cross-compiling:
> 
> (substitute* '("src/testdir/...")
>    (("/bin/sh") (search-input-file (or native-inputs inputs) "bin/sh")))
> 
> Or simpler, there's a procedure for looking for 'bin/TOOL' in native-
> inputs: 'which'!
> 
> ;; the original code!
> (substitute* '("src/testdir/...")
>    (("/bin/sh") (which "sh")))

Whoops, I forgot I made this change.

> Why the change from 'which' to 'search-input-file'?

The blog post that introduces label-less inputs also introduces 
'search-input-file', which made me think they were both part of the 
"package definition modernization process".

I asked on IRC if that was the case, and although I didn't get a clear 
answer for that, someone told me they preferred using 
'search-input-file' because it raises an exception when no file is found.

What do you think about that? Should I stick with 'search-input-file' or 
is 'which' alright?

It makes sense that I'd have to use native-inputs though. My bad!




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 4/4] gnu: neovim: Update package style.
  2022-03-02 18:40     ` Maxime Devos
@ 2022-03-03 17:36       ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-03 17:36 UTC (permalink / raw)
  To: Maxime Devos, 54221

On 3/2/22 14:40, Maxime Devos wrote:
> SeerLite via Guix-patches via schreef op wo 02-03-2022 om 10:17 [-
> 0300]:
>> +                     (vimrc #$(local-file (search-auxiliary-file "guix.vim"))))
> 
> This stops package transformations from being able to change the
> guix.vim used.  WDYT of using a variant of 'search-input-file', that
> strips the /gnu/store/HASH- part of the store item names and tests
> if the remainder equals the string "guix.vim"?  Such a procedure does
> not currently exist to my knowledge, but it could be written and would
> be useful outside the neovim definition.


Ah, is this also why package inputs are specified explicitly instead of 
using gexps?

Is there any benefit to being able to change such a file via a 
transformation? Editing the vimrc feels like editing the default 
configuration of the package, rather than swapping a dependency. And 
that looks odd to me, maybe because I'm more used to package 
dependencies as inputs.

The procedure sounds like a good idea, but wouldn't it be easier to just 
make `local-file` not prepend the hash to the filename by storing it 
inside a parent directory with said hash instead? Is something like that 
possible?




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-02 18:35     ` Maxime Devos
@ 2022-03-03 17:40       ` SeerLite via Guix-patches via
  2022-03-16 14:16         ` [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths Ludovic Courtès
  0 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-03-03 17:40 UTC (permalink / raw)
  To: Maxime Devos, 54221

Thank you again for the corrections. Should I send the entire patch 
series again or only the patches I want to correct? I'm new to the whole 
debbugs/email patch workflow.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
  2022-03-03 16:49       ` SeerLite via Guix-patches via
@ 2022-03-03 17:46         ` Maxime Devos
  0 siblings, 0 replies; 34+ messages in thread
From: Maxime Devos @ 2022-03-03 17:46 UTC (permalink / raw)
  To: SeerLite, 54221

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

SeerLite schreef op do 03-03-2022 om 13:49 [-0300]:
> The blog post that introduces label-less inputs also introduces 
> 'search-input-file', which made me think they were both part of the 
> "package definition modernization process".

The problem with 'which' was that it looks in 'native-inputs' (+ inputs
when compiling natively), even when we need 'inputs'.  To fix this,
adding an 'inputs/native-inputs' argument was proposed
(https://issues.guix.gnu.org/47869).  That interface was considered
a bit weird, so then (string-append (assoc-ref ...) "bin/...") was
proposed.  That's rather verbose though, so 'search-input-file' was
introduced.

In short, 'search-input-file' was introduced to help with locating
binaries from 'inputs' (at least from my POV, shortly after ludo began
using 'search-input-file' for delabelification).

For looking in native-inputs (compilation tools etc.), I would prefer
'which' above the 'search-input-file' because it's a lot more concise,
though I suppose there is an argument to be made for using 'search-
input-file' for consistency.

There's the downside of not raising an exception in case the file is
not found though.  However, there appears to be very few code that
actually relies on the 'return #f' behaviour (search for
'(or (which' and '(if (which'), so I think the behaviour can
be changed without much trouble (on 'core-updates').

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths.
  2022-03-03 17:40       ` SeerLite via Guix-patches via
@ 2022-03-16 14:16         ` Ludovic Courtès
  2022-05-13  2:34           ` seerlite--- via Guix-patches via
  0 siblings, 1 reply; 34+ messages in thread
From: Ludovic Courtès @ 2022-03-16 14:16 UTC (permalink / raw)
  To: SeerLite; +Cc: Maxime Devos, 54221

Hi Seerlite,

SeerLite <seerlite@nixnet.email> skribis:

> Thank you again for the corrections. Should I send the entire patch
> series again or only the patches I want to correct? I'm new to the
> whole debbugs/email patch workflow.

To avoid confusion, it’s more convenient if you resend the entire patch
series; make sure to use ‘git format-patch --subject-prefix="PATCH v2"’.

Thank you!

Ludo’.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v2 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-13  2:17 ` SeerLite via Guix-patches via
  2022-05-13  2:17   ` [bug#54221] [PATCH v2 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-05-19  0:50 ` [bug#54221] [PATCH v3 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-13  2:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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 <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v2 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-13  2:17 ` [bug#54221] [PATCH v2 1/2] " SeerLite via Guix-patches via
@ 2022-05-13  2:17   ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-13  2:17 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths.
  2022-03-16 14:16         ` [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths Ludovic Courtès
@ 2022-05-13  2:34           ` seerlite--- via Guix-patches via
  2022-05-19  1:11             ` [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  0 siblings, 1 reply; 34+ messages in thread
From: seerlite--- via Guix-patches via @ 2022-05-13  2:34 UTC (permalink / raw)
  To: Ludovic Courtès, Maxime Devos, 54221

Hi! Sorry for the delay, I've been very busy.

I sent the rebased patches but only the bits that added search paths.  There were some updates to both Vim and Neovim since I sent the first patch and I didn't want to deal with fixing the conflicts and re-understanding the style changes I had even forgotten I made. So I'm sending just the functional parts of the patch and hopefully someone else can update the package styles if necessary :)

Oh and I'd like to remind you of this patch: <https://issues.guix.gnu.org/48112> which along with my patch would make it so Neovim can finally use both Vim and Neovim-exclusive plugins. I'd appreciate if it got merged too.

SeerLite




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v3 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
  2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2022-05-13  2:17 ` [bug#54221] [PATCH v2 1/2] " SeerLite via Guix-patches via
@ 2022-05-19  0:50 ` SeerLite via Guix-patches via
  2022-05-19  0:50   ` [bug#54221] [PATCH v3 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-05-19  1:08 ` [bug#54221] [PATCH v4 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  0:50 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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 caf9ea85b3..222827e539 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v3 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-19  0:50 ` [bug#54221] [PATCH v3 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-19  0:50   ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  0:50 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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 222827e539..18f19c0eba 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v4 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
                   ` (2 preceding siblings ...)
  2022-05-19  0:50 ` [bug#54221] [PATCH v3 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-19  1:08 ` SeerLite via Guix-patches via
  2022-05-19  1:08   ` [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-05-19  1:14 ` [bug#54221] [PATCH v5 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
                   ` (2 subsequent siblings)
  6 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:08 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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 <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-19  1:08 ` [bug#54221] [PATCH v4 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-19  1:08   ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:08 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-13  2:34           ` seerlite--- via Guix-patches via
@ 2022-05-19  1:11             ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:11 UTC (permalink / raw)
  To: Ludovic Courtès, Maxime Devos, 54221

Rebased on top of 182b25fb (<https://issues.guix.gnu.org/55045>) and 
fixed the wrong lookup for tzdata files in inputs instead of 
native-inputs again, as Maxime had pointed out (something I thought was 
caused by my previous style/gexp patch when it was not). I wasn't able 
to figure out how to test it though.

SeerLite




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v5 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
                   ` (3 preceding siblings ...)
  2022-05-19  1:08 ` [bug#54221] [PATCH v4 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-19  1:14 ` SeerLite via Guix-patches via
  2022-05-19  1:14   ` [bug#54221] [PATCH v5 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-05-24  0:41 ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2023-02-22 20:07 ` [bug#54221] [PATCH " SeerLite via Guix-patches via
  6 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:14 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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 <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v5 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-19  1:14 ` [bug#54221] [PATCH v5 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-19  1:14   ` SeerLite via Guix-patches via
  2022-05-19  1:15     ` SeerLite via Guix-patches via
  0 siblings, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:14 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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..14e6f86544 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v5 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-19  1:14   ` [bug#54221] [PATCH v5 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2022-05-19  1:15     ` SeerLite via Guix-patches via
  0 siblings, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-19  1:15 UTC (permalink / raw)
  To: 54221

Fixed missing ')'. Whoops.

SeerLite




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
                   ` (4 preceding siblings ...)
  2022-05-19  1:14 ` [bug#54221] [PATCH v5 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-24  0:41 ` SeerLite via Guix-patches via
  2022-05-24  0:41   ` [bug#54221] [PATCH v6 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2022-05-24  1:52   ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2023-02-22 20:07 ` [bug#54221] [PATCH " SeerLite via Guix-patches via
  6 siblings, 2 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-24  0:41 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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            | 10 ++++++++--
 2 files changed, 12 insertions(+), 9 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..791aecbb83 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2022 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -108,10 +109,10 @@ (define-public vim
              (substitute* "src/testdir/test_autocmd.vim"
                (("/bin/kill") (which "kill")))))
          (add-before 'check 'set-environment-variables
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key native-inputs 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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v6 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2022-05-24  0:41 ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2022-05-24  0:41   ` SeerLite via Guix-patches via
  2022-05-24  1:52   ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  1 sibling, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-24  0:41 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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 791aecbb83..5e3cb4484d 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 vimdir "/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
-- 
2.36.0





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-05-24  0:41 ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
  2022-05-24  0:41   ` [bug#54221] [PATCH v6 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2022-05-24  1:52   ` SeerLite via Guix-patches via
  1 sibling, 0 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2022-05-24  1:52 UTC (permalink / raw)
  To: 54221

The last patches were broken. I did not realize I had done a "make 
clean" inside my Guix repo and that made ./pre-inst-env guix use my 
profile channel instead of the repo. Sorry about that:)

Now both build fine and work correctly. I also tested cross-compilation 
(guix build --target=x86_64-linux-gnu and also 
--target=aarch64-linux-gnu) but both fail. Note however that that was 
also the case before my patches, and I've got no idea how to get it 
working myself.

SeerLite




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
                   ` (5 preceding siblings ...)
  2022-05-24  0:41 ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
@ 2023-02-22 20:07 ` SeerLite via Guix-patches via
  2023-02-22 20:07   ` [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
  2023-08-05 12:28   ` [bug#54221] [PATCH 1/2] gnu: vim: Use native-search-paths to search for plugins Liliana Marie Prikler
  6 siblings, 2 replies; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2023-02-22 20:07 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

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            | 10 ++++++++--
 2 files changed, 12 insertions(+), 9 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 6baf10915a..d4e4f88756 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -13,6 +13,7 @@
 ;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
 ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
 ;;; Copyright © 2022, 2023 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
+;;; Copyright © 2023 SeerLite <seerlite@nixnet.email>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -112,10 +113,10 @@ (define-public vim
              (substitute* "src/if_cscope.c"
                (("/bin/sh") (search-input-file inputs "/bin/sh")))))
          (add-before 'check 'set-environment-variables
-           (lambda* (#:key inputs #:allow-other-keys)
+           (lambda* (#:key native-inputs 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")))
@@ -154,6 +155,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
-- 
2.39.1





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2023-02-22 20:07 ` [bug#54221] [PATCH " SeerLite via Guix-patches via
@ 2023-02-22 20:07   ` SeerLite via Guix-patches via
  2023-08-05 12:34     ` Liliana Marie Prikler
  2023-08-05 12:28   ` [bug#54221] [PATCH 1/2] gnu: vim: Use native-search-paths to search for plugins Liliana Marie Prikler
  1 sibling, 1 reply; 34+ messages in thread
From: SeerLite via Guix-patches via @ 2023-02-22 20:07 UTC (permalink / raw)
  To: 54221; +Cc: SeerLite

* 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 d4e4f88756..c6bcd096a0 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -751,16 +751,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 vimdir "/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
-- 
2.39.1





^ permalink raw reply related	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 1/2] gnu: vim: Use native-search-paths to search for plugins.
  2023-02-22 20:07 ` [bug#54221] [PATCH " SeerLite via Guix-patches via
  2023-02-22 20:07   ` [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2023-08-05 12:28   ` Liliana Marie Prikler
  1 sibling, 0 replies; 34+ messages in thread
From: Liliana Marie Prikler @ 2023-08-05 12:28 UTC (permalink / raw)
  To: SeerLite, 54221

Am Mittwoch, dem 22.02.2023 um 17:07 -0300 schrieb SeerLite:
> 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.
Should be [#:phases]<set-environment-variables>.  For clarity's sake, I
think this phase should be renamed to <prepare-test-environment>, so
that it doesn't look as though these variables affect the build output.


Otherwise LGTM, but I'm not a vim person.




^ permalink raw reply	[flat|nested] 34+ messages in thread

* [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim.
  2023-02-22 20:07   ` [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
@ 2023-08-05 12:34     ` Liliana Marie Prikler
  0 siblings, 0 replies; 34+ messages in thread
From: Liliana Marie Prikler @ 2023-08-05 12:34 UTC (permalink / raw)
  To: SeerLite, 54221

Am Mittwoch, dem 22.02.2023 um 17:07 -0300 schrieb SeerLite:
> * gnu/packages/vim.scm (neovim)[phases]: Add 'install-guix.vim phase
> and remove trailing #t's.
Again, should be [#:phases].
When you need to join sentences with "and" it's typically a sign that
these are unrelated changes.  At the very least, you should write out
those sentences.  I'm also a proponent of doing stylistic changes in a
separate patch, but since you're already waiting for this a long time,
I'm willing to take this series without that.
> [native-search-paths]: Add search path specification for
> 'GUIX_VIMRUNTIME'.
Can we inherit this from vim via (package-native-search-paths vim)?

Sadly, this patch currently doesn't apply on master; or at least what I
have for master, which lacks any changes in vim.scm, though.  Could you
send one with these points adjusted and --reroll-count=8?

Cheers




^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2023-08-05 12:35 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-02 13:11 [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths SeerLite via Guix-patches via
2022-03-02 13:17 ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2022-03-02 13:17   ` [bug#54221] [PATCH 2/4] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-03-02 18:30     ` Maxime Devos
2022-03-02 13:17   ` [bug#54221] [PATCH 3/4] gnu: vim: Update package style SeerLite via Guix-patches via
2022-03-02 18:25     ` Maxime Devos
2022-03-02 18:29     ` Maxime Devos
2022-03-03 16:49       ` SeerLite via Guix-patches via
2022-03-03 17:46         ` Maxime Devos
2022-03-02 18:35     ` Maxime Devos
2022-03-03 17:40       ` SeerLite via Guix-patches via
2022-03-16 14:16         ` [bug#54221] [PATCH 0/4] vim: Detect plugins via search paths Ludovic Courtès
2022-05-13  2:34           ` seerlite--- via Guix-patches via
2022-05-19  1:11             ` [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-03-02 13:17   ` [bug#54221] [PATCH 4/4] gnu: neovim: Update package style SeerLite via Guix-patches via
2022-03-02 18:40     ` Maxime Devos
2022-03-03 17:36       ` SeerLite via Guix-patches via
2022-03-02 18:33   ` [bug#54221] [PATCH 1/4] gnu: vim: Use native-search-paths to search for plugins Maxime Devos
2022-05-13  2:17 ` [bug#54221] [PATCH v2 1/2] " SeerLite via Guix-patches via
2022-05-13  2:17   ` [bug#54221] [PATCH v2 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-05-19  0:50 ` [bug#54221] [PATCH v3 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2022-05-19  0:50   ` [bug#54221] [PATCH v3 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-05-19  1:08 ` [bug#54221] [PATCH v4 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2022-05-19  1:08   ` [bug#54221] [PATCH v4 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-05-19  1:14 ` [bug#54221] [PATCH v5 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2022-05-19  1:14   ` [bug#54221] [PATCH v5 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-05-19  1:15     ` SeerLite via Guix-patches via
2022-05-24  0:41 ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2022-05-24  0:41   ` [bug#54221] [PATCH v6 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2022-05-24  1:52   ` [bug#54221] [PATCH v6 1/2] gnu: vim: Use native-search-paths to search for plugins SeerLite via Guix-patches via
2023-02-22 20:07 ` [bug#54221] [PATCH " SeerLite via Guix-patches via
2023-02-22 20:07   ` [bug#54221] [PATCH 2/2] gnu: neovim: Search and use installed plugins, like vim SeerLite via Guix-patches via
2023-08-05 12:34     ` Liliana Marie Prikler
2023-08-05 12:28   ` [bug#54221] [PATCH 1/2] gnu: vim: Use native-search-paths to search for plugins Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).