@@ -1677,6 +1677,6 @@ (define-public (%final-inputs)
"Return the list of \"final inputs\"."
;; Avoid circular dependency by lazily resolving 'commencement'.
(let ((iface (resolve-interface '(gnu packages commencement))))
- (module-ref iface '%final-inputs)))
+ ((module-ref iface '%final-inputs) (%current-system))))
;;; base.scm ends here
@@ -3406,45 +3406,49 @@ (define sed-final
(package/inherit sed (native-inputs `(("perl" ,perl-boot0))))))
(define-public %final-inputs
- ;; Final derivations used as implicit inputs by 'gnu-build-system'. We
- ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are
- ;; used for origins that have patches, thereby avoiding circular
- ;; dependencies.
- (let ((finalize (compose with-boot6
- package-with-bootstrap-guile)))
- `(,@(map (match-lambda
- ((name package)
- (list name (finalize package))))
- `(("tar" ,tar)
- ("gzip" ,gzip)
- ("bzip2" ,bzip2)
- ("file" ,file)
- ("diffutils" ,diffutils)
- ("patch" ,patch)
- ("findutils" ,findutils)
- ("gawk" ,gawk)))
- ("sed" ,sed-final)
- ("grep" ,grep-final)
- ("xz" ,xz-final)
- ("coreutils" ,coreutils-final)
- ("make" ,gnu-make-final)
- ("bash" ,bash-final)
- ("ld-wrapper" ,ld-wrapper)
- ("binutils" ,binutils-final)
- ("gcc" ,gcc-final)
- ("libc" ,glibc-final)
- ("libc:static" ,glibc-final "static")
- ("locales" ,glibc-utf8-locales-final))))
+ ;; The 'glibc-final' package is not the same depending on what system is
+ ;; targeted, so this whole list must be parameterized.
+ (mlambda (system)
+ ;; Final derivations used as implicit inputs by 'gnu-build-system'. We
+ ;; still use 'package-with-bootstrap-guile' so that the bootstrap tools are
+ ;; used for origins that have patches, thereby avoiding circular
+ ;; dependencies.
+ (let ((finalize (compose with-boot6
+ package-with-bootstrap-guile)))
+ `(,@(map (match-lambda
+ ((name package)
+ (list name (finalize package))))
+ `(("tar" ,tar)
+ ("gzip" ,gzip)
+ ("bzip2" ,bzip2)
+ ("file" ,file)
+ ("diffutils" ,diffutils)
+ ("patch" ,patch)
+ ("findutils" ,findutils)
+ ("gawk" ,gawk)))
+ ("sed" ,sed-final)
+ ("grep" ,grep-final)
+ ("xz" ,xz-final)
+ ("coreutils" ,coreutils-final)
+ ("make" ,gnu-make-final)
+ ("bash" ,bash-final)
+ ("ld-wrapper" ,ld-wrapper)
+ ("binutils" ,binutils-final)
+ ("gcc" ,gcc-final)
+ ("libc" ,glibc-final)
+ ("libc:static" ,glibc-final "static")
+ ("locales" ,glibc-utf8-locales-final)))))
(define-public canonical-package
- (let ((name->package (fold (lambda (input result)
- (match input
- ((_ package . outputs)
- (vhash-cons (package-full-name package)
- package result))))
- vlist-null
- `(("guile" ,guile-final)
- ,@%final-inputs))))
+ (let ((name->package (mlambda (system)
+ (fold (lambda (input result)
+ (match input
+ ((_ package . outputs)
+ (vhash-cons (package-full-name package)
+ package result))))
+ vlist-null
+ `(("guile" ,guile-final)
+ ,@(%final-inputs system))))))
(lambda (package)
"Return the 'canonical' variant of PACKAGE---i.e., if PACKAGE is one of
the implicit inputs of 'gnu-build-system', return that one, otherwise return
@@ -3454,7 +3458,8 @@ (define-public canonical-package
COREUTILS-FINAL vs. COREUTILS, etc."
;; XXX: This doesn't handle dependencies of the final inputs, such as
;; libunistring, GMP, etc.
- (match (vhash-assoc (package-full-name package) name->package)
+ (match (vhash-assoc (package-full-name package)
+ (name->package (%current-system)))
((_ . canon)
;; In general we want CANON, except if we're cross-compiling: CANON
;; uses explicit inputs, so it is "anchored" in the bootstrapped
@@ -3536,7 +3541,8 @@ (define* (make-gcc-toolchain gcc
;; install everything that we need, and (2) to make sure ld-wrapper comes
;; before Binutils' ld in the user's profile.
(inputs `(("gcc" ,gcc)
- ("ld-wrapper" ,(car (assoc-ref %final-inputs "ld-wrapper")))
+ ("ld-wrapper" ,(car (assoc-ref (%final-inputs (%current-system))
+ "ld-wrapper")))
("binutils" ,binutils-final)
("libc" ,libc)
("libc-debug" ,libc "debug")
@@ -266,13 +266,13 @@ (define (package-with-restricted-references p refs)
p))
-(define (standard-packages)
+(define* (standard-packages #:optional (system (%current-system)))
"Return the list of (NAME PACKAGE OUTPUT) or (NAME PACKAGE) tuples of
standard packages used as implicit inputs of the GNU build system."
;; Resolve (gnu packages commencement) lazily to hide circular dependency.
(let ((distro (resolve-module '(gnu packages commencement))))
- (module-ref distro '%final-inputs)))
+ ((module-ref distro '%final-inputs) system)))
(define* (lower name
#:key source inputs native-inputs outputs target
@@ -303,7 +303,7 @@ (define* (lower name
(standard-cross-packages target 'host)
'())
,@(if implicit-inputs?
- (standard-packages)
+ (standard-packages system)
'())))
(host-inputs (if target inputs '()))
@@ -228,7 +228,8 @@ (define (options->update-specs opts)
(let* ((input->package (match-lambda
((name (? package? package) _ ...) package)
(_ #f)))
- (final-inputs (map input->package %final-inputs))
+ (final-inputs (map input->package
+ (%final-inputs (%current-system))))
(core (append final-inputs
(append-map (compose (cut filter-map input->package <>)
package-transitive-inputs)