aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHilton Chain <hako@ultrarare.space>2024-11-11 10:47:20 +0800
committerHilton Chain <hako@ultrarare.space>2024-12-31 10:54:11 +0800
commit530f87e40695404f0f315bd56f14f232c4170925 (patch)
treec762d04c4bebd59d72e9332b5555586b161bf530
parent003ec2756fd72b08ac8bbeed4013b133f63a7cad (diff)
downloadguix-530f87e40695404f0f315bd56f14f232c4170925.tar.gz
guix-530f87e40695404f0f315bd56f14f232c4170925.zip
gnu: Add zig-0.10.0-675.
* gnu/packages/patches/zig-0.10.0-675-TypeOf-hack.patch: New file. * gnu/local.mk (dist_patch_DATA): Regisiter it. * gnu/packages/zig.scm (zig-0.10.0-675): New variable. Change-Id: Id508a2611bbfbbe5fc5a104d76209e9168b1596d
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/zig-0.10.0-675-TypeOf-hack.patch48
-rw-r--r--gnu/packages/zig.scm45
3 files changed, 94 insertions, 0 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index bfe73bc54a..2aea9ffe0b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2420,6 +2420,7 @@ dist_patch_DATA = \
%D%/packages/patches/zig-0.10-fix-runpath.patch \
%D%/packages/patches/zig-0.10-use-system-paths.patch \
%D%/packages/patches/zig-0.10.0-610-bootstrap-resolve-conflicts.patch \
+ %D%/packages/patches/zig-0.10.0-675-TypeOf-hack.patch \
%D%/packages/patches/zsh-egrep-failing-test.patch \
%D%/packages/patches/zuo-bin-sh.patch
diff --git a/gnu/packages/patches/zig-0.10.0-675-TypeOf-hack.patch b/gnu/packages/patches/zig-0.10.0-675-TypeOf-hack.patch
new file mode 100644
index 0000000000..3019645556
--- /dev/null
+++ b/gnu/packages/patches/zig-0.10.0-675-TypeOf-hack.patch
@@ -0,0 +1,48 @@
+From f4392c034ca6fe003e828b8255c635003d4f6c36 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= <motiejus@jakstys.lt>
+Date: Sun, 3 Nov 2024 22:20:13 +0200
+Subject: [PATCH] 0.10.0-675-g9d93b2ccf1 @TypeOf hack
+
+---
+ lib/std/log.zig | 4 ++--
+ src/link/strtab.zig | 2 +-
+ 2 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/lib/std/log.zig b/lib/std/log.zig
+index 9ebe85c004..f174946565 100644
+--- a/lib/std/log.zig
++++ b/lib/std/log.zig
+@@ -121,7 +121,7 @@ else
+
+ fn log(
+ comptime message_level: Level,
+- comptime scope: @Type(.EnumLiteral),
++ comptime scope: @TypeOf(.EnumLiteral),
+ comptime format: []const u8,
+ args: anytype,
+ ) void {
+@@ -167,7 +167,7 @@ pub fn defaultLog(
+
+ /// Returns a scoped logging namespace that logs all messages using the scope
+ /// provided here.
+-pub fn scoped(comptime scope: @Type(.EnumLiteral)) type {
++pub fn scoped(comptime scope: @TypeOf(.EnumLiteral)) type {
+ return struct {
+ /// Log an error message. This log level is intended to be used
+ /// when something has gone wrong. This might be recoverable or might
+diff --git a/src/link/strtab.zig b/src/link/strtab.zig
+index abb58defef..2048aa216e 100644
+--- a/src/link/strtab.zig
++++ b/src/link/strtab.zig
+@@ -5,7 +5,7 @@ const Allocator = mem.Allocator;
+ const StringIndexAdapter = std.hash_map.StringIndexAdapter;
+ const StringIndexContext = std.hash_map.StringIndexContext;
+
+-pub fn StringTable(comptime log_scope: @Type(.EnumLiteral)) type {
++pub fn StringTable(comptime log_scope: @TypeOf(.EnumLiteral)) type {
+ return struct {
+ const Self = @This();
+
+--
+2.44.1
+
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 30fa94b729..6ccbffed54 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -363,4 +363,49 @@ toolchain. Among other features it provides
(delete "glibc-abi-tool")))
(outputs '("out" "zig1")))))
+;; Supply zig1.wasm.zst, build zig2 + zig1.wasm, install zig2 + zig1.wasm.zst.
+(define zig-0.10.0-675
+ (let ((commit "9d93b2ccf11f584320a2c5209dd2d94705167695")
+ (revision "675")
+ (base zig-0.10.0-610))
+ (package
+ (inherit base)
+ (name "zig")
+ (version (git-version "0.10.0" revision commit))
+ (source
+ (origin
+ (inherit (zig-source
+ version commit
+ "1qsfsv8wg0kz616sgj7dw9ihdz5rsm80p3ambl5lnkrjhwym7z7x"))
+ (patches (search-patches "zig-0.10.0-675-TypeOf-hack.patch"))))
+ (arguments
+ (substitute-keyword-arguments (package-arguments base)
+ ((#:phases phases '%standard-phases)
+ #~(modify-phases #$phases
+ (replace 'prepare-source
+ (lambda* (#:key native-inputs inputs #:allow-other-keys)
+ (install-file (search-input-file
+ (or native-inputs inputs) "bin/zig1.wasm.zst")
+ "stage1")))
+ (add-after 'prepare-source 'remove-stage3
+ (lambda _
+ ;; Multiline substitution.
+ (invoke
+ "sed" "--in-place" "/^add_custom_target(stage3/,/^)$/d"
+ "CMakeLists.txt")))
+ (replace 'install
+ (lambda _
+ (install-file "zig2" (string-append #$output "/bin"))
+ (mkdir-p (string-append #$output "/lib"))
+ (copy-recursively "lib" (string-append #$output "/lib/zig"))))
+ (replace 'build-zig1
+ (lambda _
+ (invoke "./zig2" "build" "update-zig1" "--verbose")))
+ (delete 'patch-more-shebangs)
+ (delete 'backup-source)
+ (delete 'restore-source)))))
+ (native-inputs
+ (modify-inputs (package-native-inputs base)
+ (prepend `(,base "zig1")))))))
+
(define-public zig zig-0.10)