diff options
author | Sarah Morgensen <iskarian@mgsn.dev> | 2021-09-19 22:20:50 -0700 |
---|---|---|
committer | Leo Famulari <leo@famulari.name> | 2021-12-24 16:32:25 -0500 |
commit | d6121d7dd6998118de2c9327291cc942fff54e31 (patch) | |
tree | 72e6682b4e38a3b36f352080b3d188fd67166a6c /guix/build-system | |
parent | c90f73f8164a209884471f1c41948d0556e6c39e (diff) |
build-system/go: Add pre-built standard library as implicit input.
* gnu/packages/golang.scm (make-go-std): New procedure.
* guix/build-system/go.scm (make-go-std): New procedure.
(lower): Use it. Add pre-built standard library to inputs.
Signed-off-by: Leo Famulari <leo@famulari.name>
Diffstat (limited to 'guix/build-system')
-rw-r--r-- | guix/build-system/go.scm | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm index 0b2bf1c11b..09148f8730 100644 --- a/guix/build-system/go.scm +++ b/guix/build-system/go.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net> ;;; Copyright © 2021 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2021 Efraim Flashner <efraim@flashner.co.il> +;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> ;;; ;;; This file is part of GNU Guix. ;;; @@ -112,6 +113,9 @@ commit hash and its date rather than a proper release tag." (let ((go (resolve-interface '(gnu packages golang)))) (module-ref go 'go))) +(define (make-go-std) + (module-ref (resolve-interface '(gnu packages golang)) 'make-go-std)) + (define* (lower name #:key source inputs native-inputs outputs system target (go (default-go)) @@ -121,6 +125,14 @@ commit hash and its date rather than a proper release tag." (define private-keywords '(#:target #:go #:inputs #:native-inputs)) + (define inputs-with-cache + ;; XXX: Avoid a circular dependency. This should be rewritten with + ;; 'package-mapping' or similar. + (let ((go-std-name (string-append (package-name go) "-std"))) + (if (string-prefix? go-std-name name) + inputs + (cons `(,go-std-name ,((make-go-std) go)) inputs)))) + (bag (name name) (system system) @@ -130,7 +142,7 @@ commit hash and its date rather than a proper release tag." '()) ,@`(("go" ,go)) ,@native-inputs - ,@(if target '() inputs) + ,@(if target '() inputs-with-cache) ,@(if target ;; Use the standard cross inputs of ;; 'gnu-build-system'. @@ -138,7 +150,7 @@ commit hash and its date rather than a proper release tag." '()) ;; Keep the standard inputs of 'gnu-build-system'. ,@(standard-packages))) - (host-inputs (if target inputs '())) + (host-inputs (if target inputs-with-cache '())) ;; The cross-libc is really a target package, but for bootstrapping ;; reasons, we can't put it in 'host-inputs'. Namely, 'cross-gcc' is a |