guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#54221] [PATCH 3/4] gnu: vim: Update package style.


From: SeerLite
Subject: [bug#54221] [PATCH 3/4] gnu: vim: Update package style.
Date: Wed, 2 Mar 2022 10:17:34 -0300

* 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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]