[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/07: build: copy-build-system: Allow specifying different output label
From: |
guix-commits |
Subject: |
01/07: build: copy-build-system: Allow specifying different output labels. |
Date: |
Wed, 20 Dec 2023 16:30:09 -0500 (EST) |
civodul pushed a commit to branch core-updates
in repository guix.
commit 9ee269bae481de99d11225a3ec85efc019bdd569
Author: Bruno Victal <mirai@makinata.eu>
AuthorDate: Thu Oct 19 16:38:18 2023 +0100
build: copy-build-system: Allow specifying different output labels.
* 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.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
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 a39b9422db..cd4a871fc8 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -9450,6 +9450,9 @@ install all files but those matching the exclusion
filters.
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}.
@@ -9466,6 +9469,9 @@ e.g., install @file{foo/sub/file} to
@file{share/my-app/sub/file}.
@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@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 @@
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 @@ In the above, FILTERS are optional.
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 @@ Examples:
- `(\"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 @@ given, then the predicate always returns DEFAULT-VALUE."
(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?)
- branch core-updates updated (ce47c368b7 -> 4cdda6314c), guix-commits, 2023/12/20
- 04/07: gnu: xorgproto: Update to 2023.2., guix-commits, 2023/12/20
- 05/07: gnu: xorg-server-xwayland: Update to 23.2.3., guix-commits, 2023/12/20
- 02/07: gnu: docbook-dsssl: Refactor install-plan., guix-commits, 2023/12/20
- 06/07: gnu: flac: Update to 1.4.3., guix-commits, 2023/12/20
- 03/07: gnu: docbook-dsssl: Fix script installation path., guix-commits, 2023/12/20
- 07/07: gnu: libwebp: Ungraft., guix-commits, 2023/12/20
- 01/07: build: copy-build-system: Allow specifying different output labels.,
guix-commits <=