gnu: Move Linux-Libre modules to their own section.
[jackhill/guix/guix.git] / gnu / packages / vim.scm
index 6a98f0a..8789060 100644 (file)
@@ -1,10 +1,11 @@
 ;;; 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 © 2019 HiPhish <hiphish@posteo.de>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -55,6 +56,7 @@
   #: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))
@@ -642,6 +644,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 +730,17 @@ are detected, the user is notified.")))
 (define-public neovim
   (package
     (name "neovim")
-    (version "0.3.4")
+    (version "0.3.5")
     (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"))))
+         "113lrr9gwimvvzlkwlishm4cjqcf30xq9jfxn7vh41ckgnbiwf3w"))))
     (build-system cmake-build-system)
     (arguments
      `(#:modules ((srfi srfi-26)
@@ -702,7 +758,7 @@ are detected, the user is notified.")))
              #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)))
@@ -729,10 +785,10 @@ 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-lpeg" ,lua5.1-lpeg)
+       ("lua-bitop" ,lua5.1-bitop)
+       ("lua-libmpack" ,lua5.1-libmpack)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
        ("gettext" ,gettext-minimal)