@@ -610,10 +610,7 @@ fi~%"))))
(define (install-grub-efi-netboot subdir)
"Define a grub-efi-netboot bootloader installer for installation in SUBDIR,
which is usually efi/Guix or efi/boot."
- (let* ((system (string-split (nix-system->gnu-triplet
- (or (%current-target-system)
- (%current-system)))
- #\-))
+ (let* ((system (string-split (current-target-gnu-triplet) #\-))
(arch (first system))
(boot-efi-link (match system
;; These are the supportend systems and the names
@@ -138,10 +138,7 @@ where the OS part is overloaded to denote a specific ABI---into GCC
"--without-headers")))
;; Pass the right options for the target triplet.
- (let ((triplet
- (or (%current-target-system)
- (nix-system->gnu-triplet (%current-system)))))
- (gcc-configure-flags-for-triplet triplet))
+ (gcc-configure-flags-for-triplet (current-target-gnu-triplet))
(maybe-target-tools))))))
(hidden-package
@@ -402,9 +402,7 @@ test = { path = \"../libtest\" }
(replace 'install
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((out (assoc-ref outputs "out"))
- (target-system ,(or (%current-target-system)
- (nix-system->gnu-triplet
- (%current-system))))
+ (target-system ,(current-target-gnu-triplet))
(out-libs (string-append out "/lib/rustlib/"
target-system "/lib")))
;(setenv "CFG_PREFIX" out)
@@ -2032,9 +2032,7 @@ streaming protocols.")
'("--target=mips3-linux"))
(_ (list (string-append
"--target="
- (or (%current-target-system)
- (nix-system->gnu-triplet
- (%current-system)))))))
+ (current-target-gnu-triplet)))))
"--disable-iwmmxt")))))))
(home-page "https://www.mplayerhq.hu")
(synopsis "Audio and video player")
@@ -78,6 +78,7 @@
%current-system
%current-target-system
current-target-nix-system
+ current-target-gnu-triplet
package-name->name+version
target-mingw?
target-arm32?
@@ -527,6 +528,12 @@ cross-building or not."
(or (and=> (%current-target-system) gnu-triplet->nix-system)
(%current-system)))
+(define (current-target-gnu-triplet)
+ "Return the GNU triplet identifier for the current target, whether we are
+cross-building or not."
+ (or (%current-target-system)
+ (nix-system->gnu-triplet (%current-system))))
+
(define* (package-name->name+version spec
#:optional (delimiter #\@))
"Given SPEC, a package name like \"foo@0.9.1b\", return two values: \"foo\"