guix-commits
[Top][All Lists]
Advanced

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

01/81: gnu: zig: Add 'zig-source' procedure.


From: guix-commits
Subject: 01/81: gnu: zig: Add 'zig-source' procedure.
Date: Thu, 5 Dec 2024 01:33:20 -0500 (EST)

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

commit 152da7a03c16dbb435f79e53750c8a3aeacb1b7d
Author: Efraim Flashner <efraim@flashner.co.il>
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 | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 6994d48818..ea06bd7c69 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -31,6 +31,30 @@
   #:use-module (gnu packages llvm)
   #:use-module (gnu packages llvm-meta))
 
+(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))
+    (modules '((guix build utils)))
+    (snippet
+     #~(for-each
+        (lambda (file)
+          (when (file-exists? file)
+            (delete-file file)))
+        (append
+         '("stage1/zig1.wasm"
+           "stage1/zig1.wasm.zst")
+         ;; Generated from glibc sources, see also:
+         ;; https://github.com/ziglang/zig/blob/master/lib/libc/glibc/README.md
+         ;; https://github.com/ziglang/glibc-abi-tool
+         '("lib/libc/glibc/abilists")
+         ;; IETF RFC documents have nonfree license.
+         (find-files "." "^rfc[0-9]+\\.txt"))))))
+
 (define-public zig-0.9
   (package
     (name "zig")



reply via email to

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