summaryrefslogtreecommitdiff
path: root/gnu/packages/zig.scm
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2023-10-23 22:20:01 +0800
committerHilton Chain <hako@ultrarare.space>2023-11-25 22:00:16 +0800
commitca8dda242873cad762b14cbdb42c8dfa54dd6a1e (patch)
treefe31bde2c9a7e5857e854eed2bf16cfc49a7067c /gnu/packages/zig.scm
parent282927e9705724aa09e89805f87fa2c395356dcf (diff)
gnu: zig-0.10: Use gexp.
* gnu/packages/zig.scm (zig-0.10)[arguments]: Use gexp. Change-Id: I8ba6a4bd92784637cd3a4448e2f99ed521a17f3a
Diffstat (limited to 'gnu/packages/zig.scm')
-rw-r--r--gnu/packages/zig.scm79
1 files 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 @@
(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