all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Thiago Jung Bauermann via Guix-patches via <guix-patches@gnu.org>
To: 49672@debbugs.gnu.org
Cc: Thiago Jung Bauermann <bauermann@kolabnow.com>
Subject: [bug#49672] [PATCH 4/9] gnu: Use ‘current-target-nix-system’ in pattern matches
Date: Tue, 20 Jul 2021 22:00:38 -0300	[thread overview]
Message-ID: <20210721010043.632012-4-bauermann@kolabnow.com> (raw)
In-Reply-To: <20210721010043.632012-1-bauermann@kolabnow.com>

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")




  parent reply	other threads:[~2021-07-21  1:02 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-21  0:46 [bug#49672] [PATCH 0/9] Target check fixes and cleanups Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00 ` [bug#49672] [PATCH 1/9] gnu: Fix check of ‘%current-system’ and ‘%current-target-system’ Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 2/9] utils: Add ‘current-target-nix-system’ helper Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 3/9] gnu: Query membership in ‘supported-systems’ list with Nix identifier Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` Thiago Jung Bauermann via Guix-patches via [this message]
2021-07-21  1:00   ` [bug#49672] [PATCH 5/9] gnu: Use ‘current-target-nix-system’ in prefix checks Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 6/9] gnu: Fix GNU/Linux system detection Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 7/9] bootloader: grub: Fix mix of GNU triplet and Nix system identifier Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 8/9] gnu: ustr: Don’t pass default argument Thiago Jung Bauermann via Guix-patches via
2021-07-21  1:00   ` [bug#49672] [PATCH 9/9] gnu: Use existing target helpers from ‘(guix utils)’ Thiago Jung Bauermann via Guix-patches via
2021-11-07 11:23 ` [bug#49672] [PATCH 0/9] Target check fixes and cleanups Maxime Devos
2021-11-12  0:56   ` Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40 ` [bug#49672] [PATCH v2 0/6] Target check fixes for cross compilation Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 1/6] gnu: Fix GNU/Linux system detection Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 2/6] gnu: libgc: Use default argument in ‘target-hurd?’ call Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 3/6] utils: Introduce the ‘current-target-nix-system’ procedure Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 4/6] gnu: Use ‘current-target-nix-system’ for matches Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 5/6] gnu: Query membership in ‘supported-systems’ list with Nix identifier Thiago Jung Bauermann via Guix-patches via
2022-03-27 21:40   ` [bug#49672] [PATCH v2 6/6] gnu: Fix check of ‘%current-system’ and ‘%current-target-system’ Thiago Jung Bauermann via Guix-patches via
2022-03-28 12:10   ` [bug#49672] [PATCH v2 0/6] Target check fixes for cross compilation Maxime Devos
2022-03-29  0:12     ` Thiago Jung Bauermann via Guix-patches via
2022-04-29  4:17   ` Thiago Jung Bauermann via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210721010043.632012-4-bauermann@kolabnow.com \
    --to=guix-patches@gnu.org \
    --cc=49672@debbugs.gnu.org \
    --cc=bauermann@kolabnow.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.