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 --- tests/packages.scm | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'tests') diff --git a/tests/packages.scm b/tests/packages.scm index a623628447..7c28e75c45 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1628,6 +1628,21 @@ (match (delete-duplicates pythons eq?) ((p) (eq? p python))))) +(test-assert "package-input-rewriting/spec, replace hidden package" + ;; Rewrite hidden packages when requested. + (let* ((python (hidden-package python)) + (p0 (dummy-package "chbouib" + (build-system trivial-build-system) + (inputs (list python)))) + (rewrite (package-input-rewriting/spec + `(("python" . ,(const sed))) + #:replace-hidden? #t)) + (p1 (rewrite p0))) + (match (package-inputs p1) + ((("python" python)) + (and (string=? (package-full-name python) + (package-full-name sed))))))) + (test-equal "package-input-rewriting/spec, graft" (derivation-file-name (package-derivation %store sed)) -- cgit v1.2.3