@@ -802,8 +802,7 @@ cosine/ sine transforms or DCT/DST).")
(substitute-keyword-arguments (package-arguments fftw)
((#:configure-flags fftw-configure-flags)
`(cons* "--enable-single"
- ,@(if (string-prefix? "arm" (or (%current-target-system)
- (%current-system)))
+ ,@(if (target-arm32?)
;; fftw supports NEON on 32-bit ARM only when compiled
;; for single-precision, so add it here.
'("--enable-neon")
@@ -108,11 +108,11 @@
"binary-format=elf"
"target-os=linux"
,@(cond
- ((string-prefix? "arm" (%current-target-system))
+ ((target-arm32?)
'("abi=aapcs"
"address-model=32"
"architecture=arm"))
- ((string-prefix? "aarch64" (%current-target-system))
+ ((target-aarch64?)
'("abi=aapcs"
"address-model=64"
"architecture=arm"))
@@ -173,10 +173,7 @@
"test_unset"))
#t)))
;; Disable tests on ARM and AARCH64 platforms or when cross-compiling.
- #:tests? ,(not (or (any (cute string-prefix? <> (or (%current-target-system)
- (%current-system)))
- '("arm" "aarch64"))
- (%current-target-system)))))
+ #:tests? ,(not (or (target-arm?) (%current-target-system)))))
(inputs
`(("gettext" ,gettext-minimal)
@@ -988,9 +985,7 @@ to Novena upstream, does not load u-boot.img from the first partition.")
;; "armv7l", the value of `uname -m`, and will not
;; match ${ARCH}, which will make the tests require
;; QEMU for testing.
- ,@(if (string-prefix? "arm"
- (or (%current-target-system)
- (%current-system)))
+ ,@(if (target-arm32?)
'("HOST_ARCH=arm")
'())
(string-append "DESTDIR=" (assoc-ref %outputs "out")))
@@ -27,7 +27,7 @@
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix git-download)
- #:use-module (guix download)
+ #:use-module (guix utils)
#:use-module (gnu packages autotools)
#:use-module (gnu packages base)
#:use-module (gnu packages boost)
@@ -97,9 +97,7 @@
#:configure-flags '("--localstatedir=/var") ;for /var/log/cuirass
;; XXX: HTTP tests fail on aarch64 due to Fibers errors, disable them
;; on that architecture for now.
- #:tests? ,(let ((s (or (%current-target-system)
- (%current-system))))
- (not (string-prefix? "aarch64" s)))
+ #:tests? ,(not (target-aarch64?))
#:parallel-tests? #f
#:phases
(modify-phases %standard-phases
@@ -398,7 +398,7 @@ Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.")
(name "ovmf-aarch64")
(native-inputs
`(,@(package-native-inputs ovmf)
- ,@(if (not (string-prefix? "aarch64" (%current-system)))
+ ,@(if (not (target-aarch64? (%current-system)))
`(("cross-gcc" ,(cross-gcc "aarch64-linux-gnu"))
("cross-binutils" ,(cross-binutils "aarch64-linux-gnu")))
'())))
@@ -408,7 +408,7 @@ Virtual Machines. OVMF contains a sample UEFI firmware for QEMU and KVM.")
`(modify-phases ,phases
(add-before 'configure 'set-env
(lambda _
- ,@(if (not (string-prefix? "aarch64" (%current-system)))
+ ,@(if (not (target-aarch64? (%current-system)))
`((setenv "GCC49_AARCH64_PREFIX" "aarch64-linux-gnu-"))
'())
#t))
@@ -539,8 +539,7 @@ This package provides the core library and elements.")
;; XXX: Do not enable Orc optimizations on ARM systems because
;; it leads to two test failures.
;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/issues/683
- ,@(if (string-prefix? "arm" (or (%current-target-system)
- (%current-system)))
+ ,@(if (target-arm32?)
'()
`(("orc" ,orc))))) ;required by gstreamer-audio-1.0.pc
(inputs
@@ -691,8 +690,7 @@ model to base your own plug-in on, here it is.")
`(#:phases
(modify-phases %standard-phases
,@%common-gstreamer-phases
- ,@(if (string-prefix? "arm" (or (%current-target-system)
- (%current-system)))
+ ,@(if (target-arm32?)
;; Disable test that fails on ARMv7.
;; https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/1188
`((add-after 'unpack 'disable-asfmux-test
@@ -315,8 +315,7 @@ language.")
"--enable-runtime-reloc-checks"
"--enable-ffi")
#:phases
- ,(if (string-prefix? "aarch64" (or (%current-target-system)
- (%current-system)))
+ ,(if (target-aarch64?)
;; Makefiles and the configure script need to be regenerated to
;; incorporate support for AArch64.
'(modify-phases %standard-phases
@@ -330,8 +329,7 @@ language.")
("zip" ,zip)
("zlib" ,zlib)))
(native-inputs
- (if (string-prefix? "aarch64" (or (%current-target-system)
- (%current-system)))
+ (if (target-aarch64?)
;; Additional packages needed for autoreconf.
`(("autoconf" ,autoconf)
("automake" ,automake)
@@ -6890,9 +6890,7 @@ userspace queueing component and the logging subsystem.")
;; Disable the test suite on ARM platforms, as there are too many
;; failures to keep track of (see for example:
;; https://github.com/proot-me/proot/issues/263).
- `(#:tests? ,(not (string-match "^(arm|aarch64)"
- (or (%current-target-system)
- (%current-system))))
+ `(#:tests? ,(not (target-arm?))
#:make-flags '("-C" "src")
#:phases (modify-phases %standard-phases
(add-after 'unpack 'patch-sources
@@ -235,9 +235,7 @@ error. Additionally, iRRAM uses the concept of multi-valued functions.")
(arguments
`(#:configure-flags `("--disable-enable_fma" ;weird :/
"--enable-shared"
- ,,@(if (string-prefix? "aarch64"
- (or (%current-target-system)
- (%current-system)))
+ ,,@(if (target-aarch64?)
;; XXX: The qd_test test fails numerical
;; accuracy checks for 'dd_real::exp()' on
;; aarch64 with GCC 5.4 at -O2. Disabling
@@ -177,8 +177,7 @@
(substitute* "ext/standard/tests/streams/bug60602.phpt"
(("'ls'") (string-append "'" (which "ls") "'")))
- ,@(if (string-prefix? "arm" (or (%current-target-system)
- (%current-system)))
+ ,@(if (target-arm32?)
;; Drop tests known to fail on armhf.
'((for-each delete-file
(list
@@ -488,16 +488,13 @@ data types.")
#t)))
;; XXX: Apply patch on ARM platforms only to avoid a full rebuild.
;; Remove this phase in the next rebuild cycle.
- ,@(let ((system (or (%current-target-system)
- (%current-system))))
- (if (any (cute string-prefix? <> system)
- '("arm" "aarch64"))
- '((add-after 'unpack 'apply-alignment-patch
- (lambda* (#:key native-inputs inputs #:allow-other-keys)
- (invoke "patch" "-p1" "--force" "--input"
- (assoc-ref (or native-inputs inputs)
- "arm-alignment.patch")))))
- '()))))))
+ ,@(if (target-arm?)
+ '((add-after 'unpack 'apply-alignment-patch
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (invoke "patch" "-p1" "--force" "--input"
+ (assoc-ref (or native-inputs inputs)
+ "arm-alignment.patch")))))
+ '())))))
(native-inputs
`(("tzdata" ,tzdata-for-tests)
@@ -505,12 +502,9 @@ data types.")
;; it causes a test failure when building 32-bit Python on a
;; 64-bit kernel. See <https://bugs.python.org/issue36515>.
;; TODO: make this a regular patch in the next rebuild cycle.
- ,@(let ((system (or (%current-target-system)
- (%current-system))))
- (if (any (cute string-prefix? <> system)
- '("arm" "aarch64"))
- `(("arm-alignment.patch" ,(search-patch "python-3-arm-alignment.patch")))
- '()))
+ ,@(if (target-arm?)
+ `(("arm-alignment.patch" ,(search-patch "python-3-arm-alignment.patch")))
+ '())
,@(if (%current-target-system)
`(("python3" ,this-package))
@@ -30,6 +30,7 @@
#:use-module (guix download)
#:use-module (guix git-download)
#:use-module (guix licenses)
+ #:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages glib)
@@ -568,8 +569,7 @@ higher-level API for doing so.")
(arguments
;; Arbitrary precision tests are known to be broken on aarch64, ppc64le
;; and s390x. See: https://github.com/rcrowley/go-metrics/issues/249
- `(#:tests? ,(not (string-prefix? "aarch64" (or (%current-target-system)
- (%current-system))))
+ `(#:tests? ,(not (target-aarch64?))
#:import-path "github.com/rcrowley/go-metrics"))
(propagated-inputs
`(("go-github-com-stathat-go" ,go-github-com-stathat-go)))
@@ -26,6 +26,7 @@
#:use-module (guix download)
#:use-module (guix build-system gnu)
#:use-module (guix licenses)
+ #:use-module (guix utils)
#:use-module (gnu packages gdb)
#:use-module (gnu packages perl)
#:use-module (gnu packages))
@@ -50,8 +51,7 @@
(outputs '("doc" ;16 MB
"out"))
(arguments
- `(,@(if (string-prefix? "powerpc" (or (%current-target-system)
- (%current-system)))
+ `(,@(if (target-powerpc?)
`(#:make-flags '("CFLAGS+=-maltivec"))
'())
#:phases
@@ -1322,8 +1322,7 @@ current version of any major web browser.")
#t))))
(build-system cmake-build-system)
(arguments
- (if (string-prefix? "aarch64" (or (%current-target-system)
- (%current-system)))
+ (if (target-aarch64?)
'(#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-aarch-march-detection