From 9b943db357ad63b7a3d063c658b1f557697ef0fa Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Wed, 4 Mar 2020 11:49:46 -0500 Subject: gnu: hurd: Fix hurd-target?, add hurd-system?. * gnu/packages/hurd.scm (hurd-target?): Bugfix; the arguments to string-suffix? to test (%current-system) were transposed, always resulting in #f. Use hurd-triplet?. (hurd-system?): New exported variable. --- gnu/packages/hurd.scm | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'gnu/packages/hurd.scm') diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm index c147bac8a3..59d5c31e33 100644 --- a/gnu/packages/hurd.scm +++ b/gnu/packages/hurd.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2018 Ludovic Courtès ;;; Copyright © 2020 Efraim Flashner ;;; Copyright © 2020 Marius Bakke +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen ;;; ;;; This file is part of GNU Guix. ;;; @@ -34,8 +35,9 @@ (define-module (gnu packages hurd) #:use-module (gnu packages base) #:use-module (gnu packages texinfo) #:use-module (guix git-download) - #:export (hurd-triplet? - hurd-target?)) + #:export (hurd-system? + hurd-target? + hurd-triplet?)) (define (hurd-triplet? triplet) (and (string-suffix? "-gnu" triplet) @@ -45,7 +47,12 @@ (define (hurd-target?) "Return true if the cross-compilation target or the current system is GNU/Hurd." (or (and=> (%current-target-system) hurd-triplet?) - (string-suffix? (%current-system) "-gnu"))) + (and (not (%current-target-system)) + (and=> (%current-system) hurd-triplet?)))) + +(define (hurd-system?) + "Return true if the current system is the Hurd." + (and=> (%current-system) hurd-triplet?)) (define (hurd-source-url version) (string-append "mirror://gnu/hurd/hurd-" -- cgit v1.2.3