From 637a1e7dcce4d1a2c4f2f9c478df4a640ae1f230 Mon Sep 17 00:00:00 2001 From: Maxime Devos Date: Wed, 14 Jul 2021 13:12:47 +0200 Subject: 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 --- gnu/packages/hurd.scm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'gnu/packages/hurd.scm') diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index 59a7b55943..222ddbce65 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -51,20 +51,16 @@ (define-module (gnu packages hurd) hurd-target? hurd-triplet?)) -(define (hurd-triplet? triplet) - (and (string-suffix? "-gnu" triplet) - (not (string-contains triplet "linux")))) - (define (hurd-target?) "Return true if the cross-compilation target or the current system is GNU/Hurd." - (or (and=> (%current-target-system) hurd-triplet?) + (or (and=> (%current-target-system) target-hurd?) (and (not (%current-target-system)) - (and=> (%current-system) hurd-triplet?)))) + (and=> (%current-system) target-hurd?)))) (define (hurd-system?) "Return true if the current system is the Hurd." - (and=> (%current-system) hurd-triplet?)) + (and=> (%current-system) target-hurd?)) (define (hurd-source-url version) (string-append "mirror://gnu/hurd/hurd-" -- cgit v1.2.3