gnu: Use the test-only Xorg variant for tests.
[jackhill/guix/guix.git] / gnu / packages / vim.scm
index 6a98f0a..b360d1f 100644 (file)
@@ -1,10 +1,12 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
 ;;; Copyright © 2016, 2017, 2018, 2019 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016, 2017 Nils Gillmann <ng0@n0.is>
+;;; Copyright © 2016, 2017 ng0 <ng0@n0.is>
 ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
-;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2019 HiPhish <hiphish@posteo.de>
+;;; Copyright © 2019 Julien Lepiller <julien@lepiller.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +31,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system python)
   #:use-module (gnu packages)
   #:use-module (gnu packages acl)
   #:use-module (gnu packages admin) ; For GNU hostname
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages python-xyz)
   #:use-module (gnu packages ruby)
   #:use-module (gnu packages serialization)
   #:use-module (gnu packages shells)
   #:use-module (gnu packages tcl)
+  #:use-module (gnu packages text-editors)
   #:use-module (gnu packages terminals)
   #:use-module (gnu packages xdisorg)
   #:use-module (gnu packages xorg))
@@ -193,7 +198,7 @@ with the editor vim.")))
                                                     display " &")))))))))))
     (native-inputs
      `(("pkg-config" ,pkg-config)
-       ("xorg-server" ,xorg-server)
+       ("xorg-server" ,xorg-server-for-tests)
        ,@(package-native-inputs vim)))
     (inputs
      `(("acl" ,acl)
@@ -229,13 +234,14 @@ with the editor vim.")))
     (version "2.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/Shougo/neocomplete.vim/"
-                           "archive/ver." version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/Shougo/neocomplete.vim")
+              (commit (string-append "ver." version))))
+       (file-name (git-file-name name version))
        (sha256
         (base32
-         "1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
+         "1h6sci5mhdfg6sjsjpi8l5li02hg858zcayiwl60y9j2gqnd18lv"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f
@@ -478,7 +484,7 @@ trouble using them, because you do not have to remember each snippet name.")
 (define-public vim-fugitive
   (package
     (name "vim-fugitive")
-    (version "2.5")
+    (version "3.1")
     (source
       (origin
         (method git-fetch)
@@ -488,7 +494,7 @@ trouble using them, because you do not have to remember each snippet name.")
         (file-name (git-file-name name version))
         (sha256
          (base32
-          "17yz7gxn7a49jzndr4z5vnk1y4a6c22qss3mwxzmq4m46fni0k8q"))))
+          "0d9jhmidmy5c60iy9x47gqr675n5wp9wrzln83r8ima1fz7vvbgs"))))
     (build-system gnu-build-system)
     (arguments
      '(#:tests? #f
@@ -501,13 +507,15 @@ trouble using them, because you do not have to remember each snippet name.")
              (let* ((out (assoc-ref outputs "out"))
                     (vimfiles (string-append out "/share/vim/vimfiles"))
                     (autoload (string-append vimfiles "/autoload"))
-                    (doc (string-append vimfiles "/doc"))
+                    (doc      (string-append vimfiles "/doc"))
                     (ftdetect (string-append vimfiles "/ftdetect"))
-                    (plugin (string-append vimfiles "/plugin")))
+                    (plugin   (string-append vimfiles "/plugin"))
+                    (syntax   (string-append vimfiles "/syntax")))
                (copy-recursively "autoload" autoload)
                (copy-recursively "doc" doc)
                (copy-recursively "ftdetect" ftdetect)
                (copy-recursively "plugin" plugin)
+               (copy-recursively "syntax" syntax)
                #t))))))
     (home-page "https://github.com/tpope/vim-fugitive")
     (synopsis "Vim plugin to work with Git")
@@ -560,21 +568,21 @@ and powerline symbols, etc.")
 
 ;; There are no tarball releases.
 (define-public vim-airline-themes
-  (let ((commit "6026eb78bf362cb3aa875aff8487f65728d0f7d8")
-        (revision "1"))
+  (let ((commit "e6f233231b232b6027cde6aebeeb18d9138e5324")
+        (revision "2"))
     (package
       (name "vim-airline-themes")
-      (version (string-append "0.0.0-" revision "." (string-take commit 7)))
+      (version (git-version "0.0.0" revision commit))
       (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/vim-airline/vim-airline-themes")
                (commit commit)))
-         (file-name (string-append name "-" version "-checkout"))
+         (file-name (git-file-name name version))
          (sha256
           (base32
-           "13ijkavh1r0935cn2rjsfbdd1q3ka8bi26kw0bdkrqlrqxwvpss8"))))
+           "1sb7nb7j7bz0pv1c9bgdy0smhr0jk2b1vbdv9yzghg5lrknpsbr6"))))
       (build-system gnu-build-system)
       (arguments
        `(#:tests? #f
@@ -602,7 +610,7 @@ and powerline symbols, etc.")
 (define-public vim-syntastic
   (package
     (name "vim-syntastic")
-    (version "3.9.0")
+    (version "3.10.0")
     (source
      (origin
        (method git-fetch)
@@ -611,8 +619,7 @@ and powerline symbols, etc.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32
-         "121a1mxgfng2y5zmivyyk02mca8pyw72crivf4f1q9nhn0barf57"))))
+        (base32 "0j91f72jaz1s6aw1hpjiz30vk2ds2aqd9gisk91grsldy6nz6hhz"))))
     (build-system gnu-build-system)
     (arguments
      `(#:tests? #f
@@ -642,6 +649,59 @@ are detected, the user is notified.")
     (home-page "https://github.com/vim-syntastic/syntastic")
     (license license:wtfpl2)))
 
