@@ -35,7 +35,7 @@
#:select (run-with-store add-to-store add-text-to-store))
#:use-module ((guix derivations)
#:select (derivation derivation-input derivation->output-path))
- #:use-module ((guix utils) #:select (gnu-triplet->nix-system))
+ #:use-module (guix utils)
#:use-module ((guix gexp) #:select (lower-object))
#:use-module (guix memoization)
#:use-module (guix i18n)
@@ -286,9 +286,7 @@ or false to signal an error."
package-with-bootstrap-guile)))))
(define* (glibc-dynamic-linker
- #:optional (system (or (and=> (%current-target-system)
- gnu-triplet->nix-system)
- (%current-system))))
+ #:optional (system (current-target-nix-system)))
"Return the name of Glibc's dynamic linker for SYSTEM."
;; See the 'SYSDEP_KNOWN_INTERPRETER_NAMES' cpp macro in libc.
(cond ((string=? system "x86_64-linux") "/lib/ld-linux-x86-64.so.2")
@@ -66,9 +66,7 @@
#:export (system->llvm-target))
(define* (system->llvm-target #:optional
- (system (or (and=> (%current-target-system)
- gnu-triplet->nix-system)
- (%current-system))))
+ (system (current-target-nix-system)))
"Return the LLVM target name that corresponds to SYSTEM, a system type such
as \"x86_64-linux\"."
;; See the 'lib/Target' directory of LLVM for a list of supported targets.
@@ -77,6 +77,7 @@
gnu-triplet->nix-system
%current-system
%current-target-system
+ current-target-nix-system
package-name->name+version
target-mingw?
target-arm32?
@@ -520,6 +521,12 @@ returned by `config.guess'."
;; cross-building to.
(make-parameter #f))
+(define (current-target-nix-system)
+ "Return the Nix system identifier for the current target, whether we are
+cross-building or not."
+ (or (and=> (%current-target-system) gnu-triplet->nix-system)
+ (%current-system)))
+
(define* (package-name->name+version spec
#:optional (delimiter #\@))
"Given SPEC, a package name like \"foo@0.9.1b\", return two values: \"foo\"