gnu: libdvdcss: Update to 1.4.3.
[jackhill/guix/guix.git] / gnu / packages / vim.scm
index baf6ca9..231fae9 100644 (file)
@@ -1,14 +1,15 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
-;;; Copyright © 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2018, 2019, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2019 HiPhish <hiphish@posteo.de>
 ;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
 ;;; Copyright © 2019, 2020 Jakub Kądziołka <kuba@kadziolka.net>
 ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
+;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -70,7 +71,7 @@
 (define-public vim
   (package
     (name "vim")
-    (version "8.2.2067")
+    (version "8.2.2689")
     (source (origin
              (method git-fetch)
              (uri (git-reference
              (file-name (git-file-name name version))
              (sha256
               (base32
-               "02cd953h69k9klrcwi756namwg39ka7if9ccc399ihb1l5f3kr66"))))
+               "0l0hkr8cw7fdsfc5zzcxx3q1wmv9k3hrgalvffq0l69lviqdgh0p"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
        #:parallel-tests? #f
+       ;; Fix test_signals.vim. https://github.com/vim/vim/issues/7402
+       #:make-flags (list "CFLAGS=-D_REENTRANT")
        #:phases
        (modify-phases %standard-phases
          (add-after 'configure 'patch-absolute-paths
              (substitute* "src/testdir/test_swap.vim"
                (("if !IsRoot\\(\\)") "if 0"))
 
-             ;; These tests compares output against a golden ‘…/|b|i|n|/|s|h…’
-             ;; literal.  We need to match that and substitute a similarly
-             ;; ‘spliced’ path to ‘sh’ in the store, truncated to the last
-             ;; 44 (spliced: 88) or so characters.
-             ;; Two of the tests we simply skip instead of patching the screen dump.
+             ;; 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_popupwin_term_0[1|2].*") ""))
-             ;; We replace the external program call (!) with a scroll-back (<)
-             ;; symbol and blindly fix some other differences based on error output.
-             (let ((splice (lambda (s separator)
-                               (string-join (map string (string->list s))
-                                            separator))))
-               (substitute* "src/testdir/dumps/Test_terminal_from_cmd.dump"
-                 (((splice "/bin/sh" "\\|"))
-                  (splice (string-take-right (which "sh") 44) "|"))
-                 (("^\\|!") "|<")
-                 (("@37") ""))
-               (substitute* '("src/testdir/dumps/Test_terminal_scrollback_1.dump"
-                              "src/testdir/dumps/Test_terminal_scrollback_2.dump")
-                 (((splice "/bin/sh" "\\|"))
-                  (splice (string-take-right (which "sh") 61) "|"))
-                 (("^\\|!") "|<")
-                 ((" @55") " @1"))
-               (substitute* '("src/testdir/dumps/Test_terminal_scrollback_3.dump"
-                              "src/testdir/dumps/Test_popupwin_term_03.dump"
-                              "src/testdir/dumps/Test_popupwin_term_04.dump")
-                 (((splice "/bin/sh" "\\|"))
-                  (splice (string-take-right (which "sh") 62) "|"))
-                 (("^\\|!") "|<")
-                 (("\\]\\| @56") "]| @1")))
-             #t)))))
+               ((".*Test_popup_drag_termwin.*" line)
+                (string-append line "return\n")))
+             #t))
+         (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"))
+               #t))))))
     (inputs
      `(("gawk" ,gawk)
        ("ncurses" ,ncurses)
        ("tcsh" ,tcsh)))                 ; For runtime/tools/vim32
     (native-inputs
      `(("libtool" ,libtool)
+       ("guix.vim" ,(search-auxiliary-file "guix.vim"))
 
        ;; For tests.
        ("tzdata" ,tzdata-for-tests)))
@@ -224,11 +219,14 @@ with the editor vim.")))
              "--enable-xim"
              "--disable-selinux"
              "--enable-gui")
-       ;; This flag fixes the following error:
-       ;; .../libpython3.7m.a(pyexpat.o): undefined reference to symbol 'XML_FreeContentModel'
-       ;; .../libexpat.so.1: error adding symbols: DSO missing from command line
-       #:make-flags '("LDFLAGS=-lexpat")
        ,@(substitute-keyword-arguments (package-arguments vim)
+           ;; This flag fixes the following error:
+           ;; .../libpython3.7m.a(pyexpat.o): undefined reference to symbol 'XML_FreeContentModel'
+           ;; .../libexpat.so.1: error adding symbols: DSO missing from command line
+           ((#:make-flags flags)
+            `(append
+              (list "LDFLAGS=-lexpat")
+              (delete "CFLAGS=-D_REENTRANT" ,flags)))
            ((#:phases phases)
             `(modify-phases ,phases
                (add-before 'check 'start-xserver
@@ -814,9 +812,6 @@ also works as a library for connecting to and scripting neovim processes
 through its msgpack-rpc API.")
     (license license:asl2.0)))
 
-(define-public python2-pynvim
-  (package-with-python2 python-pynvim))
-
 (define-public vim-guix-vim
   (package
     (name "vim-guix-vim")
@@ -847,7 +842,7 @@ through its msgpack-rpc API.")
 (define-public vim-asyncrun
   (package
     (name "vim-asyncrun")
-    (version "2.7.5")
+    (version "2.8.5")
     (source (origin
               (method git-fetch)
               (uri (git-reference
@@ -856,7 +851,7 @@ through its msgpack-rpc API.")
               (file-name (git-file-name name version))
               (sha256
                (base32
-                "02fiqf4rcrxbcgvj02mpd78wkxsrnbi54aciwh9fv5mnz5ka249m"))))
+                "0mxsmjv497h6w8dxw0zvqginlx0yvrvrx4z3jhq2x3y2dfvpcm41"))))
     (build-system copy-build-system)
     (arguments
      '(#:install-plan