diff --git a/packages/zig/build.sh b/packages/zig/build.sh index 488d86ad1453105..a922cb1ea060d49 100644 --- a/packages/zig/build.sh +++ b/packages/zig/build.sh @@ -4,6 +4,7 @@ TERMUX_PKG_LICENSE="MIT" TERMUX_PKG_LICENSE_FILE="zig/LICENSE" TERMUX_PKG_MAINTAINER="@termux" TERMUX_PKG_VERSION="0.13.0" +TERMUX_PKG_REVISION=1 TERMUX_PKG_SRCURL=https://github.com/ziglang/zig/releases/download/${TERMUX_PKG_VERSION}/zig-bootstrap-${TERMUX_PKG_VERSION}.tar.xz TERMUX_PKG_SHA256=cd446c084b5da7bc42e8ad9b4e1c910a957f2bf3f82bcc02888102cd0827c139 TERMUX_PKG_BUILD_IN_SRC=true diff --git a/packages/zig/lib-std-zig-system.zig.patch b/packages/zig/lib-std-zig-system.zig.patch new file mode 100644 index 000000000000000..764e10b2a0bd109 --- /dev/null +++ b/packages/zig/lib-std-zig-system.zig.patch @@ -0,0 +1,15 @@ +diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig +index 83c798c34..8eebdb857 100644 +--- a/zig/lib/std/zig/system.zig ++++ b/zig/lib/std/zig/system.zig +@@ -988,7 +988,9 @@ fn detectAbiAndDynamicLinker( + // if it finds one, then instead of using /usr/bin/env as the ELF file to examine, it uses the file it references instead, + // doing the same logic recursively in case it finds another shebang line. + +- var file_name: []const u8 = switch (os.tag) { ++ var file_name: []const u8 = if (os.tag.isAndroid()) ++ "@TERMUX_PREFIX@/bin/env" ++ else switch (os.tag) { + // Since /usr/bin/env is hard-coded into the shebang line of many portable scripts, it's a + // reasonably reliable path to start with. + else => "/usr/bin/env",