guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

58/60: build/zig: Adjust the build triplets for some systems.


From: guix-commits
Subject: 58/60: build/zig: Adjust the build triplets for some systems.
Date: Mon, 18 Nov 2024 07:16:56 -0500 (EST)

hako pushed a commit to branch wip-zig-bootstrap
in repository guix.

commit eb7b92f8e6644ba078c7cb2d556b96fb51762dcf
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Sat Nov 16 23:16:36 2024 +0200

    build/zig: Adjust the build triplets for some systems.
    
    * guix/build/zig-build-system.scm (zig-target): New procedure.
    (build): Use it to set the target when cross-compiling.
    
    Change-Id: Ic82253ce899055526e894a0cb67738ddbb476574
---
 guix/build/zig-build-system.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/guix/build/zig-build-system.scm b/guix/build/zig-build-system.scm
index cacd6219c8..cb3015829b 100644
--- a/guix/build/zig-build-system.scm
+++ b/guix/build/zig-build-system.scm
@@ -56,6 +56,17 @@ gcc_dir=")
      port)
     (close-port port)))
 
+(define (zig-target target)
+  (cond ((string=? "i686-linux-gnu" target)
+         "x86-linux-gnu")
+        ((string=? "i586-pc-gnu" target)
+         "x86-hurd-gnu")
+        ((string=? "x86_64-w64-mingw32" target)
+         "x86_64-windows-gnu")
+        ((string=? "i686-w64-mingw32" target)
+         "x86-windows-gnu")
+        (else target)))
+
 (define* (build #:key
                 zig-build-flags
                 zig-release-type       ;; "safe", "fast" or "small" empty for a
@@ -71,7 +82,7 @@ gcc_dir=")
                      "--prefix-exe-dir"     "bin"
                      "--prefix-include-dir" "include"
                      ,@(if target
-                         (list (string-append "-Dtarget=" target))
+                         (list (string-append "-Dtarget=" (zig-target target)))
                          '())
                      ,@(if zig-release-type
                          (list (string-append "-Drelease-" zig-release-type))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]