From: Bruno Victal <mirai@makinata.eu>
To: 66500@debbugs.gnu.org
Cc: Bruno Victal <mirai@makinata.eu>
Subject: [bug#66500] [PATCH core-updates 1/3] build: copy-build-system: Allow specifying different output labels.
Date: Thu, 12 Oct 2023 16:30:00 +0100 [thread overview]
Message-ID: <b486734d4ac6f5247d216da3444d91acb7e2ebd1.1697124046.git.mirai@makinata.eu> (raw)
In-Reply-To: <cover.1697124046.git.mirai@makinata.eu>
* 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@lepiller.eu>
;;; Copyright © 2020 Pierre Neidhardt <mail@ambrevar.xyz>
;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2023 Bruno Victal <mirai@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
next prev parent reply other threads:[~2023-10-12 15:31 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-12 15:27 [bug#66500] [PATCH core-updates 0/3] Custom output labels for copy-build-system Bruno Victal
2023-10-12 15:30 ` Bruno Victal [this message]
2023-10-19 9:46 ` [bug#66500] [PATCH core-updates 1/3] build: copy-build-system: Allow specifying different output labels Liliana Marie Prikler
2023-10-19 15:36 ` Bruno Victal
2023-10-12 15:30 ` [bug#66500] [PATCH core-updates 2/3] gnu: docbook-dsssl: Refactor install-plan Bruno Victal
2023-10-19 9:47 ` Liliana Marie Prikler
2023-10-19 15:25 ` Bruno Victal
2023-10-12 15:30 ` [bug#66500] [PATCH core-updates 3/3] gnu: docbook-dsssl: Fix script installation path Bruno Victal
2023-10-19 15:37 ` [bug#66500] [PATCH core-updates v2 0/3] Custom output labels for copy-build-system Bruno Victal
2023-10-19 15:38 ` [bug#66500] [PATCH core-updates v2 1/3] build: copy-build-system: Allow specifying different output labels Bruno Victal
2023-10-19 15:38 ` [bug#66500] [PATCH core-updates v2 2/3] gnu: docbook-dsssl: Refactor install-plan Bruno Victal
2023-10-19 15:38 ` [bug#66500] [PATCH core-updates v2 3/3] gnu: docbook-dsssl: Fix script installation path Bruno Victal
2023-12-20 21:10 ` bug#66500: [PATCH core-updates v2 0/3] Custom output labels for copy-build-system Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b486734d4ac6f5247d216da3444d91acb7e2ebd1.1697124046.git.mirai@makinata.eu \
--to=mirai@makinata.eu \
--cc=66500@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.