From patchwork Wed Jul 21 01:00:43 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thiago Jung Bauermann X-Patchwork-Id: 31543 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 3017227BC78; Wed, 21 Jul 2021 02:02:36 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4622227BC6B for ; Wed, 21 Jul 2021 02:02:35 +0100 (BST) Received: from localhost ([::1]:40404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m60d8-0000C4-BV for patchwork@mira.cbaines.net; Tue, 20 Jul 2021 21:02:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m60cf-0007Tu-Rd for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m60cf-0007k0-JD for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m60cf-00009u-I1 for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49672] [PATCH 9/9] gnu: Use existing target helpers from =?utf-8?b?4oCY?=(guix utils)=?utf-8?b?4oCZ?= Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 01:02:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49672 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49672@debbugs.gnu.org Cc: Thiago Jung Bauermann Received: via spool by 49672-submit@debbugs.gnu.org id=B49672.1626829315536 (code B ref 49672); Wed, 21 Jul 2021 01:02:05 +0000 Received: (at 49672) by debbugs.gnu.org; 21 Jul 2021 01:01:55 +0000 Received: from localhost ([127.0.0.1]:35777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60cU-00008Z-Vm for submit@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:55 -0400 Received: from mx.kolabnow.com ([95.128.36.42]:46664) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60cR-00007x-QO for 49672@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:52 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTP id 5C7BC998 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kolabnow.com; h= content-transfer-encoding:content-type:content-type:mime-version :references:in-reply-to:message-id:date:date:subject:subject :from:from:received:received:received; s=dkim20160331; t= 1626829305; x=1628643706; bh=eC5eZl9IdkPU1qDnGNrLPqkeO2Alpq8gTMk bdFlmIAw=; b=M8sbISj+gyoSYzMoIaDLPzTEy1DkV5r7sM5rIaCGlcRyi3cOA5q gZHAEGGfZo5KAlmfUYO9i61C21uNoVJq7OFEiLrXUNWSA4r2GJi+PiM7Y2I020BJ ooN30iXWkSOIfXofqm1hs2HLvj+1EL2/NDR+XcZX1NcoQFxBftwsKIe52qDgqbw3 tpL3BFg0I36oPBWQwISr7J5L55uJkla0NzOtiKhJIKkbYhqb3mnMi3kFRZOycptU oh6p69soBzDchaxSchltBc/tzkpz4JcvuQS5dHZl/6iG8R2EDgNHPQKZtUCSnZlO Far25KIepalej2snsehUofzLNaEYDAxVnthCgeNwTsIkJXMVyLrv0Duwfnt+lzKW KrkAfAHjQTbktbDfnI7zOIl1Y+OUuUrI6qBbKdssr2nnStbho9RDNjUhcgjgEmpa JrDuvR2/dNFgRoayF4ZjeR2K7oxPRFWXOsvbAh+MhbNp/UcPU4YNXwddkJ2wSs/2 OxnMf5sp/ZcTrcLyRDJpTw1YUFYiiWN4OYP4nnJCQTD1HExvSbjqcJqs2wSUIjWU Mu657CeNq6ql81gOVB3pj1k42yo12lt1Hyo2YUyukwdkJkVke1AGeBlct0QGW9KF frX5GjNYbK5z+8BOabST8N4m+QMtJsUFeRb6owc9qZkN7X+XEvJdlxHc= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out002.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DiDFKFs0uybc for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:45 +0200 (CEST) Received: from int-mx001.mykolab.com (unknown [10.9.13.1]) by ext-mx-out002.mykolab.com (Postfix) with ESMTPS id 1C9D5D3 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:44 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx001.mykolab.com (Postfix) with ESMTPS id 973D3323; Wed, 21 Jul 2021 03:01:44 +0200 (CEST) Date: Tue, 20 Jul 2021 22:00:43 -0300 Message-Id: <20210721010043.632012-9-bauermann@kolabnow.com> In-Reply-To: <20210721010043.632012-1-bauermann@kolabnow.com> References: <20210721010043.632012-1-bauermann@kolabnow.com> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Thiago Jung Bauermann X-ACL-Warn: , Thiago Jung Bauermann via Guix-patches X-Patchwork-Original-From: Thiago Jung Bauermann via Guix-patches via From: Thiago Jung Bauermann X-getmail-retrieved-from-mailbox: Patches These are equivalent to existing code and shouldn't lead to any behaviour change. The objective of the change is to make the code easier to read. * gnu/packages/algebra.scm (fftwf)[arguments]<#:configure-flags>: Use ‘target-arm32?’. * gnu/packages/boost.scm (boost)[arguments]<#:make-flags>: Use ‘target-arm32?’ and ‘target-aarch64?’. * gnu/packages/bootloaders.scm (grub)[arguments]<#:tests>: Use ‘target-arm?’. (vboot-utils)[arguments]<#:make-flags>: Use ‘target-arm32?’. * gnu/packages/ci.scm (cuirass)[arguments]<#:tests>: Use ‘target-aarch64?’. * gnu/packages/firmware.scm (ovmf-aarch64)[native-inputs]: Use ‘target-aarch64?’. [arguments]<#:phases>: Likewise. * gnu/packages/gstreamer.scm (gst-plugins-base)[propagated-inputs]: Use ‘target-arm32?’. (gst-plugins-bad)[arguments]<#:phases>: Likewise. * gnu/packages/java.scm (jamvm-1-bootstrap)[arguments]<#:phases>: Use ‘target-aarch64?’. [native-inputs]: Likewise. * gnu/packages/linux.scm (proot)[arguments]<#:tests>: Use ‘target-arm?’. * gnu/packages/multiprecision.scm (qd)[arguments]<#:configure-flags>: Use ‘target-aarch64?’. * gnu/packages/php.scm (php)[arguments]<#:phases>: Use ‘target-arm32?’. * gnu/packages/python.scm (python-3.8)[arguments]<#:phases>: Use ‘target-arm?’. [native-inputs]: Likewise. * gnu/packages/syncthing.scm (go-github-com-rcrowley-go-metrics)[arguments] <#:tests>: Use ‘target-aarch64?’. * gnu/packages/valgrind.scm (valgrind)[arguments]<#:make-flags>: Use ‘target-powerpc?’. * gnu/packages/web.scm (rapidjson)[arguments]<#:phases>: Use ‘target-aarch64?’. --- gnu/packages/algebra.scm | 3 +-- gnu/packages/boost.scm | 4 ++-- gnu/packages/bootloaders.scm | 9 ++------- gnu/packages/ci.scm | 6 ++---- gnu/packages/firmware.scm | 4 ++-- gnu/packages/gstreamer.scm | 6 ++---- gnu/packages/java.scm | 6 ++---- gnu/packages/linux.scm | 4 +--- gnu/packages/multiprecision.scm | 4 +--- gnu/packages/php.scm | 3 +-- gnu/packages/python.scm | 26 ++++++++++---------------- gnu/packages/syncthing.scm | 4 ++-- gnu/packages/valgrind.scm | 4 ++-- gnu/packages/web.scm | 3 +-- 14 files changed, 31 insertions(+), 55 deletions(-) diff --git a/gnu/packages/algebra.scm b/gnu/packages/algebra.scm index 533b1f09e023..f51bd69a4230 100644 --- a/gnu/packages/algebra.scm +++ b/gnu/packages/algebra.scm @@ -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") diff --git a/gnu/packages/boost.scm b/gnu/packages/boost.scm index e05a3c32fe11..67d452e925e1 100644 --- a/gnu/packages/boost.scm +++ b/gnu/packages/boost.scm @@ -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")) diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index 669574468bd2..6912cffa38be 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -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"))) diff --git a/gnu/packages/ci.scm b/gnu/packages/ci.scm index 0bcde0fad515..bddc1e8386c2 100644 --- a/gnu/packages/ci.scm +++ b/gnu/packages/ci.scm @@ -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 diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm index ebcb89923cee..b569bc288949 100644 --- a/gnu/packages/firmware.scm +++ b/gnu/packages/firmware.scm @@ -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)) diff --git a/gnu/packages/gstreamer.scm b/gnu/packages/gstreamer.scm index 3047773e0f07..488417c39773 100644 --- a/gnu/packages/gstreamer.scm +++ b/gnu/packages/gstreamer.scm @@ -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 diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index 1c62f5d358e2..5b5d5afed945 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -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) diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm index 0d695950d101..c6b7c0a403ef 100644 --- a/gnu/packages/linux.scm +++ b/gnu/packages/linux.scm @@ -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 diff --git a/gnu/packages/multiprecision.scm b/gnu/packages/multiprecision.scm index 733e6548b992..53b1e3c55ca7 100644 --- a/gnu/packages/multiprecision.scm +++ b/gnu/packages/multiprecision.scm @@ -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 diff --git a/gnu/packages/php.scm b/gnu/packages/php.scm index 597494e8a94f..36a4527aad67 100644 --- a/gnu/packages/php.scm +++ b/gnu/packages/php.scm @@ -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 diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e694321e173e..c1a486b9f21f 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -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 . ;; 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)) diff --git a/gnu/packages/syncthing.scm b/gnu/packages/syncthing.scm index 5cb8449e448e..b23fcea24096 100644 --- a/gnu/packages/syncthing.scm +++ b/gnu/packages/syncthing.scm @@ -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))) diff --git a/gnu/packages/valgrind.scm b/gnu/packages/valgrind.scm index 4036bd461bc5..24b422c2c52c 100644 --- a/gnu/packages/valgrind.scm +++ b/gnu/packages/valgrind.scm @@ -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 diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index b00c9aa3db5b..a6812699d77b 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -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