From mboxrd@z Thu Jan 1 00:00:00 1970 From: Efraim Flashner Subject: Re: PATCH in need for discussion: vim-build-system Date: Sun, 2 Jul 2017 22:03:37 +0300 Message-ID: <20170702190337.GC2938@macbook42.flashner.co.il> References: <20170702161926.yuvhmb52rqyymnmj@abyayala> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RhUH2Ysw6aD5utA4" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:45276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRk9o-0001Aw-R2 for guix-devel@gnu.org; Sun, 02 Jul 2017 15:03:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dRk9l-00077J-HT for guix-devel@gnu.org; Sun, 02 Jul 2017 15:03:44 -0400 Received: from flashner.co.il ([178.62.234.194]:48768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dRk9k-00076p-UR for guix-devel@gnu.org; Sun, 02 Jul 2017 15:03:41 -0400 Received: from localhost (85.64.232.168.dynamic.barak-online.net [85.64.232.168]) by flashner.co.il (Postfix) with ESMTPSA id 9134740231 for ; Sun, 2 Jul 2017 19:03:39 +0000 (UTC) Content-Disposition: inline In-Reply-To: <20170702161926.yuvhmb52rqyymnmj@abyayala> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org --RhUH2Ysw6aD5utA4 Content-Type: multipart/mixed; boundary="xesSdrSSBC0PokLI" Content-Disposition: inline --xesSdrSSBC0PokLI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Jul 02, 2017 at 04:19:26PM +0000, ng0 wrote: > The appended two patches fail, for a reason which is not apparent > to me (and no reason I could capture). >=20 > This is mostly based on the font-build-system with some additions, > it's more or less the same except for the unpack and install phases. > --=20 > ng0 > GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588 > GnuPG: https://n0is.noblogs.org/my-keys > https://www.infotropique.org https://krosos.org > From 9490336916ce4517c64875cc470ccadfad4a27ba Mon Sep 17 00:00:00 2001 > From: ng0 > Date: Sun, 2 Jul 2017 16:07:48 +0000 > Subject: [PATCH 1/2] build-system: Add 'vim-build-system'. >=20 > * 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 | 92 +++++++++++++++++++++++++++++ > 3 files changed, 221 insertions(+) > create mode 100644 guix/build-system/vim.scm > create mode 100644 guix/build/vim-build-system.scm >=20 > diff --git a/Makefile.am b/Makefile.am > index f6059d94b..cb36bd849 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -85,6 +85,7 @@ MODULES =3D \ > 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 =3D \ > 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..6c074fd60 > --- /dev/null > +++ b/guix/build-system/vim.scm > @@ -0,0 +1,127 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2017 ng0 > +;;; > +;;; 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 . > + > +(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 moduels 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 pac= kages base)) 'tar)) > + ,@(let ((compression (resolve-interface '(gnu package= s compression)))) > + (map (match-lambda > + ((name package) > + (list name (module-ref compression packag= e)))) > + `(("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-syste= m.scm > new file mode 100644 > index 000000000..5c55f1256 > --- /dev/null > +++ b/guix/build/vim-build-system.scm > @@ -0,0 +1,92 @@ > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2017 ng0 > +;;; > +;;; 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 . > + > +(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"))) > + (when (file-exists? "autoload") > + (copy-recursively "autoload" > + (string-append vimfiles "/autoload"))) > + (when (file-exists? "afer") > + (copy-recursively "after" > + (string-append vimfiles "/after"))) > + (when (file-exists? "doc") > + (copy-recursively "doc" > + (string-append vimfiles "/doc"))) > + (when (file-exists? "ftdetect") > + (copy-recursively "ftdetect" > + (string-append vimfiles "/ftdetect"))) > + (when (file-exists? "ftplugin") > + (copy-recursively "ftplugin" > + (string-append vimfiles "/ftplugin"))) > + (when (file-exists? "indent") > + (copy-recursively "indent" > + (string-append vimfiles "/indent"))) > + (when (file-exists? "plugin") > + (copy-recursively "plugin" > + (string-append vimfiles "/plugin"))) > + (when (file-exists? "rplugin") > + (copy-recursively "rplugin" > + (string-append vimfiles "/rplugin"))) > + (when (file-exists? "syntax") > + (copy-recursively "syntax" > + (string-append vimfiles "/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)) > --=20 > 2.13.2 >=20 > From f8c9e1fedfdf927611abc3e480176ffe67152c27 Mon Sep 17 00:00:00 2001 > From: ng0 > Date: Sun, 2 Jul 2017 16:11:19 +0000 > Subject: [PATCH 2/2] gnu: vim-neocomplete: Use 'vim-build-system'. >=20 > * gnu/packages/vim.scm (vim-neocomplete): Switch to 'vim-build-system'. > --- > gnu/packages/vim.scm | 22 +++------------------- > 1 file changed, 3 insertions(+), 19 deletions(-) >=20 > 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 =C2=A9 2013 Cyril Roelandt > ;;; Copyright =C2=A9 2016 Efraim Flashner > -;;; Copyright =C2=A9 2016, 2017 ng0 > +;;; Copyright =C2=A9 2016, 2017 ng0 > ;;; Copyright =C2=A9 2017 Ricardo Wurmus > ;;; Copyright =C2=A9 2017 Marius Bakke > ;;; > @@ -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', > --=20 > 2.13.2 >=20 I couldn't get it to build, but here's the changes I made --=20 Efraim Flashner =D7=90=D7=A4=D7=A8=D7=99=D7=9D = =D7=A4=D7=9C=D7=A9=D7=A0=D7=A8 GPG key =3D A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351 Confidentiality cannot be guaranteed on emails sent or received unencrypted --xesSdrSSBC0PokLI Content-Type: text/plain; charset=utf-8 Content-Disposition: attachment; filename="vim-build-system.diff" Content-Transfer-Encoding: quoted-printable diff --git a/guix/build-system/vim.scm b/guix/build-system/vim.scm index 6c074fd60..adc0a9fdd 100644 --- a/guix/build-system/vim.scm +++ b/guix/build-system/vim.scm @@ -35,7 +35,7 @@ ;; Code: =20 (define %vim-build-system-modules - ;; Build-side moduels imported by default. + ;; Build-side modules imported by default. `((guix build vim-build-system) ,@%gnu-build-system-modules)) =20 diff --git a/guix/build/vim-build-system.scm b/guix/build/vim-build-system.= scm index 5c55f1256..d97d44cf9 100644 --- a/guix/build/vim-build-system.scm +++ b/guix/build/vim-build-system.scm @@ -49,33 +49,37 @@ archive, a directory or a '.vim' file." (let* ((out (assoc-ref outputs "out")) (source (getcwd)) (vimfiles (string-append out "/share/vim/vimfiles"))) - (when (file-exists? "autoload") - (copy-recursively "autoload" - (string-append vimfiles "/autoload"))) - (when (file-exists? "afer") - (copy-recursively "after" - (string-append vimfiles "/after"))) - (when (file-exists? "doc") - (copy-recursively "doc" - (string-append vimfiles "/doc"))) - (when (file-exists? "ftdetect") - (copy-recursively "ftdetect" - (string-append vimfiles "/ftdetect"))) - (when (file-exists? "ftplugin") - (copy-recursively "ftplugin" - (string-append vimfiles "/ftplugin"))) - (when (file-exists? "indent") - (copy-recursively "indent" - (string-append vimfiles "/indent"))) - (when (file-exists? "plugin") - (copy-recursively "plugin" - (string-append vimfiles "/plugin"))) - (when (file-exists? "rplugin") - (copy-recursively "rplugin" - (string-append vimfiles "/rplugin"))) - (when (file-exists? "syntax") - (copy-recursively "syntax" - (string-append vimfiles "/syntax"))) + (lambda (dir) + (when (file-exists? dir) + (copy-recursively dir (string-append vimfiles "/" dir)))) + (list "autoload" "after" "doc" "ftdetect" "ftplugin" "indent" "plugin"= "rplugin" "syntax") + ;(when (file-exists? "autoload") + ; (copy-recursively "autoload" + ; (string-append vimfiles "/autoload"))) + ;(when (file-exists? "after") + ; (copy-recursively "after" + ; (string-append vimfiles "/after"))) + ;(when (file-exists? "doc") + ; (copy-recursively "doc" + ; (string-append vimfiles "/doc"))) + ;(when (file-exists? "ftdetect") + ; (copy-recursively "ftdetect" + ; (string-append vimfiles "/ftdetect"))) + ;(when (file-exists? "ftplugin") + ; (copy-recursively "ftplugin" + ; (string-append vimfiles "/ftplugin"))) + ;(when (file-exists? "indent") + ; (copy-recursively "indent" + ; (string-append vimfiles "/indent"))) + ;(when (file-exists? "plugin") + ; (copy-recursively "plugin" + ; (string-append vimfiles "/plugin"))) + ;(when (file-exists? "rplugin") + ; (copy-recursively "rplugin" + ; (string-append vimfiles "/rplugin"))) + ;(when (file-exists? "syntax") + ; (copy-recursively "syntax" + ; (string-append vimfiles "/syntax"))) #t)) =20 (define %standard-phases --xesSdrSSBC0PokLI-- --RhUH2Ysw6aD5utA4 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAllZQ4IACgkQQarn3Mo9 g1EepQ/8Cl1pb/pfcYu953y/4BWNb2Ki7zL+lZ6F2XXoDWscGM7cj1Xrg3pmXPfR WwIsG7O7XqFHIgLWfsJyhacenMCuT3jZ5gD/hZBcuwKq+2EcTUli+oYJuHiJPi3F zEzn3eweLruPgU1rdSmePJBq2zrB0s2oSjoaaeut8FlwM5xZ83rlaCjELcIRSyiL Yd39zu6/VfW/thNaG5OcYP1vvdtLpABaO5n2gzkauMSzEoZYxdUCdv8vZtru7XUs cUtcHiG6BXeZ7to5uuWoIz8VxpNCFroacCn4QVYKNnBxrMTehWVyZ/Y6BqlRNrQL Y8dF2xVypnH/Adx6TTULSlpT1jSiamgwUC5GXFkz6uJqsg7AXH3I9yz/avTyOgrs 4vF1TnIrcDUUzkdJ+xrdtii9icAblFEOmGw54J+yNUBO6wdW55FshaW5CA4sm28n 5896YzAyH8ycCVaVDig3/kV7IJJN0O9L3QbkJDF56E1S6BlkswRMtGFFBG3+a328 aAW1AYEC4ZAl6WYLcPbVGy6Qhl53ZaY0MFo2nK/wlFaqcZdF8ukE8IoypIwZEeU4 1N4od3OG0vov1wlsySqrAH9rS8iDPPMZnUY8LUmfV7MlICfTf0LaS9orgA7UIX2u D77cVQmqUzh/PgAcfrWWUGISr+dXYb+Y0CpIZXNmXf389h6Lass= =d3PV -----END PGP SIGNATURE----- --RhUH2Ysw6aD5utA4--