guix-commits
[Top][All Lists]
Advanced

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

branch wip-zig-bootstrap updated: gnu: zig-0.10.0-675: Fix architecture


From: guix-commits
Subject: branch wip-zig-bootstrap updated: gnu: zig-0.10.0-675: Fix architecture detection on powerpc64le-linux.
Date: Thu, 12 Dec 2024 02:21:57 -0500

This is an automated email from the git hooks/post-receive script.

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

The following commit(s) were added to refs/heads/wip-zig-bootstrap by this push:
     new 565c932ab8 gnu: zig-0.10.0-675: Fix architecture detection on 
powerpc64le-linux.
565c932ab8 is described below

commit 565c932ab8ed44d5b577e801677e9824260a9d52
Author: Efraim Flashner <efraim@flashner.co.il>
AuthorDate: Thu Dec 12 09:19:24 2024 +0200

    gnu: zig-0.10.0-675: Fix architecture detection on powerpc64le-linux.
    
    * gnu/packages/zig.scm (zig-0.10.0-675)[arguments]: When building for
    powerpc64le-linux add a phase to help cmake and zig agree on the name of
    the architecture.
    
    Change-Id: Ib05050d7e499b4336a01a140c73fb6c8bb450bd6
---
 gnu/packages/zig.scm | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index df7dcd3816..06c7d26d3f 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2021 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev>
 ;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
-;;; Copyright © 2022, 2023 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2022-2024 Efraim Flashner <efraim@flashner.co.il>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -439,6 +439,27 @@ toolchain.  Among other features it provides
        (substitute-keyword-arguments (package-arguments base)
          ((#:phases phases '%standard-phases)
           #~(modify-phases #$phases
+              #$@(if (target-ppc64le?)
+                     ;; CMake and zig disagree about the name of the 
architecture.
+                     #~((add-after 'unpack 'fix-cmake-processor-detection
+                          (lambda _
+                            (substitute* "CMakeLists.txt"
+                              ;; Starting from 0.10.0-574
+                              (("elseif\\(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL 
\"arm64\"\\)" all)
+                               (string-append
+                                 "elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL 
\"ppc64le\")\n"
+                                 "  set(HOST_TARGET_ARCH \"powerpc64le\")\n" 
all))
+                              ;; Starting from 0.10.0-1081
+                              (("elseif\\(HOST_TARGET_ARCH STREQUAL 
\"arm64\"\\)" all)
+                               (string-append
+                                 "elseif(HOST_TARGET_ARCH STREQUAL 
\"ppc64le\")\n"
+                                 "  set(HOST_TARGET_ARCH \"powerpc64le\")\n" 
all))
+                              ;; Starting from 0.10.0-3937
+                              (("elseif\\(ZIG_HOST_TARGET_ARCH STREQUAL 
\"arm64\"\\)" all)
+                               (string-append
+                                 "elseif(ZIG_HOST_TARGET_ARCH STREQUAL 
\"ppc64le\")\n"
+                                 "  set(ZIG_HOST_TARGET_ARCH 
\"powerpc64le\")\n" all))))))
+                     #~())
               (replace 'prepare-source
                 (lambda* (#:key native-inputs inputs #:allow-other-keys)
                   (install-file (search-input-file



reply via email to

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