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

commit 3538379bd3547ebe05d9d9ca2095108e699b6748
Author: Efraim Flashner <[email protected]>
AuthorDate: Thu Dec 12 09:19:24 2024 +0200

    gnu: zig-0.10.0-675: Set host triple.
    
    * gnu/packages/zig.scm (zig-0.10.0-675)[arguments]<#:phases>: Set host 
triple
    in CMakeLists.txt.
    
    Change-Id: Ib05050d7e499b4336a01a140c73fb6c8bb450bd6
    Modified-by: Hilton Chain <[email protected]>
    Signed-off-by: Hilton Chain <[email protected]>
---
 gnu/packages/zig.scm | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 1b25a9cc73..994bfc8b5a 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2021 Liliana Marie Prikler <[email protected]>
 ;;; Copyright © 2021 Sarah Morgensen <[email protected]>
 ;;; Copyright © 2021 Calum Irwin <[email protected]>
-;;; Copyright © 2022, 2023 Efraim Flashner <[email protected]>
+;;; Copyright © 2022-2024 Efraim Flashner <[email protected]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -436,6 +436,17 @@ toolchain.  Among other features it provides
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
+              (add-after 'unpack 'set-host-triple
+                (lambda _
+                  (substitute* "CMakeLists.txt"
+                    (("(set..*HOST_TARGET_TRIPLE \")(.*)(\".*)"
+                      _ prefix _ suffix)
+                     (string-append
+                      prefix
+                      (zig-target
+                       #$(platform-target
+                          (lookup-platform-by-system (%current-system))))
+                      suffix)))))
               (replace 'prepare-source
                 (lambda* (#:key native-inputs inputs #:allow-other-keys)
                   (install-file (search-input-file

Reply via email to