GNU bug report logs - #66500
[PATCH core-updates 0/3] Custom output labels for copy-build-system.

Previous Next

Package: guix-patches;

Reported by: Bruno Victal <mirai <at> makinata.eu>

Date: Thu, 12 Oct 2023 15:29:02 UTC

Severity: normal

Tags: patch

Done: Ludovic Courtès <ludo <at> gnu.org>

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 66500 in the body.
You can then email your comments to 66500 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#66500; Package guix-patches. (Thu, 12 Oct 2023 15:29:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Bruno Victal <mirai <at> makinata.eu>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 12 Oct 2023 15:29:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: guix-patches <at> gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates 0/3] Custom output labels for copy-build-system.
Date: Thu, 12 Oct 2023 16:27:11 +0100
This patch-series implements a `#:output' parameter for the rules within
a install-plan used by the copy-build-system which can be used to
selectively install some files into different outputs.

For demonstration purposes the docbook-dsssl package was refactored to
make use of this new feature, with a bonus patch that fixes an
inconsistency in the same package that was caught while testing.


Bruno Victal (3):
  build: copy-build-system: Allow specifying different output labels.
  gnu: docbook-dsssl: Refactor install-plan.
  gnu: docbook-dsssl: Fix script installation path.

 doc/guix.texi                    |  6 ++++++
 gnu/packages/docbook.scm         | 31 ++++++++++++++-----------------
 guix/build/copy-build-system.scm | 18 +++++++++++++-----
 3 files changed, 33 insertions(+), 22 deletions(-)


base-commit: 651265562bf6fea52c49596f9fb8ec380e5f0022
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 12 Oct 2023 15:31:01 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates 3/3] gnu: docbook-dsssl: Fix script installation
 path.
Date: Thu, 12 Oct 2023 16:30:02 +0100
* gnu/packages/docbook.scm (docbook-dsssl)[source]: Fix script permission.
[arguments]<#:install-plan>: Install script and manpage correctly.
[inputs]: Add perl.
---
 gnu/packages/docbook.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 07cb06059a..9445c86157 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -516,6 +516,7 @@ (define-public docbook-dsssl
                 "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))
               (snippet
                #~(begin
+                   (chmod "bin/collateindex.pl" #o755)
                    ;; Remove empty directories.
                    (rmdir "doc")
                    (rmdir "docsrc")))))
@@ -524,10 +525,12 @@ (define-public docbook-dsssl
     (arguments
      (list
       #:install-plan
-      #~`(("./" "sgml/dtd/docbook/")
+      #~`(("./" "sgml/dtd/docbook/" #:exclude ("bin"))
+          ("bin/collateindex.pl" "bin/")
+          ("bin/collateindex.pl.1" "share/man/man1/")
           (#$(this-package-input "docbook-dsssl-doc") "./" #:output "doc"))))
     (inputs
-     (list docbook-dsssl-doc))
+     (list perl docbook-dsssl-doc))
     (home-page "https://docbook.org/")
     (synopsis "DSSSL style sheets for DocBook")
     (description "This package provides DSSSL style sheets for DocBook.")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 12 Oct 2023 15:32:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates 1/3] build: copy-build-system: Allow specifying
 different output labels.
Date: Thu, 12 Oct 2023 16:30:00 +0100
* guix/build/copy-build-system.scm: Introduce '#:output' parameter to specify
which output label to use for a given rule.
* doc/guix.texi (Build Systems): Document it.
---
 doc/guix.texi                    |  6 ++++++
 guix/build/copy-build-system.scm | 18 +++++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4afe1af6c0..8e627912a0 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9460,6 +9460,9 @@ Build Systems
 If both inclusions and exclusions are specified, the exclusions are done
 on top of the inclusions.
 @end itemize
