Archived
1
0
Fork 0

gnu: neovim: Use new style.

* gnu/packages/vim.scm (neovim): Use new style.
[source]: Rewrite using gexps.
[arguments]: Rewrite using gexps.
[inputs and native-inputs]: Remove input labels.
[description]: Run `guix style`.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Luis Henrique Gomes Higino 2022-05-18 10:32:25 -03:00 committed by Ludovic Courtès
parent e49a2d03bb
commit 182b25fbf5
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -659,84 +659,89 @@ are detected, the user is notified.")))
(package (package
(name "neovim") (name "neovim")
(version "0.7.0") (version "0.7.0")
(source (source (origin
(origin (method git-fetch)
(method git-fetch) (uri (git-reference
(uri (git-reference (url "https://github.com/neovim/neovim")
(url "https://github.com/neovim/neovim") (commit (string-append "v" version))))
(commit (string-append "v" version)))) (file-name (git-file-name name version))
(file-name (git-file-name name version)) (sha256
(sha256 (base32
(base32 "1m7xmry66pn27gvk7qj9di83xa1h7zjp4c6ygnf218pqhr08x06g")))) "1m7xmry66pn27gvk7qj9di83xa1h7zjp4c6ygnf218pqhr08x06g"))))
(build-system cmake-build-system) (build-system cmake-build-system)
(arguments (arguments
`(#:modules ((srfi srfi-26) (list #:modules
(guix build cmake-build-system) '((srfi srfi-26) (guix build cmake-build-system)
(guix build utils)) (guix build utils))
#:configure-flags #:configure-flags
(list ,@(if (member (if (%current-target-system) #~(list #$@(if (member (if (%current-target-system)
(gnu-triplet->nix-system (%current-target-system)) (gnu-triplet->nix-system (%current-target-system))
(%current-system)) (%current-system))
(package-supported-systems luajit)) (package-supported-systems luajit))
'() '()
'("-DPREFER_LUA:BOOL=YES"))) '("-DPREFER_LUA:BOOL=YES")))
#:phases #:phases
(modify-phases %standard-phases #~(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths (add-after 'unpack 'set-lua-paths
(lambda* (#:key inputs #:allow-other-keys) (lambda* _
(let* ((lua-version "5.1") (let* ((lua-version "5.1")
(lua-cpath-spec (lua-cpath-spec (lambda (prefix)
(lambda (prefix) (let ((path (string-append
(let ((path (string-append prefix "/lib/lua/" lua-version))) prefix
(string-append path "/?.so;" path "/?/?.so")))) "/lib/lua/"
(lua-path-spec lua-version)))
(lambda (prefix) (string-append
(let ((path (string-append prefix "/share/lua/" lua-version))) path
(string-append path "/?.lua;" path "/?/?.lua")))) "/?.so;"
(lua-inputs (map (cute assoc-ref inputs <>) path
'("lua" "/?/?.so"))))
"lua-luv" (lua-path-spec (lambda (prefix)
"lua-lpeg" (let ((path (string-append prefix
"lua-bitop" "/share/lua/"
"lua-libmpack")))) lua-version)))
(setenv "LUA_PATH" (string-append path "/?.lua;"
(string-join (map lua-path-spec lua-inputs) ";")) path "/?/?.lua"))))
(setenv "LUA_CPATH" (lua-inputs (list (or #$(this-package-input "lua")
(string-join (map lua-cpath-spec lua-inputs) ";")) #$(this-package-input "luajit"))
#t))) #$lua5.1-luv
(add-after 'unpack 'prevent-embedding-gcc-store-path #$lua5.1-lpeg
(lambda _ #$lua5.1-bitop
;; nvim remembers its build options, including the compiler with #$lua5.1-libmpack)))
;; its complete path. This adds gcc to the closure of nvim, which (setenv "LUA_PATH"
;; doubles its size. We remove the refirence here. (string-join (map lua-path-spec lua-inputs) ";"))
(substitute* "cmake/GetCompileFlags.cmake" (setenv "LUA_CPATH"
(("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc")) (string-join (map lua-cpath-spec lua-inputs) ";"))
#t))))) #t)))
(inputs (add-after 'unpack 'prevent-embedding-gcc-store-path
`(("libuv" ,libuv-for-luv) (lambda _
("msgpack" ,msgpack) ;; nvim remembers its build options, including the compiler with
("libtermkey" ,libtermkey) ;; its complete path. This adds gcc to the closure of nvim, which
("libvterm" ,libvterm) ;; doubles its size. We remove the refirence here.
("unibilium" ,unibilium) (substitute* "cmake/GetCompileFlags.cmake"
("jemalloc" ,jemalloc) (("\\$\\{CMAKE_C_COMPILER\\}") "/gnu/store/.../bin/gcc"))
("lua" ,(if (member (if (%current-target-system) #t)))))
(gnu-triplet->nix-system (%current-target-system)) (inputs (list libuv-for-luv
(%current-system)) msgpack
(package-supported-systems luajit)) libtermkey
luajit libvterm
lua-5.1)) unibilium
("lua-luv" ,lua5.1-luv) jemalloc
("lua-lpeg" ,lua5.1-lpeg) (if (member (if (%current-target-system)
("lua-bitop" ,lua5.1-bitop) (gnu-triplet->nix-system (%current-target-system))
("lua-libmpack" ,lua5.1-libmpack) (%current-system))
("tree-sitter" ,tree-sitter))) (package-supported-systems luajit))
(native-inputs luajit
`(("pkg-config" ,pkg-config) lua-5.1)
("gettext" ,gettext-minimal) lua5.1-luv
("gperf" ,gperf))) lua5.1-lpeg
lua5.1-bitop
lua5.1-libmpack
tree-sitter))
(native-inputs (list pkg-config gettext-minimal gperf))
(home-page "https://neovim.io") (home-page "https://neovim.io")
(synopsis "Fork of vim focused on extensibility and agility") (synopsis "Fork of vim focused on extensibility and agility")
(description "Neovim is a project that seeks to aggressively (description
"Neovim is a project that seeks to aggressively
refactor Vim in order to: refactor Vim in order to:
@itemize @itemize
@ -744,7 +749,8 @@ refactor Vim in order to:
@item Split the work between multiple developers @item Split the work between multiple developers
@item Enable advanced external UIs without modifications to the core @item Enable advanced external UIs without modifications to the core
@item Improve extensibility with a new plugin architecture @item Improve extensibility with a new plugin architecture
@end itemize\n") @end itemize
")
;; Neovim is licensed under the terms of the Apache 2.0 license, ;; Neovim is licensed under the terms of the Apache 2.0 license,
;; except for parts that were contributed under the Vim license. ;; except for parts that were contributed under the Vim license.
(license (list license:asl2.0 license:vim)))) (license (list license:asl2.0 license:vim))))