diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-09-28 17:36:42 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-10-12 18:23:47 +0200 |
commit | 46135ce4cefab9e164d75697d7ea0c8359b842e4 (patch) | |
tree | c3b9377edff08b149b46ab1a11332542c5ff7181 /guix/packages.scm | |
parent | b668450716f0949e6a66550c38b6ba738f66bba7 (diff) | |
download | guix-patches-46135ce4cefab9e164d75697d7ea0c8359b842e4.tar guix-patches-46135ce4cefab9e164d75697d7ea0c8359b842e4.tar.gz |
packages: Add 'package-with-c-toolchain'.
* guix/build-system.scm (build-system-with-c-toolchain): New procedure.
* guix/packages.scm (package-with-c-toolchain): New procedure.
* tests/packages.scm ("package-with-c-toolchain"): New test.
* doc/guix.texi (package Reference): Document 'package-with-c-toolchain'.
(Build Systems): Mention it.
Diffstat (limited to 'guix/packages.scm')
-rw-r--r-- | guix/packages.scm | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/guix/packages.scm b/guix/packages.scm index 4f2bb432be..24d6417065 100644 --- a/guix/packages.scm +++ b/guix/packages.scm @@ -124,6 +124,7 @@ package-patched-vulnerabilities package-with-patches package-with-extra-patches + package-with-c-toolchain package/inherit transitive-input-references @@ -790,6 +791,14 @@ specifies modules in scope when evaluating SNIPPET." (append (origin-patches (package-source original)) patches))) +(define (package-with-c-toolchain package toolchain) + "Return a variant of PACKAGE that uses TOOLCHAIN instead of the default GNU +C/C++ toolchain. TOOLCHAIN must be a list of inputs (label/package tuples) +providing equivalent functionality, such as the 'gcc-toolchain' package." + (let ((bs (package-build-system package))) + (package/inherit package + (build-system (build-system-with-c-toolchain bs toolchain))))) + (define (transitive-inputs inputs) "Return the closure of INPUTS when considering the 'propagated-inputs' edges. Omit duplicate inputs, except for those already present in INPUTS |