+@item When a package has multiple outputs the @code{#:output} argument
+can be used to specify which output label the files should be installed
+to.
 @end itemize
 In all cases, the paths relative to @var{source} are preserved within
 @var{target}.
@@ -9476,6 +9479,9 @@ Build Systems
 @file{share/my-app/sub/file}.
 @item @code{("foo/sub" "share/my-app" #:include ("file"))}: Install @file{foo/sub/file} to
 @file{share/my-app/file}.
+@item @code{("foo/doc" "share/my-app/doc" #:output "doc")}: Install
+@file{"foo/doc"} to @file{"share/my-app/doc"} for output labelled
+@code{"doc"}.
 @end itemize
 @end defvar
 
diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm
index fb2d1db056..152cf88224 100644
--- a/guix/build/copy-build-system.scm
+++ b/guix/build/copy-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
 ;;; Copyright © 2021 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,9 +41,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
 
 An install plan is a list of plans in the form:
 
-  (SOURCE TARGET [FILTERS])
+  (SOURCE TARGET [FILTERS] [#:output OUTPUT])
 
-In the above, FILTERS are optional.
+In the above, FILTERS and OUTPUT are optional.
 
 - When SOURCE matches a file or directory without trailing slash, install it to
   TARGET.
@@ -63,6 +64,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
       If both `#:include*` and `#:exclude*` are specified, the exclusion is done
       on the inclusion list.
 
+- When a package has multiple outputs the `#:output` argument can be used
+to specify which output label the files should be installed to.
+
 Examples:
 
 - `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-app/bar\".
@@ -72,7 +76,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
 - `(\"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\"."
+\"share/my-app/file\".
+- `(\"foo/doc\" \"share/my-app/doc\" #:output \"doc\")`: Install \"foo/doc\" to
+\"share/my-app/doc\" for output labelled \"doc\"."
   (define (install-simple source target)
     "Install SOURCE to TARGET.
 TARGET must point to a store location.
@@ -133,8 +139,10 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
                                       (string-append target "/")))
              file-list))))
 
-  (define* (install source target #:key include exclude include-regexp exclude-regexp)
-    (let ((final-target (string-append (assoc-ref outputs "out") "/" target))
+  (define* (install source target
+                    #:key include exclude include-regexp exclude-regexp
+                    (output "out"))
+    (let ((final-target (string-append (assoc-ref outputs output) "/" target))
           (filters? (or include exclude include-regexp exclude-regexp)))
       (when (and (not (file-is-directory? source))
                  filters?)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 12 Oct 2023 15:32:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates 2/3] gnu: docbook-dsssl: Refactor install-plan.
Date: Thu, 12 Oct 2023 16:30:01 +0100
Replace custom phase with copy-build-system newly added #:output parameter.
Additionally remove extra slashes from license URIs and obsolete inputs.

* gnu/packages/docbook.scm (docbook-dsssl)[source]: Remove empty directories
from source using a snippet.
[arguments]<#:phases>: Relocate 'install-doc logic into …
<#:install-plan>: … here. Remove obsolete exclusion rules.
[native-inputs]: Remove bzip2 and tar since these are already available by
default.
[license]: Remove extraneous slash.
(docbook-dsssl-doc)[license]: Remove extraneous slash.
---
 gnu/packages/docbook.scm | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index f7dff53808..07cb06059a 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -513,31 +513,25 @@ (define-public docbook-dsssl
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))))
+                "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))
+              (snippet
+               #~(begin
+                   ;; Remove empty directories.
+                   (rmdir "doc")
+                   (rmdir "docsrc")))))
     (build-system copy-build-system)
     (outputs '("out" "doc"))
     (arguments
      (list
       #:install-plan
-      #~`(("./" "sgml/dtd/docbook/"
-           #:exclude ("doc" "docsrc")))
-      #:phases
-      #~(modify-phases %standard-phases
-          ;; The doc output contains 1.4 MiB of HTML documentation.
-          (add-after 'install 'install-doc
-            (lambda* (#:key inputs #:allow-other-keys)
-              (mkdir-p (string-append #$output:doc "/share/doc"))
-              (symlink (assoc-ref inputs "docbook-dsssl-doc")
-                       (format #f "~a/share/doc/~a-~a"
-                               #$output:doc #$name #$version)))))))
+      #~`(("./" "sgml/dtd/docbook/")
+          (#$(this-package-input "docbook-dsssl-doc") "./" #:output "doc"))))
     (inputs
      (list docbook-dsssl-doc))
-    (native-inputs
-     (list bzip2 tar))
     (home-page "https://docbook.org/")
     (synopsis "DSSSL style sheets for DocBook")
     (description "This package provides DSSSL style sheets for DocBook.")
-    (license (license:non-copyleft "file://README"))))
+    (license (license:non-copyleft "file:/README"))))
 
 ;;; Private variable, used as the 'doc' output of the docbook-dsssl package.
 (define docbook-dsssl-doc
@@ -560,7 +554,7 @@ (define docbook-dsssl-doc
     (home-page "https://docbook.org/")
     (synopsis "DocBook DSSSL style sheets documentation")
     (description "Documentation for the DocBook DSSSL style sheets.")
-    (license (license:non-copyleft "file://doc/LEGALNOTICE.htm"))))
+    (license (license:non-copyleft "file:/doc/LEGALNOTICE.htm"))))
 
 (define-public docbook-sgml-4.2
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 09:47:02 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>, 66500 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates 1/3] build: copy-build-system: Allow
 specifying different output labels.
Date: Thu, 19 Oct 2023 11:46:07 +0200
Hi Bruno,

Am Donnerstag, dem 12.10.2023 um 16:30 +0100 schrieb Bruno Victal:
> [...]
> +@item When a package has multiple outputs the @code{#:output}
> argument
> +can be used to specify which output label the files should be
> installed
> +to.
This is perhaps extremely nitpicky, but there should be a comma before
"the @code{#:output} argument".

> @@ -63,6 +64,9 @@ (define* (install #:key install-plan outputs
> #:allow-other-keys)
>        If both `#:include*` and `#:exclude*` are specified, the
> exclusion is done
>        on the inclusion list.
>  
> +- When a package has multiple outputs the `#:output` argument can be
> used
> +to specify which output label the files should be installed to.
> +
Same here.
>  Examples:
>  
>  - `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-
> app/bar\".
> @@ -72,7 +76,9 @@ (define* (install #:key install-plan outputs
> #:allow-other-keys)
>  - `(\"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\"."
> +\"share/my-app/file\".
> +- `(\"foo/doc\" \"share/my-app/doc\" #:output \"doc\")`: Install
> \"foo/doc\" to
> +\"share/my-app/doc\" for output labelled \"doc\"."
s/for output labelled/within the output named/
or 
s/for output labelled \"doc\"/within the \"doc\" output/

>    (define (install-simple source target)
>      "Install SOURCE to TARGET.
>  TARGET must point to a store location.
> @@ -133,8 +139,10 @@ (define* (install #:key install-plan outputs
> #:allow-other-keys)
>                                        (string-append target "/")))
>               file-list))))
>  
> -  (define* (install source target #:key include exclude include-
> regexp exclude-regexp)
> -    (let ((final-target (string-append (assoc-ref outputs "out") "/"
> target))
> +  (define* (install source target
> +                    #:key include exclude include-regexp exclude-
> regexp
> +                    (output "out"))
> +    (let ((final-target (string-append (assoc-ref outputs output)
> "/" target))
>            (filters? (or include exclude include-regexp exclude-
> regexp)))
>        (when (and (not (file-is-directory? source))
>                   filters?)
Otherwise LGTM.  Note, however, that CI doesn't like this series.

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 09:49:01 GMT) Full text and rfc822 format available.

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

From: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
To: Bruno Victal <mirai <at> makinata.eu>, 66500 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates 2/3] gnu: docbook-dsssl: Refactor
 install-plan.
Date: Thu, 19 Oct 2023 11:47:43 +0200
Am Donnerstag, dem 12.10.2023 um 16:30 +0100 schrieb Bruno Victal:
> Replace custom phase with copy-build-system newly added #:output
> parameter.
> Additionally remove extra slashes from license URIs and obsolete
> inputs.
> 
> * gnu/packages/docbook.scm (docbook-dsssl)[source]: Remove empty
> directories from source using a snippet.
> [arguments]<#:phases>: Relocate 'install-doc logic into …
> <#:install-plan>: … here. Remove obsolete exclusion rules.
> [native-inputs]: Remove bzip2 and tar since these are already
> available by default.
> [license]: Remove extraneous slash.
> (docbook-dsssl-doc)[license]: Remove extraneous slash.
> ---
Are these extraneous slash removals really improving anything?  I
personally type file URIs with three slashes, but that's outside the
Guix context.

Cheers




Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:27:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 66500 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates 2/3] gnu: docbook-dsssl: Refactor
 install-plan.
Date: Thu, 19 Oct 2023 16:25:48 +0100
On 2023-10-19 10:47, Liliana Marie Prikler wrote:
> Are these extraneous slash removals really improving anything?  I
> personally type file URIs with three slashes, but that's outside the
> Guix context.

It's mostly semantical improvements as I've explained in the
(unrelated) 1d07acb5f440cb3205b2336a213163ca4584d4f6 commit message [1].

Save for applications with broken or outdated URI handling (which would
be a bug), the single slash URIs work just the same as before.


[1]: <https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=1d07acb5f440cb3205b2336a213163ca4584d4f6>

-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.




Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:39:01 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>,
 Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Subject: [PATCH core-updates v2 0/3] Custom output labels for
 copy-build-system.
Date: Thu, 19 Oct 2023 16:37:26 +0100
Notable changes since v1:
* Address documentation feedback.
* Rebased to solve potential merge conflicts.

Bruno Victal (3):
  build: copy-build-system: Allow specifying different output labels.
  gnu: docbook-dsssl: Refactor install-plan.
  gnu: docbook-dsssl: Fix script installation path.

 doc/guix.texi                    |  6 ++++++
 gnu/packages/docbook.scm         | 31 ++++++++++++++-----------------
 guix/build/copy-build-system.scm | 18 +++++++++++++-----
 3 files changed, 33 insertions(+), 22 deletions(-)


base-commit: d59653b7c9e43ebdbba20e2ca071429507f94c67
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:39:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates v2 2/3] gnu: docbook-dsssl: Refactor install-plan.
Date: Thu, 19 Oct 2023 16:38:19 +0100
Replace custom phase with copy-build-system newly added #:output parameter.
Additionally remove extra slashes from license URIs and obsolete inputs.

* gnu/packages/docbook.scm (docbook-dsssl)[source]: Remove empty directories
from source using a snippet.
[arguments]<#:phases>: Relocate 'install-doc logic into …
<#:install-plan>: … here. Remove obsolete exclusion rules.
[native-inputs]: Remove bzip2 and tar since these are already available by
default.
[license]: Remove extraneous slash.
(docbook-dsssl-doc)[license]: Remove extraneous slash.
---
 gnu/packages/docbook.scm | 26 ++++++++++----------------
 1 file changed, 10 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index f7dff53808..07cb06059a 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -513,31 +513,25 @@ (define-public docbook-dsssl
                                   name "-" version ".tar.bz2"))
               (sha256
                (base32
-                "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))))
+                "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))
+              (snippet
+               #~(begin
+                   ;; Remove empty directories.
+                   (rmdir "doc")
+                   (rmdir "docsrc")))))
     (build-system copy-build-system)
     (outputs '("out" "doc"))
     (arguments
      (list
       #:install-plan
-      #~`(("./" "sgml/dtd/docbook/"
-           #:exclude ("doc" "docsrc")))
-      #:phases
-      #~(modify-phases %standard-phases
-          ;; The doc output contains 1.4 MiB of HTML documentation.
-          (add-after 'install 'install-doc
-            (lambda* (#:key inputs #:allow-other-keys)
-              (mkdir-p (string-append #$output:doc "/share/doc"))
-              (symlink (assoc-ref inputs "docbook-dsssl-doc")
-                       (format #f "~a/share/doc/~a-~a"
-                               #$output:doc #$name #$version)))))))
+      #~`(("./" "sgml/dtd/docbook/")
+          (#$(this-package-input "docbook-dsssl-doc") "./" #:output "doc"))))
     (inputs
      (list docbook-dsssl-doc))
-    (native-inputs
-     (list bzip2 tar))
     (home-page "https://docbook.org/")
     (synopsis "DSSSL style sheets for DocBook")
     (description "This package provides DSSSL style sheets for DocBook.")
-    (license (license:non-copyleft "file://README"))))
+    (license (license:non-copyleft "file:/README"))))
 
 ;;; Private variable, used as the 'doc' output of the docbook-dsssl package.
 (define docbook-dsssl-doc
@@ -560,7 +554,7 @@ (define docbook-dsssl-doc
     (home-page "https://docbook.org/")
     (synopsis "DocBook DSSSL style sheets documentation")
     (description "Documentation for the DocBook DSSSL style sheets.")
-    (license (license:non-copyleft "file://doc/LEGALNOTICE.htm"))))
+    (license (license:non-copyleft "file:/doc/LEGALNOTICE.htm"))))
 
 (define-public docbook-sgml-4.2
   (package
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:40:01 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates v2 1/3] build: copy-build-system: Allow
 specifying different output labels.
Date: Thu, 19 Oct 2023 16:38:18 +0100
* guix/build/copy-build-system.scm: Introduce '#:output' parameter to specify
which output label to use for a given rule.
* doc/guix.texi (Build Systems): Document it.
---
 doc/guix.texi                    |  6 ++++++
 guix/build/copy-build-system.scm | 18 +++++++++++++-----
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 4afe1af6c0..4f6c4ce67a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9460,6 +9460,9 @@ Build Systems
 If both inclusions and exclusions are specified, the exclusions are done
 on top of the inclusions.
 @end itemize
+@item When a package has multiple outputs, the @code{#:output} argument
+can be used to specify which output label the files should be installed
+to.
 @end itemize
 In all cases, the paths relative to @var{source} are preserved within
 @var{target}.
@@ -9476,6 +9479,9 @@ Build Systems
 @file{share/my-app/sub/file}.
 @item @code{("foo/sub" "share/my-app" #:include ("file"))}: Install @file{foo/sub/file} to
 @file{share/my-app/file}.
+@item @code{("foo/doc" "share/my-app/doc" #:output "doc")}: Install
+@file{"foo/doc"} to @file{"share/my-app/doc"} within the @code{"doc"}
+output.
 @end itemize
 @end defvar
 
diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm
index fb2d1db056..25d3f4c57a 100644
--- a/guix/build/copy-build-system.scm
+++ b/guix/build/copy-build-system.scm
@@ -2,6 +2,7 @@
 ;;; Copyright © 2019 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2020 Pierre Neidhardt <mail <at> ambrevar.xyz>
 ;;; Copyright © 2021 Efraim Flashner <efraim <at> flashner.co.il>
+;;; Copyright © 2023 Bruno Victal <mirai <at> makinata.eu>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -40,9 +41,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
 
 An install plan is a list of plans in the form:
 
-  (SOURCE TARGET [FILTERS])
+  (SOURCE TARGET [FILTERS] [#:output OUTPUT])
 
-In the above, FILTERS are optional.
+In the above, FILTERS and OUTPUT are optional.
 
 - When SOURCE matches a file or directory without trailing slash, install it to
   TARGET.
@@ -63,6 +64,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
       If both `#:include*` and `#:exclude*` are specified, the exclusion is done
       on the inclusion list.
 
+- When a package has multiple outputs, the `#:output` argument can be used
+to specify which output label the files should be installed to.
+
 Examples:
 
 - `(\"foo/bar\" \"share/my-app/\")`: Install bar to \"share/my-app/bar\".
@@ -72,7 +76,9 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
 - `(\"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\"."
+\"share/my-app/file\".
+- `(\"foo/doc\" \"share/my-app/doc\" #:output \"doc\")`: Install \"foo/doc\" to
+\"share/my-app/doc\" within the \"doc\" output."
   (define (install-simple source target)
     "Install SOURCE to TARGET.
 TARGET must point to a store location.
@@ -133,8 +139,10 @@ (define* (install #:key install-plan outputs #:allow-other-keys)
                                       (string-append target "/")))
              file-list))))
 
-  (define* (install source target #:key include exclude include-regexp exclude-regexp)
-    (let ((final-target (string-append (assoc-ref outputs "out") "/" target))
+  (define* (install source target
+                    #:key include exclude include-regexp exclude-regexp
+                    (output "out"))
+    (let ((final-target (string-append (assoc-ref outputs output) "/" target))
           (filters? (or include exclude include-regexp exclude-regexp)))
       (when (and (not (file-is-directory? source))
                  filters?)
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:47:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: 66500 <at> debbugs.gnu.org
Cc: Bruno Victal <mirai <at> makinata.eu>
Subject: [PATCH core-updates v2 3/3] gnu: docbook-dsssl: Fix script
 installation path.
Date: Thu, 19 Oct 2023 16:38:20 +0100
* gnu/packages/docbook.scm (docbook-dsssl)[source]: Fix script permission.
[arguments]<#:install-plan>: Install script and manpage correctly.
[inputs]: Add perl.
---
 gnu/packages/docbook.scm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/docbook.scm b/gnu/packages/docbook.scm
index 07cb06059a..9445c86157 100644
--- a/gnu/packages/docbook.scm
+++ b/gnu/packages/docbook.scm
@@ -516,6 +516,7 @@ (define-public docbook-dsssl
                 "1g72y2yyc2k89kzs0lvrb9n7hjayw1hdskfpplpz97pf1c99wcig"))
               (snippet
                #~(begin
+                   (chmod "bin/collateindex.pl" #o755)
                    ;; Remove empty directories.
                    (rmdir "doc")
                    (rmdir "docsrc")))))
@@ -524,10 +525,12 @@ (define-public docbook-dsssl
     (arguments
      (list
       #:install-plan
-      #~`(("./" "sgml/dtd/docbook/")
+      #~`(("./" "sgml/dtd/docbook/" #:exclude ("bin"))
+          ("bin/collateindex.pl" "bin/")
+          ("bin/collateindex.pl.1" "share/man/man1/")
           (#$(this-package-input "docbook-dsssl-doc") "./" #:output "doc"))))
     (inputs
-     (list docbook-dsssl-doc))
+     (list perl docbook-dsssl-doc))
     (home-page "https://docbook.org/")
     (synopsis "DSSSL style sheets for DocBook")
     (description "This package provides DSSSL style sheets for DocBook.")
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#66500; Package guix-patches. (Thu, 19 Oct 2023 15:52:02 GMT) Full text and rfc822 format available.

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

From: Bruno Victal <mirai <at> makinata.eu>
To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>
Cc: 66500 <at> debbugs.gnu.org
Subject: Re: [PATCH core-updates 1/3] build: copy-build-system: Allow
 specifying different output labels.
Date: Thu, 19 Oct 2023 16:36:03 +0100
Hi Liliana,

On 2023-10-19 10:46, Liliana Marie Prikler wrote:
> This is perhaps extremely nitpicky, but there should be a comma before
> "the @code{#:output} argument".

Addressing this with v2.

> s/for output labelled/within the output named/
> or 
> s/for output labelled \"doc\"/within the \"doc\" output/

Likewise, went for the second choice here.

> Otherwise LGTM.  Note, however, that CI doesn't like this series.

Strange, the CI complains of a merge conflict yet I didn't encounter
any issues when rebasing this to the latest core-updates [1].


[1]: guix commit d59653b7c9e43ebdbba20e2ca071429507f94c67

-- 
Furthermore, I consider that nonfree software must be eradicated.

Cheers,
Bruno.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Wed, 20 Dec 2023 21:11:02 GMT) Full text and rfc822 format available.

Notification sent to Bruno Victal <mirai <at> makinata.eu>:
bug acknowledged by developer. (Wed, 20 Dec 2023 21:11:02 GMT) Full text and rfc822 format available.

Message #43 received at 66500-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bruno Victal <mirai <at> makinata.eu>
Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>,
 66500-done <at> debbugs.gnu.org
Subject: Re: [bug#66500] [PATCH core-updates v2 0/3] Custom output labels
 for copy-build-system.
Date: Wed, 20 Dec 2023 22:10:35 +0100
Hi Bruno,

Bruno Victal <mirai <at> makinata.eu> skribis:

>   build: copy-build-system: Allow specifying different output labels.
>   gnu: docbook-dsssl: Refactor install-plan.
>   gnu: docbook-dsssl: Fix script installation path.

Applied, thanks!

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 18 Jan 2024 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 112 days ago.

Previous Next


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