* [bug#30385] Add vim-build-system
@ 2018-02-07 22:30 ng0
2018-02-28 8:54 ` ng0
2018-06-21 13:20 ` Ricardo Wurmus
0 siblings, 2 replies; 11+ messages in thread
From: ng0 @ 2018-02-07 22:30 UTC (permalink / raw)
To: 30385
[-- Attachment #1.1: Type: text/plain, Size: 971 bytes --]
This adds a first version of a functional vim-build-system.
As explained today on IRC, and as you can guess by reading
gnu/packages/vim.scm Vim has a concept of folders and files in
standard places, but Makefiles and similar tools are an
exception. Usually you have to copy them somewhere (or use
external Vim package managers that pull the files for yoz and set
the "run time path" (rtp) for you).
There's also (to my best knowledge, keep in mind I've last read
into Vim when I did the last commits in the Vim module) no ENV
VAR or anything we could export, you have to manually set
set rtp+=~/.guix-profile/share/vim/vimfiles/
in your $home/.vimrc
The build system comes with a FIXME note, but it works. I'm in
the middle of tests and exams, so this is the best I can correct
from my earlier attempt in '17 on this. What I can apply are
changes and adjustments to what I submit now.
4 Patches attached, 3 of them are for proof of work.
[-- Attachment #1.2: 0001-build-system-Add-vim-build-system.patch --]
[-- Type: text/x-patch, Size: 11105 bytes --]
From 617fc10671c18c35c0e3fcd6bc0c9d06a96a4ebf Mon Sep 17 00:00:00 2001
From: ng0 <ng0@infotropique.org>
Date: Sun, 2 Jul 2017 16:07:48 +0000
Subject: [PATCH 1/4] build-system: Add 'vim-build-system'.
* Makefile.am (MODULES): Add 'guix/build-system/vim.scm' and
'guix/build/vim-build-system.scm'.
* guix/build-system/vim.scm: New file.
* guix/build/vim-build-system.scm: New file.
---
Makefile.am | 4 +-
guix/build-system/vim.scm | 129 ++++++++++++++++++++++++++++++++++++++++
guix/build/vim-build-system.scm | 93 +++++++++++++++++++++++++++++
3 files changed, 225 insertions(+), 1 deletion(-)
create mode 100644 guix/build-system/vim.scm
create mode 100644 guix/build/vim-build-system.scm
diff --git a/Makefile.am b/Makefile.am
index eb5d38231..72ad184ef 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@
# Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
# Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
# Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
-# Copyright © 2018 ng0 <ng0@n0.is>
+# Copyright © 2018 ng0 <ng0@crash.cx>
#
# This file is part of GNU Guix.
#
@@ -106,6 +106,7 @@ MODULES = \
guix/build-system/perl.scm \
guix/build-system/python.scm \
guix/build-system/ocaml.scm \
+ guix/build-system/vim.scm \
guix/build-system/waf.scm \
guix/build-system/r.scm \
guix/build-system/ruby.scm \
@@ -134,6 +135,7 @@ MODULES = \
guix/build/font-build-system.scm \
guix/build/go-build-system.scm \
guix/build/asdf-build-system.scm \
+ guix/build/vim-build-system.scm \
guix/build/git.scm \
guix/build/hg.scm \
guix/build/glib-or-gtk-build-system.scm \
diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
new file mode 100644
index 000000000..67657c7d8
--- /dev/null
+++ b/guix/build-system/vim.scm
@@ -0,0 +1,129 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 ng0 <ng0@crash.cx>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system vim)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix derivations)
+ #:use-module (guix store)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:export (%vim-build-system-modules
+ vim-build
+ vim-build-system))
+
+;; Commentary:
+;;
+;; Standard build procedure for vim packages. This is
+;; implemented as an extension of 'gnu-build-system'.
+;;
+;; Code:
+
+(define %vim-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build vim-build-system)
+ ,@%gnu-build-system-modules))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:target #:inputs #:native-inputs))
+
+ (bag
+ (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
+ ,@(let ((compression (resolve-interface '(gnu packages compression))))
+ (map (match-lambda
+ ((name package)
+ (list name (module-ref compression package))))
+ `(("gzip" gzip)
+ ("bzip2" bzip2)
+ ("unzip" unzip)
+ ("xz" xz))))))
+ (build-inputs native-inputs)
+ (outputs outputs)
+ (build vim-build)
+ (arguments (strip-keyword-arguments private-keywords arguments))))
+
+(define* (vim-build store name inputs
+ #:key source
+ (tests? #t)
+ (test-target "test")
+ (configure-flags ''())
+ (phases '(@ (guix build vim-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %vim-build-system-modules)
+ (modules '((guix build vim-build-system)
+ (guix build utils))))
+ "Build SOURCE with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (vim-build #:name ,name
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
+ #:configure-flags ,configure-flags
+ #:system ,system
+ #:test-target ,test-target
+ #:tests? ,tests?
+ #:phases ,phases
+ #:outputs %outputs
+ #:search-paths ',(map search-path-specification->sexp
+ search-paths)
+ #:inputs %build-inputs)))
+
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system #:graft? #f))
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages commencement)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system #:graft? #f)))))
+
+ (build-expression->derivation store name builder
+ #:inputs inputs
+ #:system system
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
+
+(define vim-build-system
+ (build-system
+ (name 'vim)
+ (description "The build system for vim packages")
+ (lower lower)))
diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
new file mode 100644
index 000000000..70e8129df
--- /dev/null
+++ b/guix/build/vim-build-system.scm
@@ -0,0 +1,93 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 ng0 <ng0@crash.cx>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build vim-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module (guix build utils)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-11)
+ #:use-module (srfi srfi-26)
+ #:export (%standard-phases
+ %default-exclude
+ vim-build))
+
+;; Commentary:
+;;
+;; Builder-side code of the build procedure for vim packages.
+;;
+;; Code:
+
+;; These are the default inclusion/exclusion regexps for the install phase.
+(define %default-exclude '("^\\.github$" "^.*\\.md$" "LICENSE" "COPYING"
+ "^.*\\README.*$" "^\\.travis\\.yml$"
+ "^.*\\Makefile.*$"))
+
+(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
+
+(define (store-file->vim-source-file file)
+ "Convert FILE, a store file name for an Vim source file, into a file
+name that has been stripped of the hash and version number."
+ (let ((suffix ".vim"))
+ (let-values (((name version)
+ (package-name->name+version
+ (basename
+ (strip-store-file-name file) suffix))))
+ (string-append name suffix))))
+
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack SOURCE into the build directory. SOURCE may be a compressed
+archive, a directory or a '.vim' file."
+ (if (string-suffix? ".vim" source)
+ (begin
+ (mkdir "source")
+ (chdir "source")
+ (copy-file source (store-file->vim-source-file source))
+ #t)
+ (gnu:unpack #:source source)))
+
+;; FIXME: Files like README.md and other, more unpredictable file names,
+;; are currently being installed. Because there is no concept of a
+;; standardized build-system in Vim extensions, we have to find a long-term
+;; solution to exclusion of files that are not used at runtime.
+(define* (install #:key outputs
+ (exclude %default-exclude)
+ #:allow-other-keys)
+ "Install the package contents."
+ (let* ((out (assoc-ref outputs "out"))
+ (source (getcwd))
+ (vimfiles (string-append out "/share/vim/vimfiles")))
+ (for-each delete-file-recursively
+ (find-files source "^\\.git$"))
+ (for-each delete-file-recursively
+ (find-files source "^\\.gitignore$"))
+ (mkdir out)
+ (copy-recursively "." vimfiles)
+ #t))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
+ (delete 'configure)
+ (delete 'check)
+ (delete 'build)
+ (replace 'install install)))
+
+(define* (vim-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given vim package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.16.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.3: 0002-gnu-vim-neocomplete-Use-vim-build-system.patch --]
[-- Type: text/x-patch, Size: 1998 bytes --]
From 1b0a5ec5e59f65cfd6424a53e3bb24ad40586ed5 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@infotropique.org>
Date: Sun, 2 Jul 2017 16:11:19 +0000
Subject: [PATCH 2/4] gnu: vim-neocomplete: Use 'vim-build-system'.
* gnu/packages/vim.scm (vim-neocomplete): Switch to 'vim-build-system'.
---
gnu/packages/vim.scm | 20 ++------------------
1 file changed, 2 insertions(+), 18 deletions(-)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index abd25bc9d..7a843a0ab 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -29,6 +29,7 @@
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system vim)
#:use-module (gnu packages)
#:use-module (gnu packages acl)
#:use-module (gnu packages admin) ; For GNU hostname
@@ -209,24 +210,7 @@ with the editor vim.")))
(sha256
(base32
"1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (delete 'build)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (vimfiles (string-append out "/share/vim/vimfiles"))
- (autoload (string-append vimfiles "/autoload"))
- (doc (string-append vimfiles "/doc"))
- (plugin (string-append vimfiles "/plugin")))
- (copy-recursively "autoload" autoload)
- (copy-recursively "doc" doc)
- (copy-recursively "plugin" plugin)
- #t))))))
+ (build-system vim-build-system)
(synopsis "Next generation completion framework for Vim")
(description
"@code{neocomplete}, an abbreviation of 'neo-completion with cache',
--
2.16.1
[-- Attachment #1.4: 0003-gnu-vim-neosnippet-snippets-Use-vim-build-system.patch --]
[-- Type: text/x-patch, Size: 2010 bytes --]
From cdbd15cf00e0bc1489437845f6c7f60fd517ab9a Mon Sep 17 00:00:00 2001
From: ng0 <ng0@crash.cx>
Date: Wed, 7 Feb 2018 22:07:14 +0000
Subject: [PATCH 3/4] gnu: vim-neosnippet-snippets: Use 'vim-build-system'.
* gnu/packages/vim.scm (vim-neosnippet-snippets): Switch to 'vim-build-system'.
---
gnu/packages/vim.scm | 17 ++---------------
1 file changed, 2 insertions(+), 15 deletions(-)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 7a843a0ab..13afbaeb4 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
+;;; Copyright © 2016, 2017, 2018 ng0 <ng0@crash.cx>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
@@ -238,20 +238,7 @@ features than Vim's built-in completion.")
(sha256
(base32
"151wpvbj6jb9jdkbhj3b77f5sq7y328spvwfbqyj1y32rg4ifmc6"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (delete 'build)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (vimfiles (string-append out "/share/vim/vimfiles")))
- (copy-recursively "neosnippets"
- (string-append vimfiles "/neosnippets"))
- #t))))))
+ (build-system vim-build-system)
(synopsis "Snippets for neosnippet")
(description
"@code{neosnippet-snippets} provides standard snippets for the Vim plugin
--
2.16.1
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.5: 0004-gnu-vim-neosnippet-Use-vim-build-system.patch --]
[-- Type: text/x-patch, Size: 2290 bytes --]
From 09cc9c735da27d0adb1ef141bbd2b7d37e1d6754 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@crash.cx>
Date: Wed, 7 Feb 2018 22:14:58 +0000
Subject: [PATCH 4/4] gnu: vim-neosnippet: Use 'vim-build-system'.
* gnu/packages/vim.scm (vim-neosnippet): Switch to 'vim-build-system'.
---
gnu/packages/vim.scm | 29 +----------------------------
1 file changed, 1 insertion(+), 28 deletions(-)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 13afbaeb4..99361fa5d 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -264,34 +264,7 @@ you can fill in on the fly.")
(sha256
(base32
"0k80syscmpnj38ks1fq02ds59g0r4jlg9ll7z4qc048mgi35alw5"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (delete 'build)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (vimfiles (string-append out "/share/vim/vimfiles"))
- (autoload (string-append vimfiles "/autoload"))
- (doc (string-append vimfiles "/doc"))
- (ftdetect (string-append vimfiles "/ftdetect"))
- (ftplugin (string-append vimfiles "/ftplugin"))
- (indent (string-append vimfiles "/indent"))
- (plugin (string-append vimfiles "/plugin"))
- (rplugin (string-append vimfiles "/rplugin"))
- (syntax (string-append vimfiles "/syntax")))
- (copy-recursively "autoload" autoload)
- (copy-recursively "doc" doc)
- (copy-recursively "ftdetect" ftdetect)
- (copy-recursively "ftplugin" ftplugin)
- (copy-recursively "indent" indent)
- (copy-recursively "plugin" plugin)
- (copy-recursively "rplugin" rplugin)
- (copy-recursively "syntax" syntax)
- #t))))))
+ (build-system vim-build-system)
(synopsis "Snippet support for Vim")
(description
"@code{neosnippet}, is a plugin for Vim which adds snippet support to Vim.
--
2.16.1
[-- Attachment #1.6: Type: text/plain, Size: 98 bytes --]
--
ng0 :: https://ea.n0.is
A88C8ADD129828D7EAC02E52E22F9BBFEE348588 :: https://ea.n0.is/keys/
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [bug#30385] Add vim-build-system
2018-02-07 22:30 [bug#30385] Add vim-build-system ng0
@ 2018-02-28 8:54 ` ng0
2018-02-28 22:08 ` Ludovic Courtès
2018-06-21 13:20 ` Ricardo Wurmus
1 sibling, 1 reply; 11+ messages in thread
From: ng0 @ 2018-02-28 8:54 UTC (permalink / raw)
To: 30385
[-- Attachment #1: Type: text/plain, Size: 19684 bytes --]
ng0@crash.cx transcribed 19K bytes:
> This adds a first version of a functional vim-build-system.
>
> As explained today on IRC, and as you can guess by reading
> gnu/packages/vim.scm Vim has a concept of folders and files in
> standard places, but Makefiles and similar tools are an
> exception. Usually you have to copy them somewhere (or use
> external Vim package managers that pull the files for yoz and set
> the "run time path" (rtp) for you).
>
> There's also (to my best knowledge, keep in mind I've last read
> into Vim when I did the last commits in the Vim module) no ENV
> VAR or anything we could export, you have to manually set
>
> set rtp+=~/.guix-profile/share/vim/vimfiles/
>
> in your $home/.vimrc
>
> The build system comes with a FIXME note, but it works. I'm in
> the middle of tests and exams, so this is the best I can correct
> from my earlier attempt in '17 on this. What I can apply are
> changes and adjustments to what I submit now.
>
> 4 Patches attached, 3 of them are for proof of work.
>
Are 4 patches too much? Do we have no vim users here?
I've never written a build system for Guix before, so
if anyone feels like doing the QA here that would be
nice.
> From 617fc10671c18c35c0e3fcd6bc0c9d06a96a4ebf Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@infotropique.org>
> Date: Sun, 2 Jul 2017 16:07:48 +0000
> Subject: [PATCH 1/4] build-system: Add 'vim-build-system'.
>
> * Makefile.am (MODULES): Add 'guix/build-system/vim.scm' and
> 'guix/build/vim-build-system.scm'.
> * guix/build-system/vim.scm: New file.
> * guix/build/vim-build-system.scm: New file.
> ---
> Makefile.am | 4 +-
> guix/build-system/vim.scm | 129 ++++++++++++++++++++++++++++++++++++++++
> guix/build/vim-build-system.scm | 93 +++++++++++++++++++++++++++++
> 3 files changed, 225 insertions(+), 1 deletion(-)
> create mode 100644 guix/build-system/vim.scm
> create mode 100644 guix/build/vim-build-system.scm
>
> diff --git a/Makefile.am b/Makefile.am
> index eb5d38231..72ad184ef 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -9,7 +9,7 @@
> # Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
> # Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
> # Copyright © 2017 Arun Isaac <arunisaac@systemreboot.net>
> -# Copyright © 2018 ng0 <ng0@n0.is>
> +# Copyright © 2018 ng0 <ng0@crash.cx>
> #
> # This file is part of GNU Guix.
> #
> @@ -106,6 +106,7 @@ MODULES = \
> guix/build-system/perl.scm \
> guix/build-system/python.scm \
> guix/build-system/ocaml.scm \
> + guix/build-system/vim.scm \
> guix/build-system/waf.scm \
> guix/build-system/r.scm \
> guix/build-system/ruby.scm \
> @@ -134,6 +135,7 @@ MODULES = \
> guix/build/font-build-system.scm \
> guix/build/go-build-system.scm \
> guix/build/asdf-build-system.scm \
> + guix/build/vim-build-system.scm \
> guix/build/git.scm \
> guix/build/hg.scm \
> guix/build/glib-or-gtk-build-system.scm \
> diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
> new file mode 100644
> index 000000000..67657c7d8
> --- /dev/null
> +++ b/guix/build-system/vim.scm
> @@ -0,0 +1,129 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2018 ng0 <ng0@crash.cx>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build-system vim)
> + #:use-module (guix utils)
> + #:use-module (guix packages)
> + #:use-module (guix derivations)
> + #:use-module (guix store)
> + #:use-module (guix search-paths)
> + #:use-module (guix build-system)
> + #:use-module (guix build-system gnu)
> + #:use-module (ice-9 match)
> + #:export (%vim-build-system-modules
> + vim-build
> + vim-build-system))
> +
> +;; Commentary:
> +;;
> +;; Standard build procedure for vim packages. This is
> +;; implemented as an extension of 'gnu-build-system'.
> +;;
> +;; Code:
> +
> +(define %vim-build-system-modules
> + ;; Build-side modules imported by default.
> + `((guix build vim-build-system)
> + ,@%gnu-build-system-modules))
> +
> +(define* (lower name
> + #:key source inputs native-inputs outputs system target
> + #:allow-other-keys
> + #:rest arguments)
> + "Return a bag for NAME."
> + (define private-keywords
> + '(#:target #:inputs #:native-inputs))
> +
> + (bag
> + (name name)
> + (system system)
> + (host-inputs `(,@(if source
> + `(("source" ,source))
> + '())
> + ,@inputs
> + ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
> + ,@(let ((compression (resolve-interface '(gnu packages compression))))
> + (map (match-lambda
> + ((name package)
> + (list name (module-ref compression package))))
> + `(("gzip" gzip)
> + ("bzip2" bzip2)
> + ("unzip" unzip)
> + ("xz" xz))))))
> + (build-inputs native-inputs)
> + (outputs outputs)
> + (build vim-build)
> + (arguments (strip-keyword-arguments private-keywords arguments))))
> +
> +(define* (vim-build store name inputs
> + #:key source
> + (tests? #t)
> + (test-target "test")
> + (configure-flags ''())
> + (phases '(@ (guix build vim-build-system)
> + %standard-phases))
> + (outputs '("out"))
> + (search-paths '())
> + (system (%current-system))
> + (guile #f)
> + (imported-modules %vim-build-system-modules)
> + (modules '((guix build vim-build-system)
> + (guix build utils))))
> + "Build SOURCE with INPUTS."
> + (define builder
> + `(begin
> + (use-modules ,@modules)
> + (vim-build #:name ,name
> + #:source ,(match (assoc-ref inputs "source")
> + (((? derivation? source))
> + (derivation->output-path source))
> + ((source)
> + source)
> + (source
> + source))
> + #:configure-flags ,configure-flags
> + #:system ,system
> + #:test-target ,test-target
> + #:tests? ,tests?
> + #:phases ,phases
> + #:outputs %outputs
> + #:search-paths ',(map search-path-specification->sexp
> + search-paths)
> + #:inputs %build-inputs)))
> +
> + (define guile-for-build
> + (match guile
> + ((? package?)
> + (package-derivation store guile system #:graft? #f))
> + (#f ; the default
> + (let* ((distro (resolve-interface '(gnu packages commencement)))
> + (guile (module-ref distro 'guile-final)))
> + (package-derivation store guile system #:graft? #f)))))
> +
> + (build-expression->derivation store name builder
> + #:inputs inputs
> + #:system system
> + #:modules imported-modules
> + #:outputs outputs
> + #:guile-for-build guile-for-build))
> +
> +(define vim-build-system
> + (build-system
> + (name 'vim)
> + (description "The build system for vim packages")
> + (lower lower)))
> diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
> new file mode 100644
> index 000000000..70e8129df
> --- /dev/null
> +++ b/guix/build/vim-build-system.scm
> @@ -0,0 +1,93 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2018 ng0 <ng0@crash.cx>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build vim-build-system)
> + #:use-module ((guix build gnu-build-system) #:prefix gnu:)
> + #:use-module (guix build utils)
> + #:use-module (srfi srfi-1)
> + #:use-module (srfi srfi-11)
> + #:use-module (srfi srfi-26)
> + #:export (%standard-phases
> + %default-exclude
> + vim-build))
> +
> +;; Commentary:
> +;;
> +;; Builder-side code of the build procedure for vim packages.
> +;;
> +;; Code:
> +
> +;; These are the default inclusion/exclusion regexps for the install phase.
> +(define %default-exclude '("^\\.github$" "^.*\\.md$" "LICENSE" "COPYING"
> + "^.*\\README.*$" "^\\.travis\\.yml$"
> + "^.*\\Makefile.*$"))
> +
> +(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
> +
> +(define (store-file->vim-source-file file)
> + "Convert FILE, a store file name for an Vim source file, into a file
> +name that has been stripped of the hash and version number."
> + (let ((suffix ".vim"))
> + (let-values (((name version)
> + (package-name->name+version
> + (basename
> + (strip-store-file-name file) suffix))))
> + (string-append name suffix))))
> +
> +(define* (unpack #:key source #:allow-other-keys)
> + "Unpack SOURCE into the build directory. SOURCE may be a compressed
> +archive, a directory or a '.vim' file."
> + (if (string-suffix? ".vim" source)
> + (begin
> + (mkdir "source")
> + (chdir "source")
> + (copy-file source (store-file->vim-source-file source))
> + #t)
> + (gnu:unpack #:source source)))
> +
> +;; FIXME: Files like README.md and other, more unpredictable file names,
> +;; are currently being installed. Because there is no concept of a
> +;; standardized build-system in Vim extensions, we have to find a long-term
> +;; solution to exclusion of files that are not used at runtime.
> +(define* (install #:key outputs
> + (exclude %default-exclude)
> + #:allow-other-keys)
> + "Install the package contents."
> + (let* ((out (assoc-ref outputs "out"))
> + (source (getcwd))
> + (vimfiles (string-append out "/share/vim/vimfiles")))
> + (for-each delete-file-recursively
> + (find-files source "^\\.git$"))
> + (for-each delete-file-recursively
> + (find-files source "^\\.gitignore$"))
> + (mkdir out)
> + (copy-recursively "." vimfiles)
> + #t))
> +
> +(define %standard-phases
> + (modify-phases gnu:%standard-phases
> + (replace 'unpack unpack)
> + (delete 'configure)
> + (delete 'check)
> + (delete 'build)
> + (replace 'install install)))
> +
> +(define* (vim-build #:key inputs (phases %standard-phases)
> + #:allow-other-keys #:rest args)
> + "Build the given vim package, applying all of PHASES in order."
> + (apply gnu:gnu-build #:inputs inputs #:phases phases args))
> --
> 2.16.1
>
> From 1b0a5ec5e59f65cfd6424a53e3bb24ad40586ed5 Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@infotropique.org>
> Date: Sun, 2 Jul 2017 16:11:19 +0000
> Subject: [PATCH 2/4] gnu: vim-neocomplete: Use 'vim-build-system'.
>
> * gnu/packages/vim.scm (vim-neocomplete): Switch to 'vim-build-system'.
> ---
> gnu/packages/vim.scm | 20 ++------------------
> 1 file changed, 2 insertions(+), 18 deletions(-)
>
> diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> index abd25bc9d..7a843a0ab 100644
> --- a/gnu/packages/vim.scm
> +++ b/gnu/packages/vim.scm
> @@ -29,6 +29,7 @@
> #:use-module (guix git-download)
> #:use-module (guix build-system cmake)
> #:use-module (guix build-system gnu)
> + #:use-module (guix build-system vim)
> #:use-module (gnu packages)
> #:use-module (gnu packages acl)
> #:use-module (gnu packages admin) ; For GNU hostname
> @@ -209,24 +210,7 @@ with the editor vim.")))
> (sha256
> (base32
> "1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
> - (build-system gnu-build-system)
> - (arguments
> - `(#:tests? #f
> - #:phases
> - (modify-phases %standard-phases
> - (delete 'configure)
> - (delete 'build)
> - (replace 'install
> - (lambda* (#:key outputs #:allow-other-keys)
> - (let* ((out (assoc-ref outputs "out"))
> - (vimfiles (string-append out "/share/vim/vimfiles"))
> - (autoload (string-append vimfiles "/autoload"))
> - (doc (string-append vimfiles "/doc"))
> - (plugin (string-append vimfiles "/plugin")))
> - (copy-recursively "autoload" autoload)
> - (copy-recursively "doc" doc)
> - (copy-recursively "plugin" plugin)
> - #t))))))
> + (build-system vim-build-system)
> (synopsis "Next generation completion framework for Vim")
> (description
> "@code{neocomplete}, an abbreviation of 'neo-completion with cache',
> --
> 2.16.1
>
> From cdbd15cf00e0bc1489437845f6c7f60fd517ab9a Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@crash.cx>
> Date: Wed, 7 Feb 2018 22:07:14 +0000
> Subject: [PATCH 3/4] gnu: vim-neosnippet-snippets: Use 'vim-build-system'.
>
> * gnu/packages/vim.scm (vim-neosnippet-snippets): Switch to 'vim-build-system'.
> ---
> gnu/packages/vim.scm | 17 ++---------------
> 1 file changed, 2 insertions(+), 15 deletions(-)
>
> diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> index 7a843a0ab..13afbaeb4 100644
> --- a/gnu/packages/vim.scm
> +++ b/gnu/packages/vim.scm
> @@ -1,7 +1,7 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
> ;;; Copyright © 2016, 2017, 2018 Efraim Flashner <efraim@flashner.co.il>
> -;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
> +;;; Copyright © 2016, 2017, 2018 ng0 <ng0@crash.cx>
> ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
> ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
> ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
> @@ -238,20 +238,7 @@ features than Vim's built-in completion.")
> (sha256
> (base32
> "151wpvbj6jb9jdkbhj3b77f5sq7y328spvwfbqyj1y32rg4ifmc6"))))
> - (build-system gnu-build-system)
> - (arguments
> - `(#:tests? #f
> - #:phases
> - (modify-phases %standard-phases
> - (delete 'configure)
> - (delete 'build)
> - (replace 'install
> - (lambda* (#:key outputs #:allow-other-keys)
> - (let* ((out (assoc-ref outputs "out"))
> - (vimfiles (string-append out "/share/vim/vimfiles")))
> - (copy-recursively "neosnippets"
> - (string-append vimfiles "/neosnippets"))
> - #t))))))
> + (build-system vim-build-system)
> (synopsis "Snippets for neosnippet")
> (description
> "@code{neosnippet-snippets} provides standard snippets for the Vim plugin
> --
> 2.16.1
>
> From 09cc9c735da27d0adb1ef141bbd2b7d37e1d6754 Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@crash.cx>
> Date: Wed, 7 Feb 2018 22:14:58 +0000
> Subject: [PATCH 4/4] gnu: vim-neosnippet: Use 'vim-build-system'.
>
> * gnu/packages/vim.scm (vim-neosnippet): Switch to 'vim-build-system'.
> ---
> gnu/packages/vim.scm | 29 +----------------------------
> 1 file changed, 1 insertion(+), 28 deletions(-)
>
> diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> index 13afbaeb4..99361fa5d 100644
> --- a/gnu/packages/vim.scm
> +++ b/gnu/packages/vim.scm
> @@ -264,34 +264,7 @@ you can fill in on the fly.")
> (sha256
> (base32
> "0k80syscmpnj38ks1fq02ds59g0r4jlg9ll7z4qc048mgi35alw5"))))
> - (build-system gnu-build-system)
> - (arguments
> - `(#:tests? #f
> - #:phases
> - (modify-phases %standard-phases
> - (delete 'configure)
> - (delete 'build)
> - (replace 'install
> - (lambda* (#:key outputs #:allow-other-keys)
> - (let* ((out (assoc-ref outputs "out"))
> - (vimfiles (string-append out "/share/vim/vimfiles"))
> - (autoload (string-append vimfiles "/autoload"))
> - (doc (string-append vimfiles "/doc"))
> - (ftdetect (string-append vimfiles "/ftdetect"))
> - (ftplugin (string-append vimfiles "/ftplugin"))
> - (indent (string-append vimfiles "/indent"))
> - (plugin (string-append vimfiles "/plugin"))
> - (rplugin (string-append vimfiles "/rplugin"))
> - (syntax (string-append vimfiles "/syntax")))
> - (copy-recursively "autoload" autoload)
> - (copy-recursively "doc" doc)
> - (copy-recursively "ftdetect" ftdetect)
> - (copy-recursively "ftplugin" ftplugin)
> - (copy-recursively "indent" indent)
> - (copy-recursively "plugin" plugin)
> - (copy-recursively "rplugin" rplugin)
> - (copy-recursively "syntax" syntax)
> - #t))))))
> + (build-system vim-build-system)
> (synopsis "Snippet support for Vim")
> (description
> "@code{neosnippet}, is a plugin for Vim which adds snippet support to Vim.
> --
> 2.16.1
>
> --
> ng0 :: https://ea.n0.is
> A88C8ADD129828D7EAC02E52E22F9BBFEE348588 :: https://ea.n0.is/keys/
--
A88C8ADD129828D7EAC02E52E22F9BBFEE348588
https://n0.is
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#30385] Add vim-build-system
2018-02-28 8:54 ` ng0
@ 2018-02-28 22:08 ` Ludovic Courtès
0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2018-02-28 22:08 UTC (permalink / raw)
To: ng0; +Cc: 30385
Hello ng0,
ng0 <ng0@n0.is> skribis:
> Are 4 patches too much?
As you can see on <https://bugs.gnu.org/guix-patches>, this is not the
only patch waiting for review.
All I can suggest is being patient, I’m sure everyone is doing their
best. :-)
Thanks,
Ludo’.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#30385] Add vim-build-system
2018-02-07 22:30 [bug#30385] Add vim-build-system ng0
2018-02-28 8:54 ` ng0
@ 2018-06-21 13:20 ` Ricardo Wurmus
2018-06-26 14:47 ` Nils Gillmann
1 sibling, 1 reply; 11+ messages in thread
From: Ricardo Wurmus @ 2018-06-21 13:20 UTC (permalink / raw)
To: ng0; +Cc: 30385
[-- Attachment #1: Type: text/plain, Size: 1003 bytes --]
> This adds a first version of a functional vim-build-system.
Thank you.
Sorry for the delay. I just went through this but found a couple of
defects.
I fixed the regular expressions in %default-exclude, removed unused
module imports, and fixed minor indentation problems, but then I noticed
a few more fundamental problems.
* %default-exclude is not used. The “install” phase unconditionally
installs everything
* The build system does not support an #:exclude argument that would
allow a user to override the behaviour. (Compare this to the
ant-build-system, which supports excluding tests, for example.)
* The build system allows users to specify a test-target and disable
tests (they default to #t), but there is no check phase anyway. It
also supports configure-flags, but it would not use them.
Attached is the patch with my minor changes.
Could you please send an updated patch where these problems are
addressed?
Thanks!
--
Ricardo
[-- Attachment #2: 0001-build-system-Add-vim-build-system.patch --]
[-- Type: text/x-patch, Size: 10709 bytes --]
From 7decc6cd27af54994abfc396beaeae68a6acd69a Mon Sep 17 00:00:00 2001
From: ng0 <ng0@infotropique.org>
Date: Sun, 2 Jul 2017 16:07:48 +0000
Subject: [PATCH] build-system: Add vim-build-system.
* Makefile.am (MODULES): Add guix/build-system/vim.scm and
guix/build/vim-build-system.scm.
* guix/build-system/vim.scm: New file.
* guix/build/vim-build-system.scm: New file.
Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
---
Makefile.am | 2 +
guix/build-system/vim.scm | 129 ++++++++++++++++++++++++++++++++
guix/build/vim-build-system.scm | 91 ++++++++++++++++++++++
3 files changed, 222 insertions(+)
create mode 100644 guix/build-system/vim.scm
create mode 100644 guix/build/vim-build-system.scm
diff --git a/Makefile.am b/Makefile.am
index ab145065d..b5d910139 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -114,6 +114,7 @@ MODULES = \
guix/build-system/perl.scm \
guix/build-system/python.scm \
guix/build-system/ocaml.scm \
+ guix/build-system/vim.scm \
guix/build-system/waf.scm \
guix/build-system/r.scm \
guix/build-system/ruby.scm \
@@ -143,6 +144,7 @@ MODULES = \
guix/build/font-build-system.scm \
guix/build/go-build-system.scm \
guix/build/asdf-build-system.scm \
+ guix/build/vim-build-system.scm \
guix/build/git.scm \
guix/build/hg.scm \
guix/build/glib-or-gtk-build-system.scm \
diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
new file mode 100644
index 000000000..9bd44e077
--- /dev/null
+++ b/guix/build-system/vim.scm
@@ -0,0 +1,129 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 ng0 <ng0@crash.cx>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system vim)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix derivations)
+ #:use-module (guix store)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:export (%vim-build-system-modules
+ vim-build
+ vim-build-system))
+
+;; Commentary:
+;;
+;; Standard build procedure for vim packages. This is
+;; implemented as an extension of 'gnu-build-system'.
+;;
+;; Code:
+
+(define %vim-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build vim-build-system)
+ ,@%gnu-build-system-modules))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:target #:inputs #:exclude #:native-inputs))
+
+ (bag
+ (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
+ ,@(let ((compression (resolve-interface '(gnu packages compression))))
+ (map (match-lambda
+ ((name package)
+ (list name (module-ref compression package))))
+ `(("gzip" gzip)
+ ("bzip2" bzip2)
+ ("unzip" unzip)
+ ("xz" xz))))))
+ (build-inputs native-inputs)
+ (outputs outputs)
+ (build vim-build)
+ (arguments (strip-keyword-arguments private-keywords arguments))))
+
+(define* (vim-build store name inputs
+ #:key source
+ (tests? #t)
+ (test-target "test")
+ (configure-flags ''())
+ (phases '(@ (guix build vim-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %vim-build-system-modules)
+ (modules '((guix build vim-build-system)
+ (guix build utils))))
+ "Build SOURCE with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (vim-build #:name ,name
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
+ #:configure-flags ,configure-flags
+ #:system ,system
+ #:test-target ,test-target
+ #:tests? ,tests?
+ #:phases ,phases
+ #:outputs %outputs
+ #:search-paths ',(map search-path-specification->sexp
+ search-paths)
+ #:inputs %build-inputs)))
+
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system #:graft? #f))
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages commencement)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system #:graft? #f)))))
+
+ (build-expression->derivation store name builder
+ #:inputs inputs
+ #:system system
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
+
+(define vim-build-system
+ (build-system
+ (name 'vim)
+ (description "The build system for vim packages")
+ (lower lower)))
diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
new file mode 100644
index 000000000..a8a6221e9
--- /dev/null
+++ b/guix/build/vim-build-system.scm
@@ -0,0 +1,91 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2018 ng0 <ng0@crash.cx>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build vim-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module (guix build utils)
+ #:use-module (srfi srfi-11)
+ #:export (%standard-phases
+ %default-exclude
+ vim-build))
+
+;; Commentary:
+;;
+;; Builder-side code of the build procedure for vim packages.
+;;
+;; Code:
+
+;; These are the default inclusion/exclusion regexps for the install phase.
+(define %default-exclude '("^.github$" "^.*\\.md$" "LICENSE" "COPYING"
+ "^.*README.*$" "^\\.travis\\.yml$"
+ "^.*Makefile.*$"))
+
+(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
+
+(define (store-file->vim-source-file file)
+ "Convert FILE, a store file name for an Vim source file, into a file
+name that has been stripped of the hash and version number."
+ (let ((suffix ".vim"))
+ (let-values (((name version)
+ (package-name->name+version
+ (basename
+ (strip-store-file-name file) suffix))))
+ (string-append name suffix))))
+
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack SOURCE into the build directory. SOURCE may be a compressed
+archive, a directory or a '.vim' file."
+ (if (string-suffix? ".vim" source)
+ (begin
+ (mkdir "source")
+ (chdir "source")
+ (copy-file source (store-file->vim-source-file source))
+ #t)
+ (gnu:unpack #:source source)))
+
+;; FIXME: Files like README.md and other, more unpredictable file names,
+;; are currently being installed. Because there is no concept of a
+;; standardized build-system in Vim extensions, we have to find a long-term
+;; solution to exclusion of files that are not used at runtime.
+(define* (install #:key outputs
+ (exclude %default-exclude)
+ #:allow-other-keys)
+ "Install the package contents."
+ (let* ((out (assoc-ref outputs "out"))
+ (source (getcwd))
+ (vimfiles (string-append out "/share/vim/vimfiles")))
+ (for-each delete-file-recursively
+ (find-files source "^\\.git$"))
+ (for-each delete-file-recursively
+ (find-files source "^\\.gitignore$"))
+ (mkdir out)
+ (copy-recursively "." vimfiles)
+ #t))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
+ (delete 'configure)
+ (delete 'check)
+ (delete 'build)
+ (replace 'install install)))
+
+(define* (vim-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given vim package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.17.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [bug#30385] Add vim-build-system
2018-06-21 13:20 ` Ricardo Wurmus
@ 2018-06-26 14:47 ` Nils Gillmann
0 siblings, 0 replies; 11+ messages in thread
From: Nils Gillmann @ 2018-06-26 14:47 UTC (permalink / raw)
To: Ricardo Wurmus; +Cc: 30385, ng0
Ricardo Wurmus transcribed 11K bytes:
>
> > This adds a first version of a functional vim-build-system.
>
> Thank you.
>
> Sorry for the delay. I just went through this but found a couple of
> defects.
>
> I fixed the regular expressions in %default-exclude, removed unused
> module imports, and fixed minor indentation problems, but then I noticed
> a few more fundamental problems.
>
> * %default-exclude is not used. The “install” phase unconditionally
> installs everything
>
> * The build system does not support an #:exclude argument that would
> allow a user to override the behaviour. (Compare this to the
> ant-build-system, which supports excluding tests, for example.)
>
> * The build system allows users to specify a test-target and disable
> tests (they default to #t), but there is no check phase anyway. It
> also supports configure-flags, but it would not use them.
>
> Attached is the patch with my minor changes.
>
> Could you please send an updated patch where these problems are
> addressed?
>
> Thanks!
Hi,
thanks again for your review. I'm currently busy, I had no time to
work on an update. I will send one soon enough.
This is just as a notice that I'll do it, there's just other tasks
keeping me occupied.
> --
> Ricardo
>
> From 7decc6cd27af54994abfc396beaeae68a6acd69a Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@infotropique.org>
> Date: Sun, 2 Jul 2017 16:07:48 +0000
> Subject: [PATCH] build-system: Add vim-build-system.
>
> * Makefile.am (MODULES): Add guix/build-system/vim.scm and
> guix/build/vim-build-system.scm.
> * guix/build-system/vim.scm: New file.
> * guix/build/vim-build-system.scm: New file.
>
> Signed-off-by: Ricardo Wurmus <rekado@elephly.net>
> ---
> Makefile.am | 2 +
> guix/build-system/vim.scm | 129 ++++++++++++++++++++++++++++++++
> guix/build/vim-build-system.scm | 91 ++++++++++++++++++++++
> 3 files changed, 222 insertions(+)
> create mode 100644 guix/build-system/vim.scm
> create mode 100644 guix/build/vim-build-system.scm
>
> diff --git a/Makefile.am b/Makefile.am
> index ab145065d..b5d910139 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -114,6 +114,7 @@ MODULES = \
> guix/build-system/perl.scm \
> guix/build-system/python.scm \
> guix/build-system/ocaml.scm \
> + guix/build-system/vim.scm \
> guix/build-system/waf.scm \
> guix/build-system/r.scm \
> guix/build-system/ruby.scm \
> @@ -143,6 +144,7 @@ MODULES = \
> guix/build/font-build-system.scm \
> guix/build/go-build-system.scm \
> guix/build/asdf-build-system.scm \
> + guix/build/vim-build-system.scm \
> guix/build/git.scm \
> guix/build/hg.scm \
> guix/build/glib-or-gtk-build-system.scm \
> diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
> new file mode 100644
> index 000000000..9bd44e077
> --- /dev/null
> +++ b/guix/build-system/vim.scm
> @@ -0,0 +1,129 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2018 ng0 <ng0@crash.cx>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build-system vim)
> + #:use-module (guix utils)
> + #:use-module (guix packages)
> + #:use-module (guix derivations)
> + #:use-module (guix store)
> + #:use-module (guix search-paths)
> + #:use-module (guix build-system)
> + #:use-module (guix build-system gnu)
> + #:use-module (ice-9 match)
> + #:export (%vim-build-system-modules
> + vim-build
> + vim-build-system))
> +
> +;; Commentary:
> +;;
> +;; Standard build procedure for vim packages. This is
> +;; implemented as an extension of 'gnu-build-system'.
> +;;
> +;; Code:
> +
> +(define %vim-build-system-modules
> + ;; Build-side modules imported by default.
> + `((guix build vim-build-system)
> + ,@%gnu-build-system-modules))
> +
> +(define* (lower name
> + #:key source inputs native-inputs outputs system target
> + #:allow-other-keys
> + #:rest arguments)
> + "Return a bag for NAME."
> + (define private-keywords
> + '(#:target #:inputs #:exclude #:native-inputs))
> +
> + (bag
> + (name name)
> + (system system)
> + (host-inputs `(,@(if source
> + `(("source" ,source))
> + '())
> + ,@inputs
> + ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
> + ,@(let ((compression (resolve-interface '(gnu packages compression))))
> + (map (match-lambda
> + ((name package)
> + (list name (module-ref compression package))))
> + `(("gzip" gzip)
> + ("bzip2" bzip2)
> + ("unzip" unzip)
> + ("xz" xz))))))
> + (build-inputs native-inputs)
> + (outputs outputs)
> + (build vim-build)
> + (arguments (strip-keyword-arguments private-keywords arguments))))
> +
> +(define* (vim-build store name inputs
> + #:key source
> + (tests? #t)
> + (test-target "test")
> + (configure-flags ''())
> + (phases '(@ (guix build vim-build-system)
> + %standard-phases))
> + (outputs '("out"))
> + (search-paths '())
> + (system (%current-system))
> + (guile #f)
> + (imported-modules %vim-build-system-modules)
> + (modules '((guix build vim-build-system)
> + (guix build utils))))
> + "Build SOURCE with INPUTS."
> + (define builder
> + `(begin
> + (use-modules ,@modules)
> + (vim-build #:name ,name
> + #:source ,(match (assoc-ref inputs "source")
> + (((? derivation? source))
> + (derivation->output-path source))
> + ((source)
> + source)
> + (source
> + source))
> + #:configure-flags ,configure-flags
> + #:system ,system
> + #:test-target ,test-target
> + #:tests? ,tests?
> + #:phases ,phases
> + #:outputs %outputs
> + #:search-paths ',(map search-path-specification->sexp
> + search-paths)
> + #:inputs %build-inputs)))
> +
> + (define guile-for-build
> + (match guile
> + ((? package?)
> + (package-derivation store guile system #:graft? #f))
> + (#f ; the default
> + (let* ((distro (resolve-interface '(gnu packages commencement)))
> + (guile (module-ref distro 'guile-final)))
> + (package-derivation store guile system #:graft? #f)))))
> +
> + (build-expression->derivation store name builder
> + #:inputs inputs
> + #:system system
> + #:modules imported-modules
> + #:outputs outputs
> + #:guile-for-build guile-for-build))
> +
> +(define vim-build-system
> + (build-system
> + (name 'vim)
> + (description "The build system for vim packages")
> + (lower lower)))
> diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
> new file mode 100644
> index 000000000..a8a6221e9
> --- /dev/null
> +++ b/guix/build/vim-build-system.scm
> @@ -0,0 +1,91 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2018 ng0 <ng0@crash.cx>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build vim-build-system)
> + #:use-module ((guix build gnu-build-system) #:prefix gnu:)
> + #:use-module (guix build utils)
> + #:use-module (srfi srfi-11)
> + #:export (%standard-phases
> + %default-exclude
> + vim-build))
> +
> +;; Commentary:
> +;;
> +;; Builder-side code of the build procedure for vim packages.
> +;;
> +;; Code:
> +
> +;; These are the default inclusion/exclusion regexps for the install phase.
> +(define %default-exclude '("^.github$" "^.*\\.md$" "LICENSE" "COPYING"
> + "^.*README.*$" "^\\.travis\\.yml$"
> + "^.*Makefile.*$"))
> +
> +(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
> +
> +(define (store-file->vim-source-file file)
> + "Convert FILE, a store file name for an Vim source file, into a file
> +name that has been stripped of the hash and version number."
> + (let ((suffix ".vim"))
> + (let-values (((name version)
> + (package-name->name+version
> + (basename
> + (strip-store-file-name file) suffix))))
> + (string-append name suffix))))
> +
> +(define* (unpack #:key source #:allow-other-keys)
> + "Unpack SOURCE into the build directory. SOURCE may be a compressed
> +archive, a directory or a '.vim' file."
> + (if (string-suffix? ".vim" source)
> + (begin
> + (mkdir "source")
> + (chdir "source")
> + (copy-file source (store-file->vim-source-file source))
> + #t)
> + (gnu:unpack #:source source)))
> +
> +;; FIXME: Files like README.md and other, more unpredictable file names,
> +;; are currently being installed. Because there is no concept of a
> +;; standardized build-system in Vim extensions, we have to find a long-term
> +;; solution to exclusion of files that are not used at runtime.
> +(define* (install #:key outputs
> + (exclude %default-exclude)
> + #:allow-other-keys)
> + "Install the package contents."
> + (let* ((out (assoc-ref outputs "out"))
> + (source (getcwd))
> + (vimfiles (string-append out "/share/vim/vimfiles")))
> + (for-each delete-file-recursively
> + (find-files source "^\\.git$"))
> + (for-each delete-file-recursively
> + (find-files source "^\\.gitignore$"))
> + (mkdir out)
> + (copy-recursively "." vimfiles)
> + #t))
> +
> +(define %standard-phases
> + (modify-phases gnu:%standard-phases
> + (replace 'unpack unpack)
> + (delete 'configure)
> + (delete 'check)
> + (delete 'build)
> + (replace 'install install)))
> +
> +(define* (vim-build #:key inputs (phases %standard-phases)
> + #:allow-other-keys #:rest args)
> + "Build the given vim package, applying all of PHASES in order."
> + (apply gnu:gnu-build #:inputs inputs #:phases phases args))
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#31989] vim-build-system
@ 2018-06-27 20:04 Efraim Flashner
2018-06-28 4:56 ` Nils Gillmann
2021-11-24 23:45 ` zimoun
0 siblings, 2 replies; 11+ messages in thread
From: Efraim Flashner @ 2018-06-27 20:04 UTC (permalink / raw)
To: 31989
[-- Attachment #1.1: Type: text/plain, Size: 256 bytes --]
This patch got forgotten about a year ago
--
Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #1.2: Type: message/rfc822, Size: 15243 bytes --]
[-- Attachment #1.2.1.1.1: Type: text/plain, Size: 298 bytes --]
ng0 transcribed 1.3K bytes:
> I found the mistake, a simple typo. Updated patch coming soon.
That would've been too easy, but there was a typo.
--
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
GnuPG: https://n0is.noblogs.org/my-keys
https://www.infotropique.org https://krosos.org
[-- Attachment #1.2.1.1.2: 0001-build-system-Add-vim-build-system.patch --]
[-- Type: text/plain, Size: 9627 bytes --]
From 1596e2ca4b9d237359287e35a65acdfd99a48879 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@infotropique.org>
Date: Sun, 2 Jul 2017 16:07:48 +0000
Subject: [PATCH 1/2] build-system: Add 'vim-build-system'.
* Makefile.am (MODULES): Add 'guix/build-system/vim.scm' and
'guix/build/vim-build-system.scm'.
* guix/build-system/vim.scm: New file.
* guix/build/vim-build-system.scm: New file.
---
Makefile.am | 2 +
guix/build-system/vim.scm | 127 ++++++++++++++++++++++++++++++++++++++++
guix/build/vim-build-system.scm | 70 ++++++++++++++++++++++
3 files changed, 199 insertions(+)
create mode 100644 guix/build-system/vim.scm
create mode 100644 guix/build/vim-build-system.scm
diff --git a/Makefile.am b/Makefile.am
index f6059d94b..cb36bd849 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -85,6 +85,7 @@ MODULES = \
guix/build-system/perl.scm \
guix/build-system/python.scm \
guix/build-system/ocaml.scm \
+ guix/build-system/vim.scm \
guix/build-system/waf.scm \
guix/build-system/r.scm \
guix/build-system/ruby.scm \
@@ -106,6 +107,7 @@ MODULES = \
guix/build/emacs-build-system.scm \
guix/build/font-build-system.scm \
guix/build/asdf-build-system.scm \
+ guix/build/vim-build-system.scm \
guix/build/git.scm \
guix/build/hg.scm \
guix/build/glib-or-gtk-build-system.scm \
diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
new file mode 100644
index 000000000..b3f9831c0
--- /dev/null
+++ b/guix/build-system/vim.scm
@@ -0,0 +1,127 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 ng0 <ng0@infotropique.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build-system vim)
+ #:use-module (guix utils)
+ #:use-module (guix packages)
+ #:use-module (guix derivations)
+ #:use-module (guix search-paths)
+ #:use-module (guix build-system gnu)
+ #:use-module (ice-9 match)
+ #:export (%vim-build-system-modules
+ vim-build
+ vim-build-system))
+
+;; Commentary:
+;;
+;; Standard build procedure for vim packages. This is
+;; implemented as an extension of 'gnu-build-system'.
+;;
+;; Code:
+
+(define %vim-build-system-modules
+ ;; Build-side modules imported by default.
+ `((guix build vim-build-system)
+ ,@%gnu-build-system-modules))
+
+(define* (lower name
+ #:key source inputs native-inputs outputs system target
+ #:allow-other-keys
+ #:rest arguments)
+ "Return a bag for NAME."
+ (define private-keywords
+ '(#:target #:inputs #:native-inputs))
+
+ (bag
+ (name name)
+ (system system)
+ (host-inputs `(,@(if source
+ `(("source" ,source))
+ '())
+ ,@inputs
+ ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
+ ,@(let ((compression (resolve-interface '(gnu packages compression))))
+ (map (match-lambda
+ ((name package)
+ (list name (module-ref compression package))))
+ `(("gzip" gzip)
+ ("bzip2" bzip2)
+ ("unzip" unzip)
+ ("xz" xz))))))
+ (build-inputs native-inputs)
+ (outputs outputs)
+ (build vim-build)
+ (arguments (strip-keyword-arguments private-keywords arguments))))
+
+(define* (vim-build store name inputs
+ #:key source
+ (tests? #t)
+ (test-target "test")
+ (configure-flags ''())
+ (phases '(@ (guix build vim-build-system)
+ %standard-phases))
+ (outputs '("out"))
+ (search-paths '())
+ (system (%current-system))
+ (guile #f)
+ (imported-modules %vim-build-system-modules)
+ (modules '((guix build vim-build-system)
+ (guix build utils))))
+ "Build SOURCE with INPUTS."
+ (define builder
+ `(begin
+ (use-modules ,@modules)
+ (vim-build #:name ,name
+ #:source ,(match (assoc-ref inputs "source")
+ (((? derivation? source))
+ (derivation->output-path source))
+ ((source)
+ source)
+ (source
+ source))
+ #:configure-flags ,configure-flags
+ #:system ,system
+ #:test-target ,test-target
+ #:tests? ,tests?
+ #:phases ,phases
+ #:outputs %outputs
+ #:search-paths ',(map search-path-specification->sexp
+ search-paths)
+ #:inputs %build-inputs)))
+
+ (define guile-for-build
+ (match guile
+ ((? package?)
+ (package-derivation store guile system #:graft? #f))
+ (#f ; the default
+ (let* ((distro (resolve-interface '(gnu packages commencement)))
+ (guile (module-ref distro 'guile-final)))
+ (package-derivation store guile system #:graft? #f)))))
+
+ (build-expression->derivation store name builder
+ #:inputs inputs
+ #:system system
+ #:modules imported-modules
+ #:outputs outputs
+ #:guile-for-build guile-for-build))
+
+(define vim-build-system
+ (build-system
+ (name 'vim)
+ (description "The build system for vim packages")
+ (lower lower)))
diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
new file mode 100644
index 000000000..ca863cef8
--- /dev/null
+++ b/guix/build/vim-build-system.scm
@@ -0,0 +1,70 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2017 ng0 <ng0@infotropique.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (guix build vim-build-system)
+ #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+ #:use-module (guix build utils)
+ #:use-module (srfi srfi-1)
+ #:use-module (srfi srfi-26)
+ #:export (%standard-phases
+ vim-build))
+
+;; Commentary:
+;;
+;; Builder-side code of the build procedure for vim packages.
+;;
+;; Code:
+
+(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
+
+(define* (unpack #:key source #:allow-other-keys)
+ "Unpack SOURCE into the build directory. SOURCE may be a compressed
+archive, a directory or a '.vim' file."
+ (if (any (cut string-suffix? <> source)
+ (list ".vim" ".vital"))
+ (begin
+ (mkdir "source")
+ (chdir "source")
+ (copy-file source (strip-store-file-name source))
+ #t)
+ (gnu:unpack #:source source)))
+
+(define* (install #:key outputs #:allow-other-keys)
+ "Install the package contents."
+ (let* ((out (assoc-ref outputs "out"))
+ (source (getcwd))
+ (vimfiles (string-append out "/share/vim/vimfiles")))
+ (lambda (dir)
+ (when (file-exists? dir)
+ (copy-recursively dir (string-append vimfiles "/" dir))))
+ (list "autoload" "after" "doc" "ftdetect" "ftplugin"
+ "indent" "plugin" "rplugin" "syntax")
+ #t))
+
+(define %standard-phases
+ (modify-phases gnu:%standard-phases
+ (replace 'unpack unpack)
+ (delete 'configure)
+ (delete 'check)
+ (delete 'build)
+ (replace 'install install)))
+
+(define* (vim-build #:key inputs (phases %standard-phases)
+ #:allow-other-keys #:rest args)
+ "Build the given vim package, applying all of PHASES in order."
+ (apply gnu:gnu-build #:inputs inputs #:phases phases args))
--
2.13.2
[-- Attachment #1.2.1.1.3: 0002-gnu-vim-neocomplete-Use-vim-build-system.patch --]
[-- Type: text/plain, Size: 2443 bytes --]
From bb8cf78af6569d2fc9beb1d766d6d748c488e012 Mon Sep 17 00:00:00 2001
From: ng0 <ng0@infotropique.org>
Date: Sun, 2 Jul 2017 16:11:19 +0000
Subject: [PATCH 2/2] gnu: vim-neocomplete: Use 'vim-build-system'.
* gnu/packages/vim.scm (vim-neocomplete): Switch to 'vim-build-system'.
---
gnu/packages/vim.scm | 22 +++-------------------
1 file changed, 3 insertions(+), 19 deletions(-)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 27c0b0da9..5672fab69 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -1,7 +1,7 @@
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
-;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
+;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
;;;
@@ -28,6 +28,7 @@
#:use-module (guix git-download)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system vim)
#:use-module (gnu packages)
#:use-module (gnu packages acl)
#:use-module (gnu packages admin) ; For GNU hostname
@@ -195,24 +196,7 @@ configuration files.")
(sha256
(base32
"1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
- (build-system gnu-build-system)
- (arguments
- `(#:tests? #f
- #:phases
- (modify-phases %standard-phases
- (delete 'configure)
- (delete 'build)
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (let* ((out (assoc-ref outputs "out"))
- (vimfiles (string-append out "/share/vim/vimfiles"))
- (autoload (string-append vimfiles "/autoload"))
- (doc (string-append vimfiles "/doc"))
- (plugin (string-append vimfiles "/plugin")))
- (copy-recursively "autoload" autoload)
- (copy-recursively "doc" doc)
- (copy-recursively "plugin" plugin)
- #t))))))
+ (build-system vim-build-system)
(synopsis "Next generation completion framework for Vim")
(description
"@code{neocomplete}, an abbreviation of 'neo-completion with cache',
--
2.13.2
[-- Attachment #1.2.1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [bug#31989] vim-build-system
2018-06-27 20:04 [bug#31989] vim-build-system Efraim Flashner
@ 2018-06-28 4:56 ` Nils Gillmann
2021-11-24 23:45 ` zimoun
1 sibling, 0 replies; 11+ messages in thread
From: Nils Gillmann @ 2018-06-28 4:56 UTC (permalink / raw)
To: Efraim Flashner; +Cc: 31989
Efraim Flashner transcribed 16K bytes:
> This patch got forgotten about a year ago
>
> --
> Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted
> Date: Sun, 2 Jul 2017 19:56:07 +0000
> From: ng0 <ng0@infotropique.org>
> To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
> Subject: Re: PATCH in need for discussion: vim-build-system
>
> ng0 transcribed 1.3K bytes:
> > I found the mistake, a simple typo. Updated patch coming soon.
>
> That would've been too easy, but there was a typo.
hm... right, July 2017. Time flies.
I think I'll look at the differences and fix it.
So here's something with regards to the 'test' phase:
it seems like the few packages using tests, use a Makefile.
When it is a rare exception, does it still count as part
of the system? We would run gnu's make there.
> --
> ng0
> GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
> GnuPG: https://n0is.noblogs.org/my-keys
> https://www.infotropique.org https://krosos.org
> From 1596e2ca4b9d237359287e35a65acdfd99a48879 Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@infotropique.org>
> Date: Sun, 2 Jul 2017 16:07:48 +0000
> Subject: [PATCH 1/2] build-system: Add 'vim-build-system'.
>
> * Makefile.am (MODULES): Add 'guix/build-system/vim.scm' and
> 'guix/build/vim-build-system.scm'.
> * guix/build-system/vim.scm: New file.
> * guix/build/vim-build-system.scm: New file.
> ---
> Makefile.am | 2 +
> guix/build-system/vim.scm | 127 ++++++++++++++++++++++++++++++++++++++++
> guix/build/vim-build-system.scm | 70 ++++++++++++++++++++++
> 3 files changed, 199 insertions(+)
> create mode 100644 guix/build-system/vim.scm
> create mode 100644 guix/build/vim-build-system.scm
>
> diff --git a/Makefile.am b/Makefile.am
> index f6059d94b..cb36bd849 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -85,6 +85,7 @@ MODULES = \
> guix/build-system/perl.scm \
> guix/build-system/python.scm \
> guix/build-system/ocaml.scm \
> + guix/build-system/vim.scm \
> guix/build-system/waf.scm \
> guix/build-system/r.scm \
> guix/build-system/ruby.scm \
> @@ -106,6 +107,7 @@ MODULES = \
> guix/build/emacs-build-system.scm \
> guix/build/font-build-system.scm \
> guix/build/asdf-build-system.scm \
> + guix/build/vim-build-system.scm \
> guix/build/git.scm \
> guix/build/hg.scm \
> guix/build/glib-or-gtk-build-system.scm \
> diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm
> new file mode 100644
> index 000000000..b3f9831c0
> --- /dev/null
> +++ b/guix/build-system/vim.scm
> @@ -0,0 +1,127 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2017 ng0 <ng0@infotropique.org>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build-system vim)
> + #:use-module (guix utils)
> + #:use-module (guix packages)
> + #:use-module (guix derivations)
> + #:use-module (guix search-paths)
> + #:use-module (guix build-system gnu)
> + #:use-module (ice-9 match)
> + #:export (%vim-build-system-modules
> + vim-build
> + vim-build-system))
> +
> +;; Commentary:
> +;;
> +;; Standard build procedure for vim packages. This is
> +;; implemented as an extension of 'gnu-build-system'.
> +;;
> +;; Code:
> +
> +(define %vim-build-system-modules
> + ;; Build-side modules imported by default.
> + `((guix build vim-build-system)
> + ,@%gnu-build-system-modules))
> +
> +(define* (lower name
> + #:key source inputs native-inputs outputs system target
> + #:allow-other-keys
> + #:rest arguments)
> + "Return a bag for NAME."
> + (define private-keywords
> + '(#:target #:inputs #:native-inputs))
> +
> + (bag
> + (name name)
> + (system system)
> + (host-inputs `(,@(if source
> + `(("source" ,source))
> + '())
> + ,@inputs
> + ,(list "tar" (module-ref (resolve-interface '(gnu packages base)) 'tar))
> + ,@(let ((compression (resolve-interface '(gnu packages compression))))
> + (map (match-lambda
> + ((name package)
> + (list name (module-ref compression package))))
> + `(("gzip" gzip)
> + ("bzip2" bzip2)
> + ("unzip" unzip)
> + ("xz" xz))))))
> + (build-inputs native-inputs)
> + (outputs outputs)
> + (build vim-build)
> + (arguments (strip-keyword-arguments private-keywords arguments))))
> +
> +(define* (vim-build store name inputs
> + #:key source
> + (tests? #t)
> + (test-target "test")
> + (configure-flags ''())
> + (phases '(@ (guix build vim-build-system)
> + %standard-phases))
> + (outputs '("out"))
> + (search-paths '())
> + (system (%current-system))
> + (guile #f)
> + (imported-modules %vim-build-system-modules)
> + (modules '((guix build vim-build-system)
> + (guix build utils))))
> + "Build SOURCE with INPUTS."
> + (define builder
> + `(begin
> + (use-modules ,@modules)
> + (vim-build #:name ,name
> + #:source ,(match (assoc-ref inputs "source")
> + (((? derivation? source))
> + (derivation->output-path source))
> + ((source)
> + source)
> + (source
> + source))
> + #:configure-flags ,configure-flags
> + #:system ,system
> + #:test-target ,test-target
> + #:tests? ,tests?
> + #:phases ,phases
> + #:outputs %outputs
> + #:search-paths ',(map search-path-specification->sexp
> + search-paths)
> + #:inputs %build-inputs)))
> +
> + (define guile-for-build
> + (match guile
> + ((? package?)
> + (package-derivation store guile system #:graft? #f))
> + (#f ; the default
> + (let* ((distro (resolve-interface '(gnu packages commencement)))
> + (guile (module-ref distro 'guile-final)))
> + (package-derivation store guile system #:graft? #f)))))
> +
> + (build-expression->derivation store name builder
> + #:inputs inputs
> + #:system system
> + #:modules imported-modules
> + #:outputs outputs
> + #:guile-for-build guile-for-build))
> +
> +(define vim-build-system
> + (build-system
> + (name 'vim)
> + (description "The build system for vim packages")
> + (lower lower)))
> diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.scm
> new file mode 100644
> index 000000000..ca863cef8
> --- /dev/null
> +++ b/guix/build/vim-build-system.scm
> @@ -0,0 +1,70 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;; Copyright © 2017 ng0 <ng0@infotropique.org>
> +;;;
> +;;; This file is part of GNU Guix.
> +;;;
> +;;; GNU Guix is free software; you can redistribute it and/or modify it
> +;;; under the terms of the GNU General Public License as published by
> +;;; the Free Software Foundation; either version 3 of the License, or (at
> +;;; your option) any later version.
> +;;;
> +;;; GNU Guix is distributed in the hope that it will be useful, but
> +;;; WITHOUT ANY WARRANTY; without even the implied warranty of
> +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> +;;; GNU General Public License for more details.
> +;;;
> +;;; You should have received a copy of the GNU General Public License
> +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
> +
> +(define-module (guix build vim-build-system)
> + #:use-module ((guix build gnu-build-system) #:prefix gnu:)
> + #:use-module (guix build utils)
> + #:use-module (srfi srfi-1)
> + #:use-module (srfi srfi-26)
> + #:export (%standard-phases
> + vim-build))
> +
> +;; Commentary:
> +;;
> +;; Builder-side code of the build procedure for vim packages.
> +;;
> +;; Code:
> +
> +(define gnu:unpack (assoc-ref gnu:%standard-phases 'unpack))
> +
> +(define* (unpack #:key source #:allow-other-keys)
> + "Unpack SOURCE into the build directory. SOURCE may be a compressed
> +archive, a directory or a '.vim' file."
> + (if (any (cut string-suffix? <> source)
> + (list ".vim" ".vital"))
> + (begin
> + (mkdir "source")
> + (chdir "source")
> + (copy-file source (strip-store-file-name source))
> + #t)
> + (gnu:unpack #:source source)))
> +
> +(define* (install #:key outputs #:allow-other-keys)
> + "Install the package contents."
> + (let* ((out (assoc-ref outputs "out"))
> + (source (getcwd))
> + (vimfiles (string-append out "/share/vim/vimfiles")))
> + (lambda (dir)
> + (when (file-exists? dir)
> + (copy-recursively dir (string-append vimfiles "/" dir))))
> + (list "autoload" "after" "doc" "ftdetect" "ftplugin"
> + "indent" "plugin" "rplugin" "syntax")
> + #t))
> +
> +(define %standard-phases
> + (modify-phases gnu:%standard-phases
> + (replace 'unpack unpack)
> + (delete 'configure)
> + (delete 'check)
> + (delete 'build)
> + (replace 'install install)))
> +
> +(define* (vim-build #:key inputs (phases %standard-phases)
> + #:allow-other-keys #:rest args)
> + "Build the given vim package, applying all of PHASES in order."
> + (apply gnu:gnu-build #:inputs inputs #:phases phases args))
> --
> 2.13.2
>
> From bb8cf78af6569d2fc9beb1d766d6d748c488e012 Mon Sep 17 00:00:00 2001
> From: ng0 <ng0@infotropique.org>
> Date: Sun, 2 Jul 2017 16:11:19 +0000
> Subject: [PATCH 2/2] gnu: vim-neocomplete: Use 'vim-build-system'.
>
> * gnu/packages/vim.scm (vim-neocomplete): Switch to 'vim-build-system'.
> ---
> gnu/packages/vim.scm | 22 +++-------------------
> 1 file changed, 3 insertions(+), 19 deletions(-)
>
> diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
> index 27c0b0da9..5672fab69 100644
> --- a/gnu/packages/vim.scm
> +++ b/gnu/packages/vim.scm
> @@ -1,7 +1,7 @@
> ;;; GNU Guix --- Functional package management for GNU
> ;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
> ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
> -;;; Copyright © 2016, 2017 ng0 <ng0@no-reply.pragmatique.xyz>
> +;;; Copyright © 2016, 2017 ng0 <ng0@infotropique.org>
> ;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
> ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
> ;;;
> @@ -28,6 +28,7 @@
> #:use-module (guix git-download)
> #:use-module (guix build-system cmake)
> #:use-module (guix build-system gnu)
> + #:use-module (guix build-system vim)
> #:use-module (gnu packages)
> #:use-module (gnu packages acl)
> #:use-module (gnu packages admin) ; For GNU hostname
> @@ -195,24 +196,7 @@ configuration files.")
> (sha256
> (base32
> "1307gbrdwam2akq9w2lpijc41740i4layk2qkd9sjkqxfch5lni2"))))
> - (build-system gnu-build-system)
> - (arguments
> - `(#:tests? #f
> - #:phases
> - (modify-phases %standard-phases
> - (delete 'configure)
> - (delete 'build)
> - (replace 'install
> - (lambda* (#:key outputs #:allow-other-keys)
> - (let* ((out (assoc-ref outputs "out"))
> - (vimfiles (string-append out "/share/vim/vimfiles"))
> - (autoload (string-append vimfiles "/autoload"))
> - (doc (string-append vimfiles "/doc"))
> - (plugin (string-append vimfiles "/plugin")))
> - (copy-recursively "autoload" autoload)
> - (copy-recursively "doc" doc)
> - (copy-recursively "plugin" plugin)
> - #t))))))
> + (build-system vim-build-system)
> (synopsis "Next generation completion framework for Vim")
> (description
> "@code{neocomplete}, an abbreviation of 'neo-completion with cache',
> --
> 2.13.2
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#31989] vim-build-system
2018-06-27 20:04 [bug#31989] vim-build-system Efraim Flashner
2018-06-28 4:56 ` Nils Gillmann
@ 2021-11-24 23:45 ` zimoun
2021-11-26 11:13 ` [bug#30385] " Efraim Flashner
1 sibling, 1 reply; 11+ messages in thread
From: zimoun @ 2021-11-24 23:45 UTC (permalink / raw)
To: Efraim Flashner; +Cc: 31989-done, 30385-done
Hi,
On Wed, 27 Jun 2018 at 23:04, Efraim Flashner <efraim@flashner.co.il> wrote:
> This patch got forgotten about a year ago
>
> --
> Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
> GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> Confidentiality cannot be guaranteed on emails sent or received unencrypted
>
> From: ng0 <ng0@infotropique.org>
> Subject: Re: PATCH in need for discussion: vim-build-system
> To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
> Date: Sun, 2 Jul 2017 19:56:07 +0000 (4 years, 20 weeks, 5 days ago)
> Mail-Followup-To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
>
> ng0 transcribed 1.3K bytes:
>> I found the mistake, a simple typo. Updated patch coming soon.
>
> That would've been too easy, but there was a typo.
This is marked as moreinfo since 2018. After reading the thread, I am
closing because Vim users do not seem to manifest an interest for having
vim-build-system.
If I misread something, feel free to reopen. It appears to me better to
still keep close this one, and send a fresh set of patches to review.
Cheers,
simon
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#30385] [bug#31989] vim-build-system
2021-11-24 23:45 ` zimoun
@ 2021-11-26 11:13 ` Efraim Flashner
2021-11-28 9:23 ` Foo Chuan Wei
0 siblings, 1 reply; 11+ messages in thread
From: Efraim Flashner @ 2021-11-26 11:13 UTC (permalink / raw)
To: zimoun; +Cc: 31989-done, 30385-done
[-- Attachment #1: Type: text/plain, Size: 1579 bytes --]
On Thu, Nov 25, 2021 at 12:45:20AM +0100, zimoun wrote:
> Hi,
>
> On Wed, 27 Jun 2018 at 23:04, Efraim Flashner <efraim@flashner.co.il> wrote:
> > This patch got forgotten about a year ago
> >
> > --
> > Efraim Flashner <efraim@flashner.co.il> אפרים פלשנר
> > GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
> > Confidentiality cannot be guaranteed on emails sent or received unencrypted
> >
> > From: ng0 <ng0@infotropique.org>
> > Subject: Re: PATCH in need for discussion: vim-build-system
> > To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
> > Date: Sun, 2 Jul 2017 19:56:07 +0000 (4 years, 20 weeks, 5 days ago)
> > Mail-Followup-To: Efraim Flashner <efraim@flashner.co.il>, guix-devel@gnu.org
> >
> > ng0 transcribed 1.3K bytes:
> >> I found the mistake, a simple typo. Updated patch coming soon.
> >
> > That would've been too easy, but there was a typo.
>
> This is marked as moreinfo since 2018. After reading the thread, I am
> closing because Vim users do not seem to manifest an interest for having
> vim-build-system.
>
> If I misread something, feel free to reopen. It appears to me better to
> still keep close this one, and send a fresh set of patches to review.
>
> Cheers,
> simon
We do pretty well with the copy-build-system, with the occasional extra
phase(s).
--
Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#30385] [bug#31989] vim-build-system
2021-11-26 11:13 ` [bug#30385] " Efraim Flashner
@ 2021-11-28 9:23 ` Foo Chuan Wei
2021-11-28 9:28 ` Efraim Flashner
0 siblings, 1 reply; 11+ messages in thread
From: Foo Chuan Wei @ 2021-11-28 9:23 UTC (permalink / raw)
To: efraim; +Cc: 30385
On 2021-11-26 13:13:38 +0200, Efraim Flashner wrote:
> We do pretty well with the copy-build-system, with the occasional extra
> phase(s).
But the help tags files (`:help helptags`) are not generated when using
the copy-build-system. Help tag files should be generated during the
build phase for Vim plugins, because the user cannot generate help tags
after plugin installation. The user does not have permission to modify
anything in ~/.guix-profile/share/vim/vimfiles/, so `:helptags
~/.guix-profile/share/vim/vimfiles/` will fail.
^ permalink raw reply [flat|nested] 11+ messages in thread
* [bug#30385] [bug#31989] vim-build-system
2021-11-28 9:23 ` Foo Chuan Wei
@ 2021-11-28 9:28 ` Efraim Flashner
0 siblings, 0 replies; 11+ messages in thread
From: Efraim Flashner @ 2021-11-28 9:28 UTC (permalink / raw)
To: Foo Chuan Wei; +Cc: 30385
[-- Attachment #1: Type: text/plain, Size: 1125 bytes --]
On Sun, Nov 28, 2021 at 09:23:30AM +0000, Foo Chuan Wei wrote:
> On 2021-11-26 13:13:38 +0200, Efraim Flashner wrote:
> > We do pretty well with the copy-build-system, with the occasional extra
> > phase(s).
>
> But the help tags files (`:help helptags`) are not generated when using
> the copy-build-system. Help tag files should be generated during the
> build phase for Vim plugins, because the user cannot generate help tags
> after plugin installation. The user does not have permission to modify
> anything in ~/.guix-profile/share/vim/vimfiles/, so `:helptags
> ~/.guix-profile/share/vim/vimfiles/` will fail.
I'm a bit rusty on the help tags. I thought they would all clober each
other if they were built during the package building, since they all
have the same name and we can only install one, but if we built them as
a profile hook then they'd all be able to co-exist.
Thoughts?
--
Efraim Flashner <efraim@flashner.co.il> רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2021-11-28 9:30 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-07 22:30 [bug#30385] Add vim-build-system ng0
2018-02-28 8:54 ` ng0
2018-02-28 22:08 ` Ludovic Courtès
2018-06-21 13:20 ` Ricardo Wurmus
2018-06-26 14:47 ` Nils Gillmann
-- strict thread matches above, loose matches on Subject: below --
2018-06-27 20:04 [bug#31989] vim-build-system Efraim Flashner
2018-06-28 4:56 ` Nils Gillmann
2021-11-24 23:45 ` zimoun
2021-11-26 11:13 ` [bug#30385] " Efraim Flashner
2021-11-28 9:23 ` Foo Chuan Wei
2021-11-28 9:28 ` Efraim Flashner
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.