GNU bug report logs - #39599
[PATCH 0/2] New build system: copy-build-system

Previous Next

Package: guix-patches;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Fri, 14 Feb 2020 12:52:02 UTC

Severity: normal

Tags: patch

Done: Pierre Neidhardt <mail <at> ambrevar.xyz>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 39599 in the body.
You can then email your comments to 39599 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 14 Feb 2020 12:52:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 14 Feb 2020 12:52:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: guix-patches <at> gnu.org
Subject: [PATCH 0/2] New build system: copy-build-system
Date: Fri, 14 Feb 2020 13:51:44 +0100
This build system aims to be a more convenient alternative to the
trivial-build-system for packages that only need mere copying around.

Since it is based on the gnu-build-system, all packages necessary for archive
extraction are already included.

The new install-plan argument makes it particularly convenient to install
batches of files.

See discussion here: https://lists.gnu.org/archive/html/guix-devel/2020-01/msg00485.html.

Pierre Neidhardt (2):
  build-system: Add copy-build-system.
  gnu: gcide: Use the copy-build-system.

 Makefile.am                      |   2 +
 doc/guix.texi                    |  57 +++++++++++
 gnu/packages/dictionaries.scm    |  22 +----
 guix/build-system/copy.scm       | 145 ++++++++++++++++++++++++++++
 guix/build/copy-build-system.scm | 156 +++++++++++++++++++++++++++++++
 5 files changed, 364 insertions(+), 18 deletions(-)
 create mode 100644 guix/build-system/copy.scm
 create mode 100644 guix/build/copy-build-system.scm

-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 14 Feb 2020 12:55:01 GMT) Full text and rfc822 format available.

Message #8 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 2/2] gnu: gcide: Use the copy-build-system.
Date: Fri, 14 Feb 2020 13:53:57 +0100
* gnu/packages/dictionaries.scm (gcide2)[build-system]: Use the
  copy-build-system.
---
 gnu/packages/dictionaries.scm | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index cd0a5db93c..d40c43f74e 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -31,6 +31,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system copy)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
