utils: Define 'target-hurd?' predicate.
It behaves similarily to the other target-...? procedures. The usage of hurd-triplet? / target-hurd? in libgc appears incorrect to me, as (%current-system) is normally never false. * gnu/packages/hurd.scm (hurd-triplet?): Move to ... * guix/util.scm (target-hurd?): ... here, let its argument default to (%current-target-system) or (%current-system), and write a docstring. * gnu/packages/hurd.scm (hurd-target?, hurd-system?): Use target-hurd? instead of hurd-triplet?. * gnu/packages/bdw-gc.scm (libgc): Likewise. * gnu/packages/cross-base.scm (cross-libc)[arguments]<#:configure-flags>: Likewise. (cross-libc)[arguments]<#:phases>: Likewise. (cross-libc)[arguments]<#:native-inputs>: Likewise. * gnu/packages/make-boostrap.scm (%glibc-stripped)[inputs]: Likewise. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>master
parent
ef71965c16
commit
637a1e7dcc
|
@ -56,7 +56,7 @@
|
||||||
;; to configure script. See bug report and discussion:
|
;; to configure script. See bug report and discussion:
|
||||||
;; <https://lists.opendylan.org/pipermail/bdwgc/2017-April/006275.html>
|
;; <https://lists.opendylan.org/pipermail/bdwgc/2017-April/006275.html>
|
||||||
;; <https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00008.html>
|
;; <https://lists.gnu.org/archive/html/bug-hurd/2017-01/msg00008.html>
|
||||||
,@(if (hurd-triplet? (or (%current-system)
|
,@(if (target-hurd? (or (%current-system)
|
||||||
(%current-target-system)))
|
(%current-target-system)))
|
||||||
'("--disable-gcj-support")
|
'("--disable-gcj-support")
|
||||||
'()))))
|
'()))))
|
||||||
|
|
|
@ -505,7 +505,7 @@ and the cross tool chain."
|
||||||
,@(package-arguments libc))
|
,@(package-arguments libc))
|
||||||
((#:configure-flags flags)
|
((#:configure-flags flags)
|
||||||
`(cons ,(string-append "--host=" target)
|
`(cons ,(string-append "--host=" target)
|
||||||
,(if (hurd-triplet? target)
|
,(if (target-hurd? target)
|
||||||
`(cons "--disable-werror" ,flags)
|
`(cons "--disable-werror" ,flags)
|
||||||
flags)))
|
flags)))
|
||||||
((#:phases phases)
|
((#:phases phases)
|
||||||
|
@ -519,7 +519,7 @@ and the cross tool chain."
|
||||||
(setenv "CROSS_LIBRARY_PATH"
|
(setenv "CROSS_LIBRARY_PATH"
|
||||||
(string-append kernel "/lib")) ; for Hurd's libihash
|
(string-append kernel "/lib")) ; for Hurd's libihash
|
||||||
#t)))
|
#t)))
|
||||||
,@(if (hurd-triplet? target)
|
,@(if (target-hurd? target)
|
||||||
'((add-after 'install 'augment-libc.so
|
'((add-after 'install 'augment-libc.so
|
||||||
(lambda* (#:key outputs #:allow-other-keys)
|
(lambda* (#:key outputs #:allow-other-keys)
|
||||||
(let* ((out (assoc-ref outputs "out")))
|
(let* ((out (assoc-ref outputs "out")))
|
||||||
|
@ -536,7 +536,7 @@ and the cross tool chain."
|
||||||
|
|
||||||
(native-inputs `(("cross-gcc" ,xgcc)
|
(native-inputs `(("cross-gcc" ,xgcc)
|
||||||
("cross-binutils" ,xbinutils)
|
("cross-binutils" ,xbinutils)
|
||||||
,@(if (hurd-triplet? target)
|
,@(if (target-hurd? target)
|
||||||
`(("cross-mig"
|
`(("cross-mig"
|
||||||
,@(assoc-ref (package-native-inputs xheaders)
|
,@(assoc-ref (package-native-inputs xheaders)
|
||||||
"cross-mig")))
|
"cross-mig")))
|
||||||
|
|
|
@ -51,20 +51,16 @@
|
||||||
hurd-target?
|
hurd-target?
|
||||||
hurd-triplet?))
|
hurd-triplet?))
|
||||||
|
|
||||||
(define (hurd-triplet? triplet)
|
|
||||||
(and (string-suffix? "-gnu" triplet)
|
|
||||||
(not (string-contains triplet "linux"))))
|
|
||||||
|
|
||||||
(define (hurd-target?)
|
(define (hurd-target?)
|
||||||
"Return true if the cross-compilation target or the current system is
|
"Return true if the cross-compilation target or the current system is
|
||||||
GNU/Hurd."
|
GNU/Hurd."
|
||||||
(or (and=> (%current-target-system) hurd-triplet?)
|
(or (and=> (%current-target-system) target-hurd?)
|
||||||
(and (not (%current-target-system))
|
(and (not (%current-target-system))
|
||||||
(and=> (%current-system) hurd-triplet?))))
|
(and=> (%current-system) target-hurd?))))
|
||||||
|
|
||||||
(define (hurd-system?)
|
(define (hurd-system?)
|
||||||
"Return true if the current system is the Hurd."
|
"Return true if the current system is the Hurd."
|
||||||
(and=> (%current-system) hurd-triplet?))
|
(and=> (%current-system) target-hurd?))
|
||||||
|
|
||||||
(define (hurd-source-url version)
|
(define (hurd-source-url version)
|
||||||
(string-append "mirror://gnu/hurd/hurd-"
|
(string-append "mirror://gnu/hurd/hurd-"
|
||||||
|
|
|
@ -439,7 +439,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules."
|
||||||
(assoc-ref %build-inputs "kernel-headers")))))
|
(assoc-ref %build-inputs "kernel-headers")))))
|
||||||
(inputs `(("kernel-headers"
|
(inputs `(("kernel-headers"
|
||||||
,(if (or (and (%current-target-system)
|
,(if (or (and (%current-target-system)
|
||||||
(hurd-triplet? (%current-target-system)))
|
(target-hurd? (%current-target-system)))
|
||||||
(string-suffix? "-hurd" (%current-system)))
|
(string-suffix? "-hurd" (%current-system)))
|
||||||
gnumach-headers
|
gnumach-headers
|
||||||
linux-libre-headers))
|
linux-libre-headers))
|
||||||
|
|
|
@ -85,6 +85,7 @@
|
||||||
%current-target-system
|
%current-target-system
|
||||||
package-name->name+version
|
package-name->name+version
|
||||||
target-linux?
|
target-linux?
|
||||||
|
target-hurd?
|
||||||
target-mingw?
|
target-mingw?
|
||||||
target-arm32?
|
target-arm32?
|
||||||
target-aarch64?
|
target-aarch64?
|
||||||
|
@ -639,6 +640,12 @@ a character other than '@'."
|
||||||
"Does the operating system of TARGET use the Linux kernel?"
|
"Does the operating system of TARGET use the Linux kernel?"
|
||||||
(->bool (string-contains target "linux")))
|
(->bool (string-contains target "linux")))
|
||||||
|
|
||||||
|
(define* (target-hurd? #:optional (target (or (%current-target-system)
|
||||||
|
(%current-system))))
|
||||||
|
"Does TARGET represent the GNU(/Hurd) system?"
|
||||||
|
(and (string-suffix? "-gnu" target)
|
||||||
|
(not (string-contains target "linux"))))
|
||||||
|
|
||||||
(define* (target-mingw? #:optional (target (%current-target-system)))
|
(define* (target-mingw? #:optional (target (%current-target-system)))
|
||||||
(and target
|
(and target
|
||||||
(string-suffix? "-mingw32" target)))
|
(string-suffix? "-mingw32" target)))
|
||||||
|
|
Reference in New Issue