gnu: u-boot: Fix target/system comparison in 'make-u-boot-package'.
Until now, running, say: guix build -e '(@@ (gnu packages bootloaders) u-boot-a20-olinuxino-micro)' \ -s armhf-linux on an x86_64-linux machine wouldn't have the desired effect because (%current-system) would return "x86_64-linux" when 'same-arch?' was evaluated. This fixes that. * gnu/packages/bootloaders.scm (make-u-boot-package)[same-arch?]: Turn into a thunk so that (%current-system) is evaluated in the right context, and adjust callers. Use 'string=?' instead of 'string-prefix?'.
This commit is contained in:
parent
f5854abc88
commit
6bfcb72926
|
@ -524,17 +524,16 @@ board-independent tools.")))
|
||||||
|
|
||||||
(define-public (make-u-boot-package board triplet)
|
(define-public (make-u-boot-package board triplet)
|
||||||
"Returns a u-boot package for BOARD cross-compiled for TRIPLET."
|
"Returns a u-boot package for BOARD cross-compiled for TRIPLET."
|
||||||
(let ((same-arch? (if (string-prefix? (%current-system)
|
(let ((same-arch? (lambda ()
|
||||||
(gnu-triplet->nix-system triplet))
|
(string=? (%current-system)
|
||||||
`#t
|
(gnu-triplet->nix-system triplet)))))
|
||||||
`#f)))
|
|
||||||
(package
|
(package
|
||||||
(inherit u-boot)
|
(inherit u-boot)
|
||||||
(name (string-append "u-boot-"
|
(name (string-append "u-boot-"
|
||||||
(string-replace-substring (string-downcase board)
|
(string-replace-substring (string-downcase board)
|
||||||
"_" "-")))
|
"_" "-")))
|
||||||
(native-inputs
|
(native-inputs
|
||||||
`(,@(if (not same-arch?)
|
`(,@(if (not (same-arch?))
|
||||||
`(("cross-gcc" ,(cross-gcc triplet #:xgcc gcc-7))
|
`(("cross-gcc" ,(cross-gcc triplet #:xgcc gcc-7))
|
||||||
("cross-binutils" ,(cross-binutils triplet)))
|
("cross-binutils" ,(cross-binutils triplet)))
|
||||||
`(("gcc-7" ,gcc-7)))
|
`(("gcc-7" ,gcc-7)))
|
||||||
|
@ -547,7 +546,7 @@ board-independent tools.")))
|
||||||
#:test-target "test"
|
#:test-target "test"
|
||||||
#:make-flags
|
#:make-flags
|
||||||
(list "HOSTCC=gcc"
|
(list "HOSTCC=gcc"
|
||||||
,@(if (not same-arch?)
|
,@(if (not (same-arch?))
|
||||||
`((string-append "CROSS_COMPILE=" ,triplet "-"))
|
`((string-append "CROSS_COMPILE=" ,triplet "-"))
|
||||||
'()))
|
'()))
|
||||||
#:phases
|
#:phases
|
||||||
|
|
Loading…
Reference in New Issue