From patchwork Wed Jul 21 01:00:38 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: 31537 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 2978F27BC78; Wed, 21 Jul 2021 02:02:15 +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 8CDE827BC6B for ; Wed, 21 Jul 2021 02:02:14 +0100 (BST) Received: from localhost ([::1]:38702 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m60cn-0007UB-JH for patchwork@mira.cbaines.net; Tue, 20 Jul 2021 21:02:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57414) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m60cd-0007QL-PS for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52467) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m60cd-0007iC-Hg for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m60cd-00009I-Gv for guix-patches@gnu.org; Tue, 20 Jul 2021 21:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49672] [PATCH 4/9] gnu: Use =?utf-8?q?=E2=80=98current-target-?= =?utf-8?q?nix-system=E2=80=99?= in pattern matches Resent-From: Thiago Jung Bauermann Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 21 Jul 2021 01:02:03 +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.1626829295450 (code B ref 49672); Wed, 21 Jul 2021 01:02:03 +0000 Received: (at 49672) by debbugs.gnu.org; 21 Jul 2021 01:01:35 +0000 Received: from localhost ([127.0.0.1]:35757 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60cB-00007B-1Q for submit@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:35 -0400 Received: from mx.kolabnow.com ([95.128.36.41]:49208) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m60c8-00006d-TO for 49672@debbugs.gnu.org; Tue, 20 Jul 2021 21:01:33 -0400 Received: from localhost (unknown [127.0.0.1]) by ext-mx-out001.mykolab.com (Postfix) with ESMTP id 6F504AF6 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:27 +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= 1626829286; x=1628643687; bh=bChMfSZ/8qlUGDxjrBTrzsOYKIbhmuWq/Sd hd47sUI4=; b=T7BjvtctpOZEJi/PP9GxzD8VqAwPmXCTOqKeonIuhnhsqsbtX1m 1NlqVrMYOsY1Pfw4CICu2stLwn2+CASZLkCXbUUNFndAFZnDuCxpAKBHPSPNDEqo vGhguXJ4TggOJtAeF3Bw6SUQOQjZu6zpAEFpvFgFUwLpwxmb0h4o8u0HcbtCGX3A X7k6wYcYTe5a9QQtUcmxAOp82N1s0h82jeNKex9DtYiX08rVFm+0XX5iwK+bCDEe oloiNR5xHlWPijidyRarEigkaELxgmr4d3jwA3PSiJxe/OgsiLCNgaBQ228HRC/K zW0YpfgoVabdRKkAMD3nbzt1KeoV4tMBX8bcBip83n9Cp21w8MJxbSQWV2fcKKYH 2KZcuENdMCBCpNlc/rtADj1FOtSPq1x6GtEqpRgHr/G7N+SCkt5/UHC4kUMdYwHQ hDTLjF0fqz1mUJI203wfZ/TkHL1RHRViujFFIP4Jt+sHC5JQQlyVOLwgH3Z9s4LO F7i5Dqyz0EVvamNtARXU2XQQ4IFxtAT6TyeWaHjFj0jWlTTeGsFvRSH2phE9JOzA CTYC4gNjDhvbcxzd/h8EjFs0nnWfzV+cuS3yzuwHsLhVv/1KOWsC0iGpDgZIilcI c4t61Y8QRz8zSS81PNeoNK3XhOKnxwdABs9/wM+Qx9zy8cjLuuZKlIRk= X-Virus-Scanned: amavisd-new at mykolab.com Received: from mx.kolabnow.com ([127.0.0.1]) by localhost (ext-mx-out001.mykolab.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kP5IwSDsQ-d3 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:26 +0200 (CEST) Received: from int-mx002.mykolab.com (unknown [10.9.13.2]) by ext-mx-out001.mykolab.com (Postfix) with ESMTPS id 862D9AB6 for <49672@debbugs.gnu.org>; Wed, 21 Jul 2021 03:01:25 +0200 (CEST) Received: from ext-subm003.mykolab.com (unknown [10.9.6.3]) by int-mx002.mykolab.com (Postfix) with ESMTPS id 65AEA4337; Wed, 21 Jul 2021 03:01:24 +0200 (CEST) Date: Tue, 20 Jul 2021 22:00:38 -0300 Message-Id: <20210721010043.632012-4-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 Parts of the code try to match a Nix system identifier to either ‘%current-target-system’ or ‘%current-system’, but this won’t work for cross-compiling because the former parameter contains a GNU triplet identifier. Fix the problem by matching against ‘current-target-nix-system’, which always returns a Nix system identifier. * gnu/packages/astronomy.scm (libpasastro)[arguments]<#:make-flags>: Use ‘current-target-nix-system’. * gnu/packages/compression.scm (zpaq)[arguments]<#:make-flags>: Likewise. * gnu/packages/digest.scm (xxhash)[arguments]<#:make-flags>: Likewise. * gnu/packages/java.scm (java-swt)[source]: Likewise. * gnu/packages/julia.scm (julia)[arguments]<#:make-flags>: Likewise. * gnu/packages/make-bootstrap.scm (%bootstrap-tarballs)[inputs]: Likewise. * gnu/packages/pascal.scm (fpc)[native-inputs]: Likewise. [arguments]<#:phases>: Likewise. * gnu/packages/video.scm (mplayer)[arguments]<#:phases>: Likewise. * gnu/packages/web.scm (nginx)[arguments]<#:phases>: Likewise. (nginx-accept-language-module)[arguments]<#:phases>: Likewise. --- gnu/packages/astronomy.scm | 4 ++-- gnu/packages/compression.scm | 6 ++---- gnu/packages/digest.scm | 3 +-- gnu/packages/java.scm | 2 +- gnu/packages/julia.scm | 3 +-- gnu/packages/make-bootstrap.scm | 2 +- gnu/packages/pascal.scm | 6 ++---- gnu/packages/video.scm | 3 +-- gnu/packages/web.scm | 6 ++---- 9 files changed, 13 insertions(+), 22 deletions(-) diff --git a/gnu/packages/astronomy.scm b/gnu/packages/astronomy.scm index a3f7d5cbf456..8c4a759718e7 100644 --- a/gnu/packages/astronomy.scm +++ b/gnu/packages/astronomy.scm @@ -645,11 +645,11 @@ low quality ones") `(#:tests? #f #:make-flags (list - ,(match (or (%current-target-system) (%current-system)) + ,(match (current-target-nix-system) ((or "aarch64-linux" "armhf-linux" "i686-linux" "x86_64-linux") "OS_TARGET=linux") (_ #f)) - ,(match (or (%current-target-system) (%current-system)) + ,(match (current-target-nix-system) ("i686-linux" "CPU_TARGET=i386") ("x86_64-linux" "CPU_TARGET=x86_64") ((or "armhf-linux" "aarch64-linux") "CPU_TARGET=armv7l") diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index cf4ec4e644a3..ac217e663f4c 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -1434,16 +1434,14 @@ functionality in a C++ iostream.") #:make-flags (list (string-append "CPPFLAGS=-Dunix" - ,(match (or (%current-target-system) - (%current-system)) + ,(match (current-target-nix-system) ("x86_64-linux" "") ("i686-linux" "") (_ " -DNOJIT"))) ;; These should be safe, lowest-common-denominator instruction sets, ;; allowing for some optimisation while remaining reproducible. (string-append "CXXFLAGS=-O3 -DNDEBUG" - ,(match (or (%current-target-system) - (%current-system)) + ,(match (current-target-nix-system) ("x86_64-linux" " -march=nocona -mtune=generic") ("i686-linux" " -march=i686 -mtune=generic") ("armhf-linux" " -mtune=generic-armv7-a") diff --git a/gnu/packages/digest.scm b/gnu/packages/digest.scm index 986e33586133..b1954221f261 100644 --- a/gnu/packages/digest.scm +++ b/gnu/packages/digest.scm @@ -77,8 +77,7 @@ Zig, V, and Nim programming language standard libraries.") (arguments `(#:make-flags (list ,(string-append "CC=" (cc-for-target)) - ,(match (or (%current-target-system) - (%current-system)) + ,(match (current-target-nix-system) ;; Detect vector instruction set at run time. ((or "i686-linux" "x86_64-linux") "DISPATCH=1") (_ "DISPATCH=0")) diff --git a/gnu/packages/java.scm b/gnu/packages/java.scm index e69d62be0802..1c62f5d358e2 100644 --- a/gnu/packages/java.scm +++ b/gnu/packages/java.scm @@ -3715,7 +3715,7 @@ specification.") (file32 "x86") (file64 "x86_64")) (let-values (((hash file) - (match (or (%current-target-system) (%current-system)) + (match (current-target-nix-system) ("x86_64-linux" (values hash64 file64)) (_ (values hash32 file32))))) (origin diff --git a/gnu/packages/julia.scm b/gnu/packages/julia.scm index abefc388bc6e..b5e29c394532 100644 --- a/gnu/packages/julia.scm +++ b/gnu/packages/julia.scm @@ -373,8 +373,7 @@ libraries. It is also a bit like @code{ldd} and @code{otool -L}.") ;; Passing the MARCH flag is necessary to build binary substitutes for ;; the supported architectures. - ,(match (or (%current-target-system) - (%current-system)) + ,(match (current-target-nix-system) ("x86_64-linux" "MARCH=x86-64") ("i686-linux" "MARCH=pentium4") ("armhf-linux" "JULIA_CPU_TARGET=armv7-a,neon") diff --git a/gnu/packages/make-bootstrap.scm b/gnu/packages/make-bootstrap.scm index cdcb1dcaa295..fd656f9b8bfd 100644 --- a/gnu/packages/make-bootstrap.scm +++ b/gnu/packages/make-bootstrap.scm @@ -902,7 +902,7 @@ for `sh' in $PATH, and without nscd, and with static NSS modules." %build-inputs) #t))) (inputs `(("guile-tarball" ,%guile-bootstrap-tarball) - ,@(match (or (%current-target-system) (%current-system)) + ,@(match (current-target-nix-system) ((or "i686-linux" "x86_64-linux") `(("bootstrap-mescc-tools" ,%mescc-tools-bootstrap-tarball) ("bootstrap-mes" ,%mes-bootstrap-tarball) diff --git a/gnu/packages/pascal.scm b/gnu/packages/pascal.scm index 0fdbecf05c20..9169584558b0 100644 --- a/gnu/packages/pascal.scm +++ b/gnu/packages/pascal.scm @@ -89,8 +89,7 @@ (native-inputs ;; FPC is built with FPC, so we need bootstrap binaries. `(("fpc-binary" - ,(match (or (%current-target-system) - (%current-system)) + ,(match (current-target-nix-system) ("i686-linux" fpc-bootstrap-i386-3.0.4) ;("powerpc64le-linux" fpc-bootstrap-ppc64le-3.0.4) ;("powerpc-linux" fpc-bootstrap-ppc-3.0.4) @@ -101,8 +100,7 @@ #:phases (let ((fpc-bootstrap-path (string-append (getcwd) "/" ,name "-" ,version "/fpc-bin")) - (arch ,(match (or (%current-target-system) - (%current-system)) + (arch ,(match (current-target-nix-system) ("i686-linux" "i386") ("x86_64-linux" "x86_64") (_ "unknown")))) diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm index 399327741f6b..6cf8b90ffa95 100644 --- a/gnu/packages/video.scm +++ b/gnu/packages/video.scm @@ -2021,8 +2021,7 @@ streaming protocols.") (string-append "--prefix=" out) ;; Enable runtime cpu detection where supported, ;; and choose a suitable target. - ,@(match (or (%current-target-system) - (%current-system)) + ,@(match (current-target-nix-system) ("x86_64-linux" '("--enable-runtime-cpudetection" "--target=x86_64-linux")) diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm index 2cc8619b19d9..b00c9aa3db5b 100644 --- a/gnu/packages/web.scm +++ b/gnu/packages/web.scm @@ -413,8 +413,7 @@ the same, being completely separated from the Internet.") ,(let ((system "Linux") ; uname -s (release "3.2.0") ; uname -r ;; uname -m - (machine (match (or (%current-target-system) - (%current-system)) + (machine (match (current-target-nix-system) ("x86_64-linux" "x86_64") ("i686-linux" "i686") ("mips64el-linux" "mips64") @@ -605,8 +604,7 @@ ngx_http_accept_language_module~%") ,(let ((system "Linux") ; uname -s (release "3.2.0") ; uname -r ;; uname -m - (machine (match (or (%current-target-system) - (%current-system)) + (machine (match (current-target-nix-system) ("x86_64-linux" "x86_64") ("i686-linux" "i686") ("mips64el-linux" "mips64")