From 522732d5c15e44fc9e061f36a41f7129edfee66f Mon Sep 17 00:00:00 2001 From: Greg Hogan Date: Fri, 22 Nov 2024 14:29:39 +0000 Subject: packages: 'package-input-rewriting/spec' optionally replace hidden. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit eee95b5a879b7096dffd533f24107cf8926b621e changed package rewriting to ignore hidden packages. This patch permits the previous use by adding an option to rewrite hidden packages. * guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is hidden, return it as-is unless #:replace-hidden? has been enabled. * tests/packages.scm ("package-input-rewriting/spec, replace hidden package"): New test. * doc/guix.texi (Defining Package Variants): Update. Change-Id: I0a7988cac70e0c6b88b0fe6e27c1036fa723e030 Signed-off-by: Ludovic Courtès --- doc/guix.texi | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/guix.texi b/doc/guix.texi index 0d461fb96a..8a6640124c 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -7277,7 +7277,8 @@ build} (@pxref{Additional Build Options, @option{--expression} in @command{guix build}}). @item --file=@var{file} -build a pack the code within @var{file} evaluates to. +Build a pack containing the package or other object the code within +@var{file} evaluates to. This has the same purpose as the same-named option in @command{guix build} (@pxref{Additional Build Options, @option{--file} in @@ -8679,7 +8680,8 @@ This is exactly what the @option{--with-input} command-line option does The following variant of @code{package-input-rewriting} can match packages to be replaced by name rather than by identity. -@deffn {Procedure} package-input-rewriting/spec @var{replacements} [#:deep? #t] +@deffn {Procedure} package-input-rewriting/spec @var{replacements} @ + [#:deep? #t] [#:replace-hidden? #t] Return a procedure that, given a package, applies the given @var{replacements} to all the package graph, including implicit inputs unless @var{deep?} is false. @@ -8688,7 +8690,7 @@ unless @var{deep?} is false. package specification such as @code{"gcc"} or @code{"guile@@2"}, and each procedure takes a matching package and returns a replacement for that package. Matching packages that have the @code{hidden?} property -set are not replaced. +set are not replaced unless @var{replace-hidden?} is set to true. @end deffn The example above could be rewritten this way: -- cgit v1.2.3