@@ -109,25 +110,10 @@ acronyms distributed as an info document.")
               (sha256
                (base32
                 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
-    (build-system trivial-build-system)
+    (build-system copy-build-system)
     (arguments
-     '(#:builder (begin
-                   (use-modules (guix build utils))
-                   (let* ((src     (assoc-ref %build-inputs "source"))
-                          (tar     (assoc-ref %build-inputs "tar"))
-                          (xz      (assoc-ref %build-inputs "xz"))
-                          (out     (assoc-ref %outputs "out"))
-                          (datadir (string-append out "/share/gcide")))
-                     (set-path-environment-variable "PATH" '("bin")
-                                                    (list tar xz))
-                     (mkdir-p datadir)
-                     (invoke "tar" "-C" datadir
-                             "--strip-components=1"
-                             "-xvf" src)))
-       #:modules ((guix build utils))))
-    (native-inputs
-     `(("tar" ,tar)
-       ("xz" ,xz)))
+     '(#:install-plan
+       '(("." "share/gcide/" #:exclude ("COPYING")))))
     (synopsis "GNU Collaborative International Dictionary of English")
     (description
      "GCIDE is a free dictionary based on a combination of sources.  It can
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 14 Feb 2020 12:55:02 GMT) Full text and rfc822 format available.

Message #11 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 1/2] build-system: Add copy-build-system.
Date: Fri, 14 Feb 2020 13:53:56 +0100
* guix/build-system/copy.scm: New file.
* guix/build/copy-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'copy-build-system'.
---
 Makefile.am                      |   2 +
 doc/guix.texi                    |  57 +++++++++++
 guix/build-system/copy.scm       | 145 ++++++++++++++++++++++++++++
 guix/build/copy-build-system.scm | 156 +++++++++++++++++++++++++++++++
 4 files changed, 360 insertions(+)
 create mode 100644 guix/build-system/copy.scm
 create mode 100644 guix/build/copy-build-system.scm

diff --git a/Makefile.am b/Makefile.am
index c6a2e6cf6c..e18c17d8b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,6 +122,7 @@ MODULES =					\
   guix/build-system/meson.scm			\
   guix/build-system/minify.scm			\
   guix/build-system/asdf.scm			\
+  guix/build-system/copy.scm			\
   guix/build-system/glib-or-gtk.scm		\
   guix/build-system/gnu.scm			\
   guix/build-system/guile.scm			\
@@ -169,6 +170,7 @@ MODULES =					\
   guix/build/go-build-system.scm		\
   guix/build/asdf-build-system.scm		\
   guix/build/bzr.scm				\
+  guix/build/copy-build-system.scm		\
   guix/build/git.scm				\
   guix/build/hg.scm				\
   guix/build/glib-or-gtk-build-system.scm	\
diff --git a/doc/guix.texi b/doc/guix.texi
index 42d7cfa2e8..d1ec214674 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6159,6 +6159,63 @@ parameters available to cargo.  It will also remove an included
 if they are defined by the crate.
 @end defvr
 
+
+@defvr {Scheme Variable} copy-build-system
+@cindex (copy build system)
+This variable is exported by @code{(guix build-system copy)}.  It
+supports builds of simple packages that don't require much compiling,
+mostly just moving files around.
+
+It adds much of the @code{gnu-build-system} packages to the set of
+inputs.  Because of this, the @code{copy-build-system} does not require
+all the boilerplate code often implied by the
+@code{trivial-build-system}.
+
+To further simplify the file installation process, an
+@code{#:install-plan} argument is exposed to let the packaer specify
+which files go where.
+The install plan is a list of @code{(SOURCE TARGET [FILTERS])}.
+@code{FILTERS} are optional.
+
+@itemize
+@item When @code{SOURCE} matches a file or directory without trailing slash, install it to @code{TARGET}.
+  @itemize
+  @item If @code{TARGET} has a trailing slash, install @code{SOURCE} basename beneath @code{TARGET}.
+  @item Otherwise install @code{SOURCE} as @code{TARGET}.
+  @end itemize
+
+@item When @code{SOURCE} is a directory with a trailing slash, or when @code{FILTERS} are used,
+  the trailing slash of @code{TARGET} is implied.
+  @itemize
+  @item Without @code{FILTERS}, install the full @code{SOURCE} @emph{content} to @code{TARGET}.
+    The paths relative to @code{SOURCE} are preserved within @code{TARGET}.
+  @item With @code{FILTERS} among @code{#:include}, @code{#:include-regexp}, @code{exclude},
+    @code{#:exclude-regexp}:
+    @itemize
+      @item With @code{#:include}, install only the exact subpaths in the list.
+      @item With @code{#:include-regexp}, install subpaths matching the regexps in the list.
+      @item The @code{#:exclude} and @code{#:exclude-regexp} filters work similarly.  Without @code{#:include} flags,
+        install every subpath but the files matching the exclusion filters.
+        If both inclusions and exclusions are specified, the exclusions are done
+        on the inclusion list.
+    @end itemize
+  @end itemize
+@end itemize
+
+Examples:
+
+@itemize
+@item @code{("foo/bar" "share/my-app/")}: Install @code{bar} to @code{share/my-app/bar}.
+@item @code{("foo/bar" "share/my-app/baz")}: Install @code{bar}t o @code{share/my-app/baz}.
+@item @code{("foo/" "share/my-app")}: Install the content of @code{foo} inside @code{share/my-app},
+  e.g. install @code{foo/sub/file} to @code{share/my-app/sub/file}.
+@item @code{("foo/" "share/my-app" #:include ("sub/file"))}: Install only @code{foo/sub/file} to
+@code{share/my-app/sub/file}.
+@item @code{("foo/sub" "share/my-app" #:include ("file"))}: Install @code{foo/sub/file} to
+@code{share/my-app/file}.
+@end itemize
+
+
 @cindex Clojure (programming language)
 @cindex simple Clojure build system
 @defvr {Scheme Variable} clojure-build-system
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm
new file mode 100644
index 0000000000..9686e7e5c2
--- /dev/null
+++ b/guix/build-system/copy.scm
@@ -0,0 +1,145 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;;
+;;; 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 copy)
+  #:use-module (guix store)
+  #:use-module (guix utils)
+  #:use-module (guix derivations)
+  #:use-module (guix search-paths)
+  #:use-module (guix build-system)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix packages)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:export (%copy-build-system-modules
+            default-glibc
+            lower
+            copy-build
+            copy-build-system))
+
+;; Commentary:
+;;
+;; Standard build procedure for simple packages that don't require much
+;; compilation, mostly just copying files around.  This is implemented as an
+;; extension of `gnu-build-system'.
+;;
+;; Code:
+
+(define %copy-build-system-modules
+  ;; Build-side modules imported by default.
+  `((guix build copy-build-system)
+    ,@%gnu-build-system-modules))
+
+(define (default-glibc)
+  "Return the default glibc package."
+  ;; Do not use `@' to avoid introducing circular dependencies.
+  (let ((module (resolve-interface '(gnu packages base))))
+    (module-ref module 'glibc)))
+
+(define* (lower name
+                #:key source inputs native-inputs outputs system target
+                (glibc (default-glibc))
+                #:allow-other-keys
+                #:rest arguments)
+  "Return a bag for NAME."
+  (define private-keywords
+    '(#:source #:target #:inputs #:native-inputs))
+
+  (and (not target)                               ;XXX: no cross-compilation
+       (bag
+         (name name)
+         (system system)
+         (host-inputs `(,@(if source
+                              `(("source" ,source))
+                              '())
+                        ,@inputs
+
+                        ;; Keep the standard inputs of 'gnu-build-system'.
+                        ,@(standard-packages)))
+         (build-inputs native-inputs)
+         (outputs outputs)
+         (build copy-build)
+         (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (copy-build store name inputs
+                     #:key (guile #f)
+                     (outputs '("out"))
+                     (install-plan ''(("." (".") "./")))
+                     (search-paths '())
+                     (out-of-source? #t)
+                     (validate-runpath? #t)
+                     (patch-shebangs? #t)
+                     (strip-binaries? #t)
+                     (strip-flags ''("--strip-debug"))
+                     (strip-directories ''("lib" "lib64" "libexec"
+                                           "bin" "sbin"))
+                     (phases '(@ (guix build copy-build-system)
+                                 %standard-phases))
+                     (system (%current-system))
+                     (imported-modules %copy-build-system-modules)
+                     (modules '((guix build copy-build-system)
+                                (guix build utils))))
+  "Build SOURCE using INSTALL-PLAN, and with INPUTS."
+  (define builder
+    `(begin
+       (use-modules ,@modules)
+       (copy-build #:source ,(match (assoc-ref inputs "source")
+                               (((?  derivation? source))
+                                (derivation->output-path source))
+                               ((source)
+                                source)
+                               (source
+                                source))
+                   #:system ,system
+                   #:outputs %outputs
+                   #:inputs %build-inputs
+                   #:install-plan ,install-plan
+                   #:search-paths ',(map search-path-specification->sexp
+                                         search-paths)
+                   #:phases ,phases
+                   #:out-of-source? ,out-of-source?
+                   #:validate-runpath? ,validate-runpath?
+                   #:patch-shebangs? ,patch-shebangs?
+                   #:strip-binaries? ,strip-binaries?
+                   #:strip-flags ,strip-flags
+                   #:strip-directories ,strip-directories)))
+
+  (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
+                                #:system system
+                                #:inputs inputs
+                                #:modules imported-modules
+                                #:outputs outputs
+                                #:guile-for-build guile-for-build))
+
+(define copy-build-system
+  (build-system
+    (name 'copy)
+    (description "The standard copy build system")
+    (lower lower)))
+
+;;; copy.scm ends here
diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm
new file mode 100644
index 0000000000..c9c8f1165b
--- /dev/null
+++ b/guix/build/copy-build-system.scm
@@ -0,0 +1,156 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;;
+;;; 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 copy-build-system)
+  #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+  #:use-module (guix build utils)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 ftw)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:export (%standard-phases
+            copy-build))
+
+;; Commentary:
+;;
+;; System for building packages that don't require much compilation, mostly
+;; only to copy files around.
+;;
+;; Code:
+
+(define* (install #:key install-plan outputs #:allow-other-keys)
+  "Copy files from the \"source\" build input to the \"out\" output according to INSTALL-PLAN.
+
+An install plan is a list of plans in the form:
+
+  (SOURCE TARGET [FILTERS])
+
+In the above, FILTERS are optional.
+
+- When SOURCE matches a file or directory without trailing slash, install it to
+  TARGET.
+  - If TARGET has a trailing slash, install SOURCE basename beneath TARGET.
+  - Otherwise install SOURCE as TARGET.
+
+- When SOURCE is a directory with a trailing slash, or when FILTERS are used,
+  the trailing slash of TARGET is implied.
+  - Without FILTERS, install the full SOURCE _content_ to TARGET.
+    The paths relative to SOURCE are preserved within TARGET.
+  - With FILTERS among `#:include`, `#:include-regexp`, `#:exclude`,
+    `#:exclude-regexp`:
+    - With `#:include`, install only the exact subpaths in the list.
+    - With `#:include-regexp`, install subpaths matching the regexps in the list.
+    - The `#:exclude*` FILTERS work similarly.  Without `#:include*` flags,
+      install every subpath but the files matching the `#:exlude*` filters.
+      If both `#:include*` and `#:exclude*` are specified, the exclusion is done
+      on the inclusion list.
+
+Examples:
+
+- `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-app/bar\".
+- `(\"foo/bar\" \"share/my-app/baz\")`: Install bar to \"share/my-app/baz\".
+- `(\"foo/\" \"share/my-app\")`: Install the content of foo inside \"share/my-app\",
+  e.g. install \"foo/sub/file\" to \"share/my-app/sub/file\".
+- `(\"foo/\" \"share/my-app\" #:include (\"sub/file\"))`: Install only \"foo/sub/file\" to
+\"share/my-app/sub/file\".
+- `(\"foo/sub\" \"share/my-app\" #:include (\"file\"))`: Install \"foo/sub/file\" to
+\"share/my-app/file\"."
+  (define (install-simple source target)
+    "TARGET must point to a store location."
+    (set! target (if (string-suffix? "/" target)
+                     (string-append target (basename source))
+                     target))
+    (mkdir-p (dirname target))
+    (copy-recursively source target))
+
+  (define (install-file file target)
+    (let ((dest (string-append target
+                               (if (string-suffix? "/" target)
+                                   (string-append "/" file)
+                                   file))))
+      (format (current-output-port) "`~a' -> `~a'~%" file dest)
+      (mkdir-p (dirname dest))
+      (copy-file file dest)))
+
+  (define (make-file-predicate matches matches-regexp)
+    (if (or matches matches-regexp)
+        (lambda (file)
+          (any (lambda (pred) (pred file))
+               (append
+                (map (lambda (str)
+                       (lambda (f) (string-contains f str)))
+                     (or matches '()))
+                (map (lambda (regexp)
+                       (lambda (f) (regexp-exec (make-regexp regexp) f)))
+                     (or matches-regexp '())))))
+        (const #t)))
+
+  (define* (install-file-list source target #:key include exclude include-regexp exclude-regexp)
+    (let* ((exclusion-pred (negate (make-file-predicate exclude exclude-regexp)))
+           (inclusion-pred (make-file-predicate include include-regexp))
+           (file-list
+            (filter exclusion-pred
+                    ;; We must use switch current directory to source so
+                    ;; that `find-files' returns file paths relative to
+                    ;; source.
+                    (with-directory-excursion source
+                      (find-files "." (lambda (file _stat)
+                                        (inclusion-pred file)))))))
+      (map (cut install-file <> (if (string-suffix? "/" target)
+                                    target
+                                    (string-append target "/")))
+           file-list)))
+
+  (define* (install source target #:key include exclude include-regexp exclude-regexp)
+    (set! target (string-append (assoc-ref outputs "out") "/" target))
+    (let ((filters? (or include exclude include-regexp exclude-regexp)))
+      (when (and (not (file-is-directory? source))
+                 filters?)
+        (error "Cannot use filters when SOURCE is a file."))
+      (let ((multi-files-in-source?
+             (or (string-suffix? "/" source)
+                 (and (file-is-directory? source)
+                      filters?))))
+        (if multi-files-in-source?
+            (install-file-list source target
+                               #:include include
+                               #:exclude exclude
+                               #:include-regexp include-regexp
+                               #:exclude-regexp exclude-regexp)
+            (install-simple source target)))))
+
+  (for-each (lambda (plan) (apply install plan)) install-plan)
+  #t)
+
+(define %standard-phases
+  ;; Everything is as with the GNU Build System except for the `configure'
+  ;; , `build', `check' and `install' phases.
+  (modify-phases gnu:%standard-phases
+    (delete 'bootstrap)
+    (delete 'configure)
+    (delete 'build)
+    (delete 'check)
+    (replace 'install install)))
+
+(define* (copy-build #:key inputs (phases %standard-phases)
+                     #:allow-other-keys #:rest args)
+  "Build the given package, applying all of PHASES in order."
+  (apply gnu:gnu-build #:inputs inputs #:phases phases args))
+
+;;; copy-build-system.scm ends here
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 14 Feb 2020 13:40:01 GMT) Full text and rfc822 format available.

Message #14 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Giovanni Biscuolo <g <at> xelera.eu>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/2] build-system: Add copy-build-system.
Date: Fri, 14 Feb 2020 14:39:10 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

[...]

> diff --git a/doc/guix.texi b/doc/guix.texi
> index 42d7cfa2e8..d1ec214674 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -6159,6 +6159,63 @@ parameters available to cargo.  It will also remove an included
>  if they are defined by the crate.
>  @end defvr
>  
> +
> +@defvr {Scheme Variable} copy-build-system
> +@cindex (copy build system)
> +This variable is exported by @code{(guix build-system copy)}.  It
> +supports builds of simple packages that don't require much compiling,
> +mostly just moving files around.
> +
> +It adds much of the @code{gnu-build-system} packages to the set of
> +inputs.  Because of this, the @code{copy-build-system} does not require
> +all the boilerplate code often implied by the
> +@code{trivial-build-system}.
> +
> +To further simplify the file installation process, an
> +@code{#:install-plan} argument is exposed to let the packaer specify

s/packaer/packager

[...]

Thanks! Gio'

-- 
Giovanni Biscuolo

Xelera IT Infrastructures
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Sun, 16 Feb 2020 13:17:01 GMT) Full text and rfc822 format available.

Message #17 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Giovanni Biscuolo <g <at> xelera.eu>, 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/2] build-system: Add copy-build-system.
Date: Sun, 16 Feb 2020 14:16:34 +0100
[Message part 1 (text/plain, inline)]
Note to myself: maybe rename "install-simple" to "install-single".

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:13:02 GMT) Full text and rfc822 format available.

Message #20 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gnu: gcide: Use the copy-build-system.
Date: Mon, 17 Feb 2020 12:12:26 +0100
* gnu/packages/dictionaries.scm (gcide2)[build-system]: Use the
  copy-build-system.
---
 gnu/packages/dictionaries.scm | 22 ++++------------------
 1 file changed, 4 insertions(+), 18 deletions(-)

diff --git a/gnu/packages/dictionaries.scm b/gnu/packages/dictionaries.scm
index cd0a5db93c..d40c43f74e 100644
--- a/gnu/packages/dictionaries.scm
+++ b/gnu/packages/dictionaries.scm
@@ -31,6 +31,7 @@
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system python)
   #:use-module (guix build-system trivial)
+  #:use-module (guix build-system copy)
   #:use-module (gnu packages)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages base)
@@ -109,25 +110,10 @@ acronyms distributed as an info document.")
               (sha256
                (base32
                 "1n3bp91sik66z3ca7mjqbr9nck3hg5ck0c8g84xc0qnfpx5vznh2"))))
-    (build-system trivial-build-system)
+    (build-system copy-build-system)
     (arguments
-     '(#:builder (begin
-                   (use-modules (guix build utils))
-                   (let* ((src     (assoc-ref %build-inputs "source"))
-                          (tar     (assoc-ref %build-inputs "tar"))
-                          (xz      (assoc-ref %build-inputs "xz"))
-                          (out     (assoc-ref %outputs "out"))
-                          (datadir (string-append out "/share/gcide")))
-                     (set-path-environment-variable "PATH" '("bin")
-                                                    (list tar xz))
-                     (mkdir-p datadir)
-                     (invoke "tar" "-C" datadir
-                             "--strip-components=1"
-                             "-xvf" src)))
-       #:modules ((guix build utils))))
-    (native-inputs
-     `(("tar" ,tar)
-       ("xz" ,xz)))
+     '(#:install-plan
+       '(("." "share/gcide/" #:exclude ("COPYING")))))
     (synopsis "GNU Collaborative International Dictionary of English")
     (description
      "GCIDE is a free dictionary based on a combination of sources.  It can
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:13:02 GMT) Full text and rfc822 format available.

Message #23 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 3/4] gnu: Add clojure-wrapper.
Date: Mon, 17 Feb 2020 12:12:27 +0100
* gnu/packages/clojure.scm (clojure-wrapper): New variable.
---
 gnu/packages/clojure.scm | 30 +++++++++++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/clojure.scm b/gnu/packages/clojure.scm
index 9a1ceed66c..f34e4dadab 100644
--- a/gnu/packages/clojure.scm
+++ b/gnu/packages/clojure.scm
@@ -1,8 +1,9 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018 Alex Vong <alexvong1995 <at> gmail.com>
-;;; Copyright © 2018 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;; Copyright © 2018, 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me <at> tobias.gr>
 ;;; Copyright © 2020 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2020 Jesse Gibbons <jgibbons2357 <at> gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -27,6 +28,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system ant)
   #:use-module (guix build-system clojure)
+  #:use-module (guix build-system copy)
   #:use-module (ice-9 match))
 
 (define-public clojure
@@ -321,3 +323,29 @@ tree.
      "The @code{tools.cli} library provides Clojure programmers with tools to
 work with command-line arguments.")
     (license license:epl1.0)))
+
+(define-public clojure-wrapper
+  (package
+    (name "clojure-wrapper")
+    (version "1.10.1.507")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/clojure/brew-install.git")
+             (commit version)))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "1zipz22pszv4vls4qhxkia8gm86s1wkahr0jdbqhc46mpd8n54fz"))))
+    (build-system copy-build-system)
+    (arguments
+     `(#:install-plan
+       `(("src/main/resources/" "bin/" #:include ("clj" "clojure"))
+         ("doc/clojure.1" "share/man/man1/")
+         ("epl.html" ,,(string-append "share/doc/clojure-" (package-version clojure) "/")))))
+    (synopsis "Clojure launch scripts")
+    (description "Scripts to launch Clojure from the command line.
+Without these scripts a user would need to run jar with the Clojure jar's
+location.")
+    (home-page "https://clojure.org/")
+    (license license:epl1.0)))
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:13:02 GMT) Full text and rfc822 format available.

Message #26 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 4/4] gnu: net-base: Use copy build system.
Date: Mon, 17 Feb 2020 12:12:28 +0100
* gnu/packages/admin.scm (net-base)[build-system]: Use copy-build-system.
---
 gnu/packages/admin.scm | 29 ++++++-----------------------
 1 file changed, 6 insertions(+), 23 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 4780fe124e..1f384edb2c 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -54,6 +54,7 @@
   #:use-module (guix download)
   #:use-module (guix git-download)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system meson)
@@ -566,30 +567,12 @@ to allow automatic login and starting any app.")
              (sha256
               (base32
                "12xqjwg3p4rzmmh2iib6sigm9l29y3dgk74mmnw64k84jnbwdxl1"))))
-    (build-system trivial-build-system)
+    (build-system copy-build-system)
     (arguments
-     `(#:modules ((guix build utils))
-       #:builder (begin
-                   (use-modules (guix build utils)
-                                (srfi srfi-26))
-
-                   (let* ((source (assoc-ref %build-inputs "source"))
-                          (tar    (assoc-ref %build-inputs "tar"))
-                          (xz     (assoc-ref %build-inputs "xz"))
-                          (output (assoc-ref %outputs "out"))
-                          (etc    (string-append output "/etc")))
-                     (setenv "PATH" (string-append xz "/bin"))
-                     (invoke (string-append tar "/bin/tar") "xvf"
-                             source)
-                     (chdir ,(string-append "netbase-" version))
-                     (mkdir-p etc)
-                     (for-each copy-file
-                               '("etc-services" "etc-protocols" "etc-rpc")
-                               (map (cut string-append etc "/" <>)
-                                    '("services" "protocols" "rpc")))
-                     #t))))
-    (native-inputs `(("tar" ,tar)
-                     ("xz" ,xz)))
+     `(#:install-plan
+       `(("etc-services" "etc/services")
+         ("etc-protocols" "etc/protocols")
+         ("etc-rpc" "etc/rpc"))))
     (synopsis "IANA protocol, port, and RPC number assignments")
     (description
      "This package provides the /etc/services, /etc/protocols, and /etc/rpc
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:13:03 GMT) Full text and rfc822 format available.

Message #29 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: 39599 <at> debbugs.gnu.org
Subject: [PATCH 1/4] build-system: Add copy-build-system.
Date: Mon, 17 Feb 2020 12:12:25 +0100
* guix/build-system/copy.scm: New file.
* guix/build/copy-build-system.scm: New file.
* Makefile.am (MODULES): Add them.
* doc/guix.texi (Build Systems): Document 'copy-build-system'.
---
 Makefile.am                      |   2 +
 doc/guix.texi                    |  58 ++++++++++++
 guix/build-system/copy.scm       | 145 ++++++++++++++++++++++++++++
 guix/build/copy-build-system.scm | 156 +++++++++++++++++++++++++++++++
 4 files changed, 361 insertions(+)
 create mode 100644 guix/build-system/copy.scm
 create mode 100644 guix/build/copy-build-system.scm

diff --git a/Makefile.am b/Makefile.am
index c6a2e6cf6c..e18c17d8b3 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -122,6 +122,7 @@ MODULES =					\
   guix/build-system/meson.scm			\
   guix/build-system/minify.scm			\
   guix/build-system/asdf.scm			\
+  guix/build-system/copy.scm			\
   guix/build-system/glib-or-gtk.scm		\
   guix/build-system/gnu.scm			\
   guix/build-system/guile.scm			\
@@ -169,6 +170,7 @@ MODULES =					\
   guix/build/go-build-system.scm		\
   guix/build/asdf-build-system.scm		\
   guix/build/bzr.scm				\
+  guix/build/copy-build-system.scm		\
   guix/build/git.scm				\
   guix/build/hg.scm				\
   guix/build/glib-or-gtk-build-system.scm	\
diff --git a/doc/guix.texi b/doc/guix.texi
index 42d7cfa2e8..578ae9a43d 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -6159,6 +6159,64 @@ parameters available to cargo.  It will also remove an included
 if they are defined by the crate.
 @end defvr
 
+
+@defvr {Scheme Variable} copy-build-system
+@cindex (copy build system)
+This variable is exported by @code{(guix build-system copy)}.  It
+supports builds of simple packages that don't require much compiling,
+mostly just moving files around.
+
+It adds much of the @code{gnu-build-system} packages to the set of
+inputs.  Because of this, the @code{copy-build-system} does not require
+all the boilerplate code often implied by the
+@code{trivial-build-system}.
+
+To further simplify the file installation process, an
+@code{#:install-plan} argument is exposed to let the packaer specify
+which files go where.
+The install plan is a list of @code{(SOURCE TARGET [FILTERS])}.
+@code{FILTERS} are optional.
+
+@itemize
+@item When @code{SOURCE} matches a file or directory without trailing slash, install it to @code{TARGET}.
+  @itemize
+  @item If @code{TARGET} has a trailing slash, install @code{SOURCE} basename beneath @code{TARGET}.
+  @item Otherwise install @code{SOURCE} as @code{TARGET}.
+  @end itemize
+
+@item When @code{SOURCE} is a directory with a trailing slash, or when @code{FILTERS} are used,
+  the trailing slash of @code{TARGET} is implied.
+  @itemize
+  @item Without @code{FILTERS}, install the full @code{SOURCE} @emph{content} to @code{TARGET}.
+    The paths relative to @code{SOURCE} are preserved within @code{TARGET}.
+  @item With @code{FILTERS} among @code{#:include}, @code{#:include-regexp}, @code{exclude},
+    @code{#:exclude-regexp}:
+    @itemize
+      @item With @code{#:include}, install only the paths which suffix exactly matches
+      one of the elements in the list.
+      @item With @code{#:include-regexp}, install subpaths matching the regexps in the list.
+      @item The @code{#:exclude} and @code{#:exclude-regexp} filters work similarly.  Without @code{#:include} flags,
+        install every subpath but the files matching the exclusion filters.
+        If both inclusions and exclusions are specified, the exclusions are done
+        on the inclusion list.
+    @end itemize
+  @end itemize
+@end itemize
+
+Examples:
+
+@itemize
+@item @code{("foo/bar" "share/my-app/")}: Install @code{bar} to @code{share/my-app/bar}.
+@item @code{("foo/bar" "share/my-app/baz")}: Install @code{bar}t o @code{share/my-app/baz}.
+@item @code{("foo/" "share/my-app")}: Install the content of @code{foo} inside @code{share/my-app},
+  e.g. install @code{foo/sub/file} to @code{share/my-app/sub/file}.
+@item @code{("foo/" "share/my-app" #:include ("sub/file"))}: Install only @code{foo/sub/file} to
+@code{share/my-app/sub/file}.
+@item @code{("foo/sub" "share/my-app" #:include ("file"))}: Install @code{foo/sub/file} to
+@code{share/my-app/file}.
+@end itemize
+
+
 @cindex Clojure (programming language)
 @cindex simple Clojure build system
 @defvr {Scheme Variable} clojure-build-system
diff --git a/guix/build-system/copy.scm b/guix/build-system/copy.scm
new file mode 100644
index 0000000000..9686e7e5c2
--- /dev/null
+++ b/guix/build-system/copy.scm
@@ -0,0 +1,145 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;;
+;;; 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 copy)
+  #:use-module (guix store)
+  #:use-module (guix utils)
+  #:use-module (guix derivations)
+  #:use-module (guix search-paths)
+  #:use-module (guix build-system)
+  #:use-module (guix build-system gnu)
+  #:use-module (guix packages)
+  #:use-module (ice-9 match)
+  #:use-module (srfi srfi-1)
+  #:export (%copy-build-system-modules
+            default-glibc
+            lower
+            copy-build
+            copy-build-system))
+
+;; Commentary:
+;;
+;; Standard build procedure for simple packages that don't require much
+;; compilation, mostly just copying files around.  This is implemented as an
+;; extension of `gnu-build-system'.
+;;
+;; Code:
+
+(define %copy-build-system-modules
+  ;; Build-side modules imported by default.
+  `((guix build copy-build-system)
+    ,@%gnu-build-system-modules))
+
+(define (default-glibc)
+  "Return the default glibc package."
+  ;; Do not use `@' to avoid introducing circular dependencies.
+  (let ((module (resolve-interface '(gnu packages base))))
+    (module-ref module 'glibc)))
+
+(define* (lower name
+                #:key source inputs native-inputs outputs system target
+                (glibc (default-glibc))
+                #:allow-other-keys
+                #:rest arguments)
+  "Return a bag for NAME."
+  (define private-keywords
+    '(#:source #:target #:inputs #:native-inputs))
+
+  (and (not target)                               ;XXX: no cross-compilation
+       (bag
+         (name name)
+         (system system)
+         (host-inputs `(,@(if source
+                              `(("source" ,source))
+                              '())
+                        ,@inputs
+
+                        ;; Keep the standard inputs of 'gnu-build-system'.
+                        ,@(standard-packages)))
+         (build-inputs native-inputs)
+         (outputs outputs)
+         (build copy-build)
+         (arguments (strip-keyword-arguments private-keywords arguments)))))
+
+(define* (copy-build store name inputs
+                     #:key (guile #f)
+                     (outputs '("out"))
+                     (install-plan ''(("." (".") "./")))
+                     (search-paths '())
+                     (out-of-source? #t)
+                     (validate-runpath? #t)
+                     (patch-shebangs? #t)
+                     (strip-binaries? #t)
+                     (strip-flags ''("--strip-debug"))
+                     (strip-directories ''("lib" "lib64" "libexec"
+                                           "bin" "sbin"))
+                     (phases '(@ (guix build copy-build-system)
+                                 %standard-phases))
+                     (system (%current-system))
+                     (imported-modules %copy-build-system-modules)
+                     (modules '((guix build copy-build-system)
+                                (guix build utils))))
+  "Build SOURCE using INSTALL-PLAN, and with INPUTS."
+  (define builder
+    `(begin
+       (use-modules ,@modules)
+       (copy-build #:source ,(match (assoc-ref inputs "source")
+                               (((?  derivation? source))
+                                (derivation->output-path source))
+                               ((source)
+                                source)
+                               (source
+                                source))
+                   #:system ,system
+                   #:outputs %outputs
+                   #:inputs %build-inputs
+                   #:install-plan ,install-plan
+                   #:search-paths ',(map search-path-specification->sexp
+                                         search-paths)
+                   #:phases ,phases
+                   #:out-of-source? ,out-of-source?
+                   #:validate-runpath? ,validate-runpath?
+                   #:patch-shebangs? ,patch-shebangs?
+                   #:strip-binaries? ,strip-binaries?
+                   #:strip-flags ,strip-flags
+                   #:strip-directories ,strip-directories)))
+
+  (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
+                                #:system system
+                                #:inputs inputs
+                                #:modules imported-modules
+                                #:outputs outputs
+                                #:guile-for-build guile-for-build))
+
+(define copy-build-system
+  (build-system
+    (name 'copy)
+    (description "The standard copy build system")
+    (lower lower)))
+
+;;; copy.scm ends here
diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm
new file mode 100644
index 0000000000..ea37ea0161
--- /dev/null
+++ b/guix/build/copy-build-system.scm
@@ -0,0 +1,156 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
+;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
+;;;
+;;; 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 copy-build-system)
+  #:use-module ((guix build gnu-build-system) #:prefix gnu:)
+  #:use-module (guix build utils)
+  #:use-module (ice-9 match)
+  #:use-module (ice-9 ftw)
+  #:use-module (srfi srfi-1)
+  #:use-module (srfi srfi-26)
+  #:export (%standard-phases
+            copy-build))
+
+;; Commentary:
+;;
+;; System for building packages that don't require much compilation, mostly
+;; only to copy files around.
+;;
+;; Code:
+
+(define* (install #:key install-plan outputs #:allow-other-keys)
+  "Copy files from the \"source\" build input to the \"out\" output according to INSTALL-PLAN.
+
+An install plan is a list of plans in the form:
+
+  (SOURCE TARGET [FILTERS])
+
+In the above, FILTERS are optional.
+
+- When SOURCE matches a file or directory without trailing slash, install it to
+  TARGET.
+  - If TARGET has a trailing slash, install SOURCE basename beneath TARGET.
+  - Otherwise install SOURCE as TARGET.
+
+- When SOURCE is a directory with a trailing slash, or when FILTERS are used,
+  the trailing slash of TARGET is implied.
+  - Without FILTERS, install the full SOURCE _content_ to TARGET.
+    The paths relative to SOURCE are preserved within TARGET.
+  - With FILTERS among `#:include`, `#:include-regexp`, `#:exclude`,
+    `#:exclude-regexp`:
+    - With `#:include`, install only the paths which suffix exactly matches
+      one of the elements in the list.
+    - With `#:include-regexp`, install subpaths matching the regexps in the list.
+    - The `#:exclude*` FILTERS work similarly.  Without `#:include*` flags,
+      install every subpath but the files matching the `#:exlude*` filters.
+      If both `#:include*` and `#:exclude*` are specified, the exclusion is done
+      on the inclusion list.
+
+Examples:
+
+- `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-app/bar\".
+- `(\"foo/bar\" \"share/my-app/baz\")`: Install bar to \"share/my-app/baz\".
+- `(\"foo/\" \"share/my-app\")`: Install the content of foo inside \"share/my-app\",
+  e.g. install \"foo/sub/file\" to \"share/my-app/sub/file\".
+- `(\"foo/\" \"share/my-app\" #:include (\"sub/file\"))`: Install only \"foo/sub/file\" to
+\"share/my-app/sub/file\".
+- `(\"foo/sub\" \"share/my-app\" #:include (\"file\"))`: Install \"foo/sub/file\" to
+\"share/my-app/file\"."
+  (define (install-simple source target)
+    "TARGET must point to a store location."
+    (set! target (if (string-suffix? "/" target)
+                     (string-append target (basename source))
+                     target))
+    (mkdir-p (dirname target))
+    (copy-recursively source target))
+
+  (define (install-file file target)
+    (let ((dest (string-append target
+                               (if (string-suffix? "/" target)
+                                   (string-append "/" file)
+                                   file))))
+      (format (current-output-port) "`~a' -> `~a'~%" file dest)
+      (mkdir-p (dirname dest))
+      (copy-file file dest)))
+
+  (define* (make-file-predicate matches matches-regexp #:optional (default-value #t))
+    (if (or matches matches-regexp)
+        (lambda (file)
+          (any (lambda (pred) (pred file))
+               (append
+                (map (lambda (str)
+                       (lambda (f) (string-suffix? str f)))
+                     (or matches '()))
+                (map (lambda (regexp)
+                       (lambda (f) (regexp-exec (make-regexp regexp) f)))
+                     (or matches-regexp '())))))
+        (const default-value)))
+
+  (define* (install-file-list source target #:key include exclude include-regexp exclude-regexp)
+    ;; We must use switch current directory to source so that `find-files'
+    ;; returns file paths relative to source.
+    (with-directory-excursion source
+      (let* ((exclusion-pred (negate (make-file-predicate exclude exclude-regexp #f)))
+             (inclusion-pred (make-file-predicate include include-regexp))
+             (file-list
+              (filter! exclusion-pred
+                       (find-files "." (lambda (file _stat)
+                                         (inclusion-pred file))))))
+        (map (cut install-file <> (if (string-suffix? "/" target)
+                                      target
+                                      (string-append target "/")))
+             file-list))))
+
+  (define* (install source target #:key include exclude include-regexp exclude-regexp)
+    (set! target (string-append (assoc-ref outputs "out") "/" target))
+    (let ((filters? (or include exclude include-regexp exclude-regexp)))
+      (when (and (not (file-is-directory? source))
+                 filters?)
+        (error "Cannot use filters when SOURCE is a file."))
+      (let ((multi-files-in-source?
+             (or (string-suffix? "/" source)
+                 (and (file-is-directory? source)
+                      filters?))))
+        (if multi-files-in-source?
+            (install-file-list source target
+                               #:include include
+                               #:exclude exclude
+                               #:include-regexp include-regexp
+                               #:exclude-regexp exclude-regexp)
+            (install-simple source target)))))
+
+  (for-each (lambda (plan) (apply install plan)) install-plan)
+  #t)
+
+(define %standard-phases
+  ;; Everything is as with the GNU Build System except for the `configure'
+  ;; , `build', `check' and `install' phases.
+  (modify-phases gnu:%standard-phases
+    (delete 'bootstrap)
+    (delete 'configure)
+    (delete 'build)
+    (delete 'check)
+    (replace 'install install)))
+
+(define* (copy-build #:key inputs (phases %standard-phases)
+                     #:allow-other-keys #:rest args)
+  "Build the given package, applying all of PHASES in order."
+  (apply gnu:gnu-build #:inputs inputs #:phases phases args))
+
+;;; copy-build-system.scm ends here
-- 
2.25.0





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:50:01 GMT) Full text and rfc822 format available.

Message #32 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Mon, 17 Feb 2020 12:48:56 +0100
Hey Pierre,

Thanks for this patch! A few remarks below.

> +@item @code{("foo/bar" "share/my-app/baz")}: Install @code{bar}t o @code{share/my-app/baz}.
                                                                   ^
                                                                   typo

> +  (and (not target)                               ;XXX: no cross-compilation

Why don't we support cross-compilation here?

> +    (set! target (if (string-suffix? "/" target)
> +                     (string-append target (basename source))
> +                     target))

We could use let instead of set!, right?

> +  (define* (make-file-predicate matches matches-regexp #:optional (default-value #t))
> +    (if (or matches matches-regexp)
> +        (lambda (file)
> +          (any (lambda (pred) (pred file))
> +               (append
> +                (map (lambda (str)
> +                       (lambda (f) (string-suffix? str f)))
> +                     (or matches '()))
> +                (map (lambda (regexp)
> +                       (lambda (f) (regexp-exec (make-regexp regexp) f)))
> +                     (or matches-regexp '())))))
> +        (const default-value)))

You could maybe explain a bit what this function does. And how 'file'
differs from 'f'.

Thanks,

Mathieu




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Mon, 17 Feb 2020 11:50:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 01:08:02 GMT) Full text and rfc822 format available.

Message #38 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: "Alex Griffin" <a <at> ajgrf.com>
To: 39599 <at> debbugs.gnu.org, "Pierre Neidhardt" <mail <at> ambrevar.xyz>
Subject: Re: [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 01:06:44 +0000
[Message part 1 (text/plain, inline)]
I had to revert your documentation changes to get Guix to compile. I think you are missing '@end defvr' somewhere. Also, I packaged PaperWM using copy-build-system as an additional test case. The patch is attached.

Good work, Pierre!
-- 
Alex Griffin
[0001-gnu-Add-gnome-shell-extension-paperwm.patch (text/x-patch, attachment)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 08:41:02 GMT) Full text and rfc822 format available.

Message #41 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Alex Griffin <a <at> ajgrf.com>, 39599 <at> debbugs.gnu.org
Subject: Re: [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 09:40:22 +0100
[Message part 1 (text/plain, inline)]
Great, I'll merge tomorrow then if no one objects!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 08:45:02 GMT) Full text and rfc822 format available.

Message #44 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Mathieu Othacehe <m.othacehe <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: Alex Griffin <a <at> ajgrf.com>, 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 09:44:08 +0100
Hello Pierre,

> Great, I'll merge tomorrow then if no one objects!

No strong objection, but I did a few remarks here[1].

Thanks,

Mathieu

[1]: https://lists.gnu.org/archive/html/guix-patches/2020-02/msg00500.html





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 08:45:02 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 09:48:01 GMT) Full text and rfc822 format available.

Message #50 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Ricardo Wurmus <rekado <at> elephly.net>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 10:47:10 +0100
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> +  (define* (make-file-predicate matches matches-regexp #:optional (default-value #t))
> +    (if (or matches matches-regexp)
> +        (lambda (file)
> +          (any (lambda (pred) (pred file))
> +               (append
> +                (map (lambda (str)
> +                       (lambda (f) (string-suffix? str f)))
> +                     (or matches '()))
> +                (map (lambda (regexp)
> +                       (lambda (f) (regexp-exec (make-regexp regexp) f)))
> +                     (or matches-regexp '())))))
> +        (const default-value)))

This looks too complicated.

I think this is clearer:

--8<---------------cut here---------------start------------->8---
(define* (make-file-predicate suffixes matches-regexp #:optional (default-value #t))
  (if (or suffixes matches-regexp)
      (let* ((suffixes (or suffixes '()))
             (regexps (map make-regexp (or matches-regexp '())))
             (predicates (append
                          (map (lambda (str)
                                 (cut string-suffix? str <>))
                               suffixes)
                          (map (lambda (regexp)
                                 (cut regexp-exec regexp <>))
                               regexps))))
        (lambda (file)
          (any (cut <> file) predicates)))
      (const default-value)))
--8<---------------cut here---------------end--------------->8---

Also, as Mathieu wrote, please don’t use SET!.

-- 
Ricardo




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 10:01:01 GMT) Full text and rfc822 format available.

Message #53 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 11:00:32 +0100
[Message part 1 (text/plain, inline)]
Ricardo Wurmus <rekado <at> elephly.net> writes:

> --8<---------------cut here---------------start------------->8---
> (define* (make-file-predicate suffixes matches-regexp #:optional (default-value #t))
>   (if (or suffixes matches-regexp)
>       (let* ((suffixes (or suffixes '()))
>              (regexps (map make-regexp (or matches-regexp '())))
>              (predicates (append
>                           (map (lambda (str)
>                                  (cut string-suffix? str <>))
>                                suffixes)
>                           (map (lambda (regexp)
>                                  (cut regexp-exec regexp <>))
>                                regexps))))
>         (lambda (file)
>           (any (cut <> file) predicates)))
>       (const default-value)))
> --8<---------------cut here---------------end--------------->8---

Good suggestion, thanks!

The logic of this function is a bit convoluted in my opinion, but I
can't think of something simpler and just as short.  But since it's a
local function, I guess it's not a big deal.

> Also, as Mathieu wrote, please don’t use SET!.

No problem, but I don't recall seeing this message.  Where did Mathieu
write this?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 15:42:02 GMT) Full text and rfc822 format available.

Message #56 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Alex Griffin <a <at> ajgrf.com>, 39599 <at> debbugs.gnu.org, guix-devel <at> gnu.org
Subject: Re: [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 16:41:06 +0100
[Message part 1 (text/plain, inline)]
Should we add a mention in guix pull's "news"?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 17:11:02 GMT) Full text and rfc822 format available.

Message #59 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Julien Lepiller <julien <at> lepiller.eu>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 12:09:57 -0500
Le 20 février 2020 10:41:06 GMT-05:00, Pierre Neidhardt <mail <at> ambrevar.xyz> a écrit :
>Should we add a mention in guix pull's "news"?

It feels like this is an internal change that doesn't really affect end-user experience.




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Thu, 20 Feb 2020 18:01:02 GMT) Full text and rfc822 format available.

Message #62 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Thu, 20 Feb 2020 19:00:07 +0100
[Message part 1 (text/plain, inline)]
Fair enough.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 03:38:02 GMT) Full text and rfc822 format available.

Message #65 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: 39599 <at> debbugs.gnu.org
Cc: Jack Hill <jackhill <at> jackhill.us>, Alex Griffin <a <at> ajgrf.com>
Date: Thu, 20 Feb 2020 22:37:32 -0500
Alex,

On Thu, 20 Feb 2020, Alex Griffin wrote:

> I packaged PaperWM using copy-build-system as an additional test case.

This is great! I learned about PaperWM from your patch, and I've been having
lots of fun with it.

> +     '(#:install-plan
> +       '(("." "share/gnome-shell/extensions/paperwm <at> hedning:matrix.org"
> +          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
> +                            "\\.xml$" "\\.compiled$")))))

Seeing "compiled" here caught my attention. Since all we are doing so far is
copying files around, I expect everything to be in source form.

In this case the compiled file is a compiled glib schema. I've prepared a
second version of the patch that removes this file in a source snippet and
compiles it from the source in a new build phase.

This is another testament to the usefulness of the copy-build-system. It would
have been much more work to make the same modification to a package that uses
the trivial-build-system. Thanks Pierre!

Best,
Jack




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 03:39:02 GMT) Full text and rfc822 format available.

Message #68 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: 39599 <at> debbugs.gnu.org
Cc: Jack Hill <jackhill <at> jackhill.us>, Alex Griffin <a <at> ajgrf.com>
Subject: [PATCH v2] gnu: Add gnome-shell-extension-paperwm.
Date: Thu, 20 Feb 2020 22:37:33 -0500
* gnu/packages/gnome-xyz.scm (gnome-shell-extension-paperwm): New variable.

Co-authored-by: Alex Griffin <a <at> ajgrf.com>
---
 gnu/packages/gnome-xyz.scm | 39 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/gnome-xyz.scm b/gnu/packages/gnome-xyz.scm
index 7f375fefc5..59913e0602 100644
--- a/gnu/packages/gnome-xyz.scm
+++ b/gnu/packages/gnome-xyz.scm
@@ -2,6 +2,8 @@
 ;;; Copyright © 2019 Leo Prikler <leo.prikler <at> student.tugraz.at>
 ;;; Copyright © 2019 Alexandros Theodotou <alex <at> zrythm.org>
 ;;; Copyright © 2019 Giacomo Leidi <goodoldpaul <at> autistici.org>
+;;; Copyright © 2020 Alex Griffin <a <at> ajgrf.com>
+;;; Copyright © 2020 Jack Hill <jackhill <at> jackhill.us>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -21,6 +23,7 @@
 (define-module (gnu packages gnome-xyz)
   #:use-module (guix build-system trivial)
   #:use-module (guix build-system gnu)
+  #:use-module (guix build-system copy)
   #:use-module (guix git-download)
   #:use-module (guix packages)
   #:use-module ((guix licenses) #:prefix license:)
@@ -304,6 +307,42 @@ It uses ES6 syntax and claims to be more actively maintained than others.")
     (home-page "https://extensions.gnome.org/extension/2182/noannoyance/")
     (license license:gpl2)))
 
+(define-public gnome-shell-extension-paperwm
+  (package
+    (name "gnome-shell-extension-paperwm")
+    (version "34.3")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/paperwm/PaperWM.git")
+                    (commit version)))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "1qry75f696pgmd9yzqvwhq5h6cipin2fvk7h881g29cjcpxim37a"))
+              (snippet
+               '(begin (delete-file "schemas/gschemas.compiled")))))
+    (build-system copy-build-system)
+    (arguments
+     '(#:install-plan
+       '(("." "share/gnome-shell/extensions/paperwm <at> hedning:matrix.org"
+          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
+                            "\\.xml$" "\\.compiled$")))
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'compile-schemas
+           (lambda _
+             (with-directory-excursion "schemas"
+               (invoke "make")))))))
+    (native-inputs
+     `(("glib:bin" ,glib "bin"))) ; for glib-compile-schemas
+    (home-page "https://github.com/paperwm/PaperWM")
+    (synopsis "Tiled scrollable window management for GNOME Shell")
+    (description "PaperWM is an experimental GNOME Shell extension providing
+scrollable tiling of windows and per monitor workspaces.  It's inspired by paper
+notebooks and tiling window managers.")
+    (license license:gpl3)))
+
 (define-public numix-theme
   (package
     (name "numix-theme")
-- 
2.25.1





bug closed, send any further explanations to 39599 <at> debbugs.gnu.org and Pierre Neidhardt <mail <at> ambrevar.xyz> Request was from Pierre Neidhardt <mail <at> ambrevar.xyz> to control <at> debbugs.gnu.org. (Fri, 21 Feb 2020 09:54:01 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 09:55:01 GMT) Full text and rfc822 format available.

Message #73 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 10:53:59 +0100
[Message part 1 (text/plain, inline)]
Pushed!
Alex, I've included your patch.
Thanks to you all!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 10:44:01 GMT) Full text and rfc822 format available.

Message #76 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 11:43:02 +0100
Hello,

Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Pushed!

Thank you for this useful addition!

I added a few fixes to the Texinfo part of your patch.

Moreover, the indentation is very odd there, compared to the rest of
"guix.texi". You may want to normalize it.

Regards,

-- 
Nicolas Goaziou




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 11:09:02 GMT) Full text and rfc822 format available.

Message #79 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 12:07:57 +0100
[Message part 1 (text/plain, inline)]
Hi Nicolas!

> I added a few fixes to the Texinfo part of your patch.

Thanks for those painful changes :D
>
> Moreover, the indentation is very odd there, compared to the rest of
> "guix.texi". You may want to normalize it.

Oh, yes, I see that.  I thought it would help with readability.  How are
we supposed to visualize nested @itemize at the moment?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 11:44:02 GMT) Full text and rfc822 format available.

Message #82 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 12:43:21 +0100
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Oh, yes, I see that.  I thought it would help with readability.  How are
> we supposed to visualize nested @itemize at the moment?

I don't think there's a clear answer, but, IMO, for readability sake, we
should not (ab)use nested lists in a manual. 

There are three levels of such lists here. I think this is not
necessary. For example

--8<---------------cut here---------------start------------->8---
@item When @var{source} matches a file or directory without trailing slash, install it to @var{target}.
  @itemize
  @item If @var{target} has a trailing slash, install @var{source} basename beneath @var{target}.
  @item Otherwise install @var{source} as @var{target}.
  @end itemize
--8<---------------cut here---------------end--------------->8---

could be written as, e.g.,

--8<---------------cut here---------------start------------->8---
@item
When @var{source} matches a file or directory without a trailing slash,
install it to @var{target}.  More accurately, if @var{target} ends with
a slash, install @var{source} basename beneath @var{target} directory.
Otherwise install @var{source} as @var{target}.
--8<---------------cut here---------------end--------------->8---

Similarly, instead of discussing about #:include and al. in a nested
list, this could happen in a subsequent paragraph, once "source" and
"target" are clarified, i.e., after "In all cases, the paths (BTW,
shouldn't it be "file names"?) relative to @var{source} are preserved
within @var{target}."

As a side note, are you sure about: "With @code{#:include}, install all
the files which (I would use "whose" here, but I'm not a native speaker)
path suffix (isn't it "basename" or, possibly better, "base name"
instead?) exactly matches one of the elements in the given list"? Do you
really mean that a file name matching two regexps is _not_ going to be
included?

Note that I know writing documentation is tedious; I don't want to sound
negative or boring.

Regards,




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 11:51:02 GMT) Full text and rfc822 format available.

Message #85 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Tobias Geerinckx-Rice <me <at> tobias.gr>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 12:50:36 +0100
[Message part 1 (text/plain, inline)]
Pierre,

Nicolas Goaziou 写道:
> Moreover, the indentation is very odd there, compared to the 
> rest of
> "guix.texi". You may want to normalize it.

More than just odd, unfortunately.  It broke ‘guix pull’ on 
master:

[Message part 2 (text/plain, inline)]
./guix.de.texi:6631: warning: @end should only appear at the 
beginning of a line
./guix.de.texi:6635: warning: @itemize should only appear at the 
beginning of a line
./guix.de.texi:6635: warning: @item should not appear in @itemize
./guix.de.texi:6635: @item outside of table or list
./guix.de.texi:6639: warning: @itemize should only appear at the 
beginning of a line
./guix.de.texi:6639: warning: @item should not appear in @itemize
./guix.de.texi:6639: @item outside of table or list
./guix.de.texi:6647: warning: @end should only appear at the 
beginning of a line
./guix.de.texi:6648: superfluous argument to @end itemize:  In all 
cases, the paths relative to @var{source} are>
Backtrace:
          3 (primitive-load 
          "/gnu/store/qsd0khinmy748z6aq23ck8lcaxr?")
In ice-9/eval.scm:
   619:8  2 (_ #f)
In ice-9/boot-9.scm:
  260:13  1 (for-each #<procedure 7ffff4f4f2a0 at 
  ice-9/eval.scm:3?> ?)
In guix/build/utils.scm:
   652:6  0 (invoke _ . _)

guix/build/utils.scm:652:6: In procedure invoke:
ERROR:
 1. &invoke-error:
     program: 
     "/gnu/store/irj21yhgls637jhhkb5yr79s76c96maq-texinfo-6.6/bin/makeinfo"
     arguments: ("./guix.de.texi" "-I" 
     "/gnu/store/ygairf8pckyzl1aplf0jxmbzr9gnhjik-doc" "-I" "." 
     "-o" "/gnu/st>
     exit-status: 1
     term-signal: #f
     stop-signal: #f
[Message part 3 (text/plain, inline)]
I removed *all* leading whitespace in 
af51d01a8aa8d7cf529173bdb64392f14eb21962 and this fixes the 
problem.  In future, avoid it altogether.  It clashes with the 
rest of the file even when it doesn't break anything.

If you're using some kind of fancy-texinfo-mode please disable it, 
although I wonder who writes a mode that breaks things so badly 
:-p

Kind regards,

T G-R
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 12:05:01 GMT) Full text and rfc822 format available.

Message #88 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Cc: Julien Lepiller <julien <at> lepiller.eu>, Alex Griffin <a <at> ajgrf.com>,
 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 13:04:15 +0100
[Message part 1 (text/plain, inline)]
Nicolas Goaziou <mail <at> nicolasgoaziou.fr> writes:

> Pierre Neidhardt <mail <at> ambrevar.xyz> writes:
>
>> Oh, yes, I see that.  I thought it would help with readability.  How are
>> we supposed to visualize nested @itemize at the moment?
>
> I don't think there's a clear answer, but, IMO, for readability sake, we
> should not (ab)use nested lists in a manual. 
>
> There are three levels of such lists here. I think this is not
> necessary. For example
>
> --8<---------------cut here---------------start------------->8---
> @item When @var{source} matches a file or directory without trailing slash, install it to @var{target}.
>   @itemize
>   @item If @var{target} has a trailing slash, install @var{source} basename beneath @var{target}.
>   @item Otherwise install @var{source} as @var{target}.
>   @end itemize
> --8<---------------cut here---------------end--------------->8---
>
> could be written as, e.g.,
>
> --8<---------------cut here---------------start------------->8---
> @item
> When @var{source} matches a file or directory without a trailing slash,
> install it to @var{target}.  More accurately, if @var{target} ends with
> a slash, install @var{source} basename beneath @var{target} directory.
> Otherwise install @var{source} as @var{target}.
> --8<---------------cut here---------------end--------------->8---

Fair enough.
The idea behind the items was to structure it like a spec that would
easily translate to code then.
(I wrote these specs before writing the code.)

> Similarly, instead of discussing about #:include and al. in a nested
> list, this could happen in a subsequent paragraph, once "source" and
> "target" are clarified, i.e., after "In all cases, the paths (BTW,
> shouldn't it be "file names"?)

I don't know.  In my opinion, "file names" is often interpreted as "base
names".  Here I mean that the full subpath of the file is preserved.
May I should use "subpath" then.

> As a side note, are you sure about: "With @code{#:include}, install all
> the files which (I would use "whose" here, but I'm not a native
> speaker)

https://en.wikipedia.org/wiki/Inanimate_whose

Actually, should be "which the" or "the files the path of which".
But all this is very pedantic :)

> path suffix (isn't it "basename" or, possibly better, "base name"
> instead?)

No, it really is "path suffix" here because it matches against the
parent directories, e.g. "foo/bar" is a valid suffix.

> exactly matches one of the elements in the given list"? Do you
> really mean that a file name matching two regexps is _not_ going to be
> included?

Indeed, that's a mistake!  Thanks!.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 12:07:02 GMT) Full text and rfc822 format available.

Message #91 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Tobias Geerinckx-Rice <me <at> tobias.gr>, 39599 <at> debbugs.gnu.org
Subject: Re: [bug#39599] [PATCH 1/4] build-system: Add copy-build-system.
Date: Fri, 21 Feb 2020 13:06:13 +0100
[Message part 1 (text/plain, inline)]
Tobias Geerinckx-Rice <me <at> tobias.gr> writes:

> I removed *all* leading whitespace in 
> af51d01a8aa8d7cf529173bdb64392f14eb21962 and this fixes the 
> problem.  In future, avoid it altogether.  It clashes with the 
> rest of the file even when it doesn't break anything.

Thanks for the fix.

> If you're using some kind of fancy-texinfo-mode please disable it, 
> although I wonder who writes a mode that breaks things so badly 
> :-p

I don't, I just indented manually.  It was impossible to read otherwise.
Well, Texinfo is a bit tedious, I guess we have to leave with it.

Crazy that "guix pull" broke and not "make".  I wonder why "guix pull"
is so sensitive.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 14:35:02 GMT) Full text and rfc822 format available.

Message #94 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: "Alex Griffin" <a <at> ajgrf.com>
To: "Jack Hill" <jackhill <at> jackhill.us>, 39599 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Add gnome-shell-extension-paperwm.
Date: Fri, 21 Feb 2020 14:34:08 +0000
Jack,

Thank you, I just committed your improvements with some slight modifications!

I had noticed the issue and intended to fix it myself, but after stepping away from my computer for a while, I must have forgotten about it and sent my patch too early.

-- 
Alex Griffin




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 16:23:02 GMT) Full text and rfc822 format available.

Message #97 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Alex Griffin <a <at> ajgrf.com>
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Add gnome-shell-extension-paperwm.
Date: Fri, 21 Feb 2020 11:22:35 -0500 (EST)
Alex,

On Fri, 21 Feb 2020, Alex Griffin wrote:

> Thank you, I just committed your improvements with some slight 
> modifications!

Thanks for the improvements. However, I don't think this change was 
warranted:

-          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
-                            "\\.xml$" "\\.compiled$")))))
+          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$" "\\.xml$")))

I think we still want to install the gschemas.compiled file that build in 
the new compile-schemas phase.

> I had noticed the issue and intended to fix it myself, but after 
> stepping away from my computer for a while, I must have forgotten about 
> it and sent my patch too early.

No worries, I'm happy to serve as a second set of eyes.

Best,
Jack




Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 18:50:02 GMT) Full text and rfc822 format available.

Message #100 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: "Alex Griffin" <a <at> ajgrf.com>
To: "Jack Hill" <jackhill <at> jackhill.us>
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Add gnome-shell-extension-paperwm.
Date: Fri, 21 Feb 2020 18:48:46 +0000
On Fri, Feb 21, 2020, at 4:22 PM, Jack Hill wrote:
> Thanks for the improvements. However, I don't think this change was 
> warranted:
> 
> -          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
> -                            "\\.xml$" "\\.compiled$")))))
> +          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$" 
> "\\.xml$")))
> 
> I think we still want to install the gschemas.compiled file that build in 
> the new compile-schemas phase.

You're right of course. I just committed the fix.

-- 
Alex Griffin





Information forwarded to guix-patches <at> gnu.org:
bug#39599; Package guix-patches. (Fri, 21 Feb 2020 18:53:01 GMT) Full text and rfc822 format available.

Message #103 received at 39599 <at> debbugs.gnu.org (full text, mbox):

From: Jack Hill <jackhill <at> jackhill.us>
To: Alex Griffin <a <at> ajgrf.com>
Cc: 39599 <at> debbugs.gnu.org
Subject: Re: [PATCH v2] gnu: Add gnome-shell-extension-paperwm.
Date: Fri, 21 Feb 2020 13:51:54 -0500 (EST)
On Fri, 21 Feb 2020, Alex Griffin wrote:

> On Fri, Feb 21, 2020, at 4:22 PM, Jack Hill wrote:
>> Thanks for the improvements. However, I don't think this change was
>> warranted:
>>
>> -          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
>> -                            "\\.xml$" "\\.compiled$")))))
>> +          #:include-regexp ("\\.js(on)?$" "\\.css$" "\\.ui$" "\\.png$"
>> "\\.xml$")))
>>
>> I think we still want to install the gschemas.compiled file that build in
>> the new compile-schemas phase.
>
> You're right of course. I just committed the fix.

Awesome, thanks!




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 21 Mar 2020 11:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 7 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.