unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Hilton Chain via Guix-patches via <guix-patches@gnu.org>
To: 66723@debbugs.gnu.org
Cc: Hilton Chain <hako@ultrarare.space>
Subject: [bug#66723] [PATCH 1/3] gnu: zig-0.10: Use gexp.
Date: Tue, 24 Oct 2023 16:34:01 +0800	[thread overview]
Message-ID: <33d45edb223f76b040da723a4b20f3dfaab6ed8f.1698134803.git.hako@ultrarare.space> (raw)
In-Reply-To: <cover.1698134803.git.hako@ultrarare.space>

* gnu/packages/zig.scm (zig-0.10)[arguments]: Use gexp.

Change-Id: I8ba6a4bd92784637cd3a4448e2f99ed521a17f3a
---
 gnu/packages/zig.scm | 79 ++++++++++++++++++++++----------------------
 1 file changed, 40 insertions(+), 39 deletions(-)

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index dcca9a1121..882e5426dc 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -20,6 +20,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages zig)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix utils)
   #:use-module (guix git-download)
@@ -53,45 +54,45 @@ (define-public zig-0.10
     (native-inputs
      (list llvm-15))
     (arguments
-     `(#:configure-flags
-       (list ,@(if (%current-target-system)
-                   '(string-append "-DZIG_TARGET_TRIPLE="
-                                   (%current-target-system))
-                   '())
-             (string-append "-DZIG_TARGET_MCPU=baseline")
-             "-DZIG_SHARED_LLVM=ON"
-             (string-append "-DZIG_LIB_DIR=" (assoc-ref %outputs "out")
-                            "/lib/zig"))
-       #:validate-runpath? #f       ; TODO: zig binary can't find ld-linux.
-       #:out-of-source? #f ; for tests
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'set-env-variables
-           (lambda* (#:key inputs native-inputs #:allow-other-keys)
-             ;; Set CC, since the stage 2 zig relies on it to find the libc
-             ;; installation, and otherwise silently links against its own.
-             (setenv "CC" ,(cc-for-target))
-             ;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
-             (setenv "ZIG_GLOBAL_CACHE_DIR"
-                     (string-append (getcwd) "/zig-cache"))))
-         (add-after 'patch-source-shebangs 'patch-more-shebangs
-           (lambda* (#:key inputs #:allow-other-keys)
-             ;; Zig uses information about /usr/bin/env to determine the
-             ;; version of glibc and other data.
-             (substitute* "lib/std/zig/system/NativeTargetInfo.zig"
-               (("/usr/bin/env") (search-input-file inputs "/bin/env")))))
-         (delete 'check)
-         (add-after 'install 'check
-           (lambda* (#:key outputs tests? #:allow-other-keys)
-             (when tests?
-               (invoke (string-append (assoc-ref outputs "out") "/bin/zig")
-                       "build" "test"
-                       ;; We're not testing the compiler bootstrap chain.
-                       "-Dskip-stage1"
-                       "-Dskip-stage2-tests"
-                       ;; Non-native tests try to link and execute non-native
-                       ;; binaries.
-                       "-Dskip-non-native")))))))
+     (list
+      #:configure-flags
+      #~(list #$@(if (%current-target-system)
+                     (list (string-append "-DZIG_TARGET_TRIPLE="
+                                          (%current-target-system)))
+                     '())
+              "-DZIG_TARGET_MCPU=baseline"
+              "-DZIG_SHARED_LLVM=ON"
+              (string-append "-DZIG_LIB_DIR=" #$output "/lib/zig"))
+      #:validate-runpath? #f            ;TODO: zig binary can't find ld-linux.
+      #:out-of-source? #f               ;for tests
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'set-env-variables
+            (lambda _
+              ;; Set CC, since the stage 2 zig relies on it to find the libc
+              ;; installation, and otherwise silently links against its own.
+              (setenv "CC" #$(cc-for-target))
+              ;; Set cache dir, otherwise Zig looks for `$HOME/.cache'.
+              (setenv "ZIG_GLOBAL_CACHE_DIR"
+                      (string-append (getcwd) "/zig-cache"))))
+          (add-after 'patch-source-shebangs 'patch-more-shebangs
+            (lambda* (#:key inputs #:allow-other-keys)
+              ;; Zig uses information about /usr/bin/env to determine the
+              ;; version of glibc and other data.
+              (substitute* "lib/std/zig/system/NativeTargetInfo.zig"
+                (("/usr/bin/env") (search-input-file inputs "/bin/env")))))
+          (delete 'check)
+          (add-after 'install 'check
+            (lambda* (#:key tests? #:allow-other-keys)
+              (when tests?
+                (invoke (string-append #$output "/bin/zig")
+                        "build" "test"
+                        ;; We're not testing the compiler bootstrap chain.
+                        "-Dskip-stage1"
+                        "-Dskip-stage2-tests"
+                        ;; Non-native tests try to link and execute non-native
+                        ;; binaries.
+                        "-Dskip-non-native")))))))
     (native-search-paths
      (list
       (search-path-specification
-- 
2.41.0





  reply	other threads:[~2023-10-24  8:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-24  8:23 [bug#66723] [PATCH 0/3] gnu: zig-0.10: Inherit from zig-0.9 Hilton Chain via Guix-patches via
2023-10-24  8:34 ` Hilton Chain via Guix-patches via [this message]
2023-10-24  8:34 ` [bug#66723] [PATCH 2/3] gnu: zig-0.9: Use gexp Hilton Chain via Guix-patches via
2023-10-24  8:34 ` [bug#66723] [PATCH 3/3] gnu: zig-0.10: Inherit from zig-0.9 Hilton Chain via Guix-patches via
2023-11-19 11:35 ` [bug#66723] [PATCH 0/3] " guix-patches--- via
2023-11-23 15:23   ` Hilton Chain via Guix-patches via
2023-11-23 16:23     ` Ekaitz Zarraga
2023-11-25 14:10     ` bug#66723: " Hilton Chain via Guix-patches via
2023-11-22 12:12 ` [bug#66723] " Ludovic Courtès

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=33d45edb223f76b040da723a4b20f3dfaab6ed8f.1698134803.git.hako@ultrarare.space \
    --to=guix-patches@gnu.org \
    --cc=66723@debbugs.gnu.org \
    --cc=hako@ultrarare.space \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).