+(define-public editorconfig-vim
+  (package
+    (name "editorconfig-vim")
+    (version "0.3.3")
+    (source
+      (origin
+        (method git-fetch)
+        (uri (git-reference
+               (url "https://github.com/editorconfig/editorconfig-vim.git")
+               (commit (string-append "v" version))))
+        (file-name (git-file-name name version))
+        (sha256
+         (base32
+          "0vssfl1wjq0mv0p30c3dszwrh4yy90vwxmmdgqaxf5rykik7bdfd"))
+        (modules '((guix build utils)))
+        (snippet
+         '(begin
+            (delete-file-recursively "plugin/editorconfig-core-py") #t))))
+    (build-system gnu-build-system)
+    (arguments
+     '(#:tests? #f ; tests require ruby and plugin-test repository
+       #:phases
+       (modify-phases %standard-phases
+         (delete 'configure)
+         (delete 'build)
+         (add-after 'unpack 'patch-editorconfig-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let ((editorconfig (assoc-ref inputs "editorconfig-core")))
+               (substitute* "plugin/editorconfig.vim"
+                 (("/opt") editorconfig))
+               #t)))
+         (replace 'install
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (vimfiles (string-append out "/share/vim/vimfiles"))
+                    (doc (string-append vimfiles "/doc"))
+                    (plugin (string-append vimfiles "/plugin"))
+                    (autoload (string-append vimfiles "/autoload")))
+               (copy-recursively "doc" doc)
+               (copy-recursively "autoload" autoload)
+               (copy-recursively "plugin" plugin)
+               #t))))))
+    (inputs
+     `(("editorconfig-core" ,editorconfig-core-c)))
+    (home-page "https://editorconfig.org/")
+    (synopsis "EditorConfig plugin for Vim")
+    (description "EditorConfig makes it easy to maintain the correct coding
+style when switching between different text editors and between different
+projects.  The EditorConfig project maintains a file format and plugins for
+various text editors which allow this file format to be read and used by those
+editors.")
+    (license license:bsd-2)))
+
 (define-public neovim-syntastic
   (package
     (inherit vim-syntastic)
@@ -675,16 +735,16 @@ are detected, the user is notified.")))
 (define-public neovim
   (package
     (name "neovim")
-    (version "0.3.4")
+    (version "0.4.3")
     (source
      (origin
-       (method url-fetch)
-       (uri (string-append "https://github.com/neovim/neovim/"
-                           "archive/v" version ".tar.gz"))
-       (file-name (string-append name "-" version ".tar.gz"))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/neovim/neovim")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32
-         "03mwfhr9rq86p8lypbdfyl7c7xyn6nzv2ipd8jc33bxzvs5i0hd6"))))
+        (base32 "03p7pic7hw9yxxv7fbgls1f42apx3lik2k6mpaz1a109ngyc5kaj"))))
     (build-system cmake-build-system)
     (arguments
      `(#:modules ((srfi srfi-26)
@@ -693,16 +753,9 @@ are detected, the user is notified.")))
        #:configure-flags '("-DPREFER_LUA:BOOL=YES")
        #:phases
        (modify-phases %standard-phases
-         ;; TODO: remove 'patch-tic on update
-         ;; see: https://github.com/neovim/neovim/issues/9687
-         (add-after 'unpack 'patch-tic
-           (lambda _
-             (substitute* "src/nvim/tui/tui.c"
-               (("value != NULL") "value != NULL && value != (char *)-1"))
-             #t))
          (add-after 'unpack 'set-lua-paths
            (lambda* (#:key inputs #:allow-other-keys)
-             (let* ((lua-version "5.2")
+             (let* ((lua-version "5.1")
                     (lua-cpath-spec
                      (lambda (prefix)
                        (let ((path (string-append prefix "/lib/lua/" lua-version)))
@@ -713,6 +766,7 @@ are detected, the user is notified.")))
                          (string-append path "/?.lua;" path "/?/?.lua"))))
                     (lua-inputs (map (cute assoc-ref %build-inputs <>)
                                      '("lua"
+                                       "lua-luv"
                                        "lua-lpeg"
                                        "lua-bitop"
                                        "lua-libmpack"))))
@@ -720,7 +774,15 @@ are detected, the user is notified.")))
                        (string-join (map lua-path-spec lua-inputs) ";"))
                (setenv "LUA_CPATH"
                        (string-join (map lua-cpath-spec lua-inputs) ";"))
-               #t))))))
+               #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)))))
     (inputs
      `(("libuv" ,libuv)
        ("msgpack" ,msgpack)
@@ -729,10 +791,11 @@ are detected, the user is notified.")))
        ("unibilium" ,unibilium)
        ("jemalloc" ,jemalloc)
        ("libiconv" ,libiconv)
-       ("lua" ,lua-5.2)
-       ("lua-lpeg" ,lua5.2-lpeg)
-       ("lua-bitop" ,lua5.2-bitop)
-       ("lua-libmpack" ,lua5.2-libmpack)))
+       ("lua" ,lua-5.1)
+       ("lua-luv" ,lua5.1-luv)
+       ("lua-lpeg" ,lua5.1-lpeg)
+       ("lua-bitop" ,lua5.1-bitop)
+       ("lua-libmpack" ,lua5.1-libmpack)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("gettext" ,gettext-minimal)
@@ -755,7 +818,7 @@ refactor Vim in order to:
 (define-public vifm
   (package
     (name "vifm")
-    (version "0.10")
+    (version "0.10.1")
     (source
       (origin
         (method url-fetch)
@@ -766,35 +829,35 @@ refactor Vim in order to:
                               "vifm-" version ".tar.bz2")))
         (sha256
          (base32
-          "1f380xcyjnm4xmcdazs6dj064bwddhywvn3mgm36k7r7b2gnjnp0"))))
+          "0fyhxh7ndjn8fyjhj14ymkr3pjcs3k1xbs43g7xvvq85vdb6y04r"))))
     (build-system gnu-build-system)
     (arguments
-    '(#:configure-flags '("--disable-build-timestamp")
-      #:phases
-      (modify-phases %standard-phases
-        (add-after 'patch-source-shebangs 'patch-test-shebangs
-          (lambda _
-            (substitute* (cons* "src/background.c"
-                                "src/cfg/config.c"
-                                (find-files "tests" "\\.c$"))
-              (("/bin/sh") (which "sh"))
-              (("/bin/bash") (which "bash")))
-            ;; This test segfaults
-            (substitute* "tests/Makefile"
-              (("misc") ""))
-            #t))
-         (add-after 'install 'install-vim-plugin-files
-           (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out (assoc-ref outputs "out"))
-                    (vifm (string-append out "/share/vifm"))
-                    (vimfiles (string-append out "/share/vim/vimfiles")))
-               (copy-recursively (string-append vifm "/colors")
-                                 (string-append vimfiles "/colors"))
-               (copy-recursively (string-append vifm "/vim")
-                                 vimfiles)
-               (delete-file-recursively (string-append vifm "/colors"))
-               (delete-file-recursively (string-append vifm "/vim")))
-             #t)))))
+     '(#:configure-flags '("--disable-build-timestamp")
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'patch-source-shebangs 'patch-test-shebangs
+           (lambda _
+             (substitute* (cons* "src/background.c"
+                                 "src/cfg/config.c"
+                                 (find-files "tests" "\\.c$"))
+               (("/bin/sh") (which "sh"))
+               (("/bin/bash") (which "bash")))
+             ;; This test segfaults
+             (substitute* "tests/Makefile"
+               (("misc") ""))
+             #t))
+          (add-after 'install 'install-vim-plugin-files
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (vifm (string-append out "/share/vifm"))
+                     (vimfiles (string-append out "/share/vim/vimfiles")))
+                (copy-recursively (string-append vifm "/colors")
+                                  (string-append vimfiles "/colors"))
+                (copy-recursively (string-append vifm "/vim")
+                                  vimfiles)
+                (delete-file-recursively (string-append vifm "/colors"))
+                (delete-file-recursively (string-append vifm "/vim")))
+              #t)))))
     (native-inputs
      `(("groff" ,groff))) ; for the documentation
     (inputs
@@ -832,3 +895,29 @@ from the @command{vi}-editor:
 @end enumerate
 With the package comes a plugin to use vifm as a vim file selector.")
     (license license:gpl2+)))
+
+(define-public python-pynvim
+  (package
+    (name "python-pynvim")
+    (version "0.3.2")
+    (source (origin
+              (method url-fetch)
+              (uri (pypi-uri "pynvim" version))
+              (sha256
+               (base32
+                "01dybk4vs452pljn1q3il5z2sd313ki0lgiglc0xmjc6wp290r6g"))))
+    (build-system python-build-system)
+    (propagated-inputs
+     `(("python-greenlet" ,python-greenlet)
+       ("python-msgpack" ,python-msgpack)))
+    (arguments
+     `(#:tests? #f))
+    (home-page "https://github.com/neovim/pynvim")
+    (synopsis "Python client and plugin host for neovim")
+    (description "Pynvim implements support for python plugins in neovim.  It
+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))