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

commit 6301a51c16d9edd814d5afe7d6ff38668801a67e
Author: Efraim Flashner <[email protected]>
AuthorDate: Tue Nov 12 17:31:32 2024 +0800

    gnu: zig: Add 'zig-source' procedure.
    
    * gnu/packages/zig.scm (zig-source): New procedure.
    
    Change-Id: I2ca2cbb3756ebb61f0e3f821e91785ec89ac0c80
---
 gnu/packages/zig.scm | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 6994d48818..e8c0c0b2c3 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -133,6 +133,24 @@ toolchain.  Among other features it provides
                   ,@(clang-compiler-cpu-architectures "13")))
     (license license:expat)))
 
+(define (zig-source version commit hash)
+  (origin
+    (method git-fetch)
+    (uri (git-reference
+          (url "https://github.com/ziglang/zig";)
+          (commit commit)))
+    (file-name (git-file-name "zig" version))
+    (sha256 (base32 hash))
+    (patches (search-patches "zig-use-baseline-cpu-by-default.patch"))
+    (modules '((guix build utils)))
+    (snippet
+     #~(begin
+         (for-each (lambda (file)
+                     (when (file-exists? file)
+                       (delete-file file)))
+                   '("stage1/zig1.wasm"
+                     "stage1/zig1.wasm.zst"))))))
+
 (define-public zig-0.10
   (package
     (inherit zig-0.9)

Reply via email to