summaryrefslogtreecommitdiff
path: root/dev-lang/zig
diff options
context:
space:
mode:
Diffstat (limited to 'dev-lang/zig')
-rw-r--r--dev-lang/zig/Manifest7
-rw-r--r--dev-lang/zig/files/zig-0.9.1-fix-single-threaded.patch13
-rw-r--r--dev-lang/zig/metadata.xml3
-rw-r--r--dev-lang/zig/zig-0.9.1.ebuild5
-rw-r--r--dev-lang/zig/zig-9999.ebuild8
5 files changed, 29 insertions, 7 deletions
diff --git a/dev-lang/zig/Manifest b/dev-lang/zig/Manifest
index fcfd15c9ee24..b57685346da2 100644
--- a/dev-lang/zig/Manifest
+++ b/dev-lang/zig/Manifest
@@ -1,5 +1,6 @@
+AUX zig-0.9.1-fix-single-threaded.patch 390 BLAKE2B 443a5ab709aa90ed92636310c204a15cbb60a997ff39f7f7102fdd4f21f66e64bd79516653729ecbd719aeb39809457c3db2d1c3c9d0614d1fb637307cc2a892 SHA512 f4e6f87a3aae5380c3f3e1eda85f10914119a378dd08c8375d18dd038dc0b131234a62fd86f46f64cd2038e5abd787e4a7876929fceac85b01bd6e4bce3b3263
AUX zig-9999-stage2-fix.patch 474 BLAKE2B aa88bf7e75482f540a5d18dbe8cdd1ab58cacf7f71ac0f66b334d63b9be697c6a7e9ca4e23cee9d2b82936502b8d8e150026873a3858bf5ccb49f4cd4f9632e6 SHA512 0637f6a4e86232df88097db4cd8670521a8bd3fa7378395c508ca5397425166988ad30f0e249347bc0e2f8473a96a81da54bf2ae0215d3b531a751c4bd3c8b8c
DIST zig-0.9.1.tar.xz 13940828 BLAKE2B 996b0e945f61b01dddbb7c8674a9e2d2d01b93eb48fdfd2c986496330990ffa64cba15f8bd8518b90ef6f514759ba6cc3fd31d6044c5b11b92bf92e3f7f15303 SHA512 0b8a5f9b7e34e4252536f59bc91429f1e76b2bf8e01f024095919f6ecf34db56b5c86c554fbb94bdcb5255394c87f2c87519c8f34c631f53816927ec0882ae2d
-EBUILD zig-0.9.1.ebuild 1540 BLAKE2B fe9da8b7a8a42d349d47f5d202ac1494bf7cd044eecbad630dfd35c8e03e8ea4698bd1c4c2f65c22307762313adbda5542de722e53cded36cc4a3ab79e2d30f4 SHA512 abf4322aafdd24f37af8a727c1a169e81632656b29f9928ba0c011bb7accb7a927dcf54743f60dabd0197497f54e9d1c98893b597e4dd17c7cefdeb626319fc4
-EBUILD zig-9999.ebuild 2121 BLAKE2B b41d0d32b68ec7a2f90fb330062d5fa94912702bee90cd1acefb6a36b3b52cd36e858d8d99fd9194eca44c31807bc096bbba0b0e06b773974337e91be01fb5bf SHA512 c327c4e049003c5b26680df04282f75369d6ddb0df255ca128d2addf6b30d893af64357b70d30eef197f32d4bc7f785e3ca1cf7e71d9b78bcad381ffe55e7bb4
-MISC metadata.xml 320 BLAKE2B 20955b199c9cfc4210b1dc83ec5c564279e0eb8465e46cd5bca9dbfa0efb2efa5a3578aad2a77442e057a86c813cebcd44a5a1941289875c3f1a0a46040b3d03 SHA512 fefe763923440634a475def649c5841fe21d0d8df1651ce7cf3f2e3d84f1e5f8fbc3a6eb8bda84cd1b7b3295146b6a8a9afab0749cbc36d5167d24bcc258fb67
+EBUILD zig-0.9.1.ebuild 1654 BLAKE2B 9ef9f83c3a69a6d7757c964a1f4b3e1109de98654bc40951e95bd99278ae0e20e80c5468a4b8156358e773478eccc3f536e896a95718f00ee6a8dcecf267f218 SHA512 622061b326afd67878d20385af2d06f50b475f1372f64668d85954adde9f5033313f44923877bf95e5bd99e85901d19e7ddc36f2bf4915250ca2bcd5885297c9
+EBUILD zig-9999.ebuild 2315 BLAKE2B d15c17c503357e35cdf2165b09564f0eb82c2f4abf550dce3535e71bab9cfbfae76c492ead7d255060bab48b06e74470f20da6ef2097f8dd91816f10ac1f952c SHA512 1d3c2d77b8abbc2979f80fa4af3c4c3524644b55a7afd3efbee58dfee6b031f43f6b7d9611e3a0abcdbdfbb4085380b0cfb37356a13ddc2b5c3e42919edf8fab
+MISC metadata.xml 439 BLAKE2B 0284fd16d5ea4cf989e1558a5194d777c17ff976f8f69c97f3a245f5c412733ba0eaf4c9cdfea6b618988430e01e545d0a0016b6f3017614194a5152a66c2f59 SHA512 a7b020d023d41ac30bfc3cd2344ae176d49d3f7c43b284f4675588b089de388c4e631c4216758b6ba8b12497b28761a41165562cdf50a48cab15784bcb9c3396
diff --git a/dev-lang/zig/files/zig-0.9.1-fix-single-threaded.patch b/dev-lang/zig/files/zig-0.9.1-fix-single-threaded.patch
new file mode 100644
index 000000000000..70f807f2d550
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.9.1-fix-single-threaded.patch
@@ -0,0 +1,13 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 638f39f7e..791477c41 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -787,7 +787,7 @@ else()
+ set(ZIG1_RELEASE_ARG -OReleaseFast --strip)
+ endif()
+ if(ZIG_SINGLE_THREADED)
+- set(ZIG1_SINGLE_THREADED_ARG "-fsingle-threaded")
++ set(ZIG1_SINGLE_THREADED_ARG "--single-threaded")
+ else()
+ set(ZIG1_SINGLE_THREADED_ARG "")
+ endif()
diff --git a/dev-lang/zig/metadata.xml b/dev-lang/zig/metadata.xml
index 6555f4c1c940..e74e7f06b800 100644
--- a/dev-lang/zig/metadata.xml
+++ b/dev-lang/zig/metadata.xml
@@ -3,9 +3,10 @@
<pkgmetadata>
<!-- maintainer-needed -->
<use>
- <flag name="stage2">Install stage2 alongside stage1</flag>
+ <flag name="stage2">Install stage2 compiler (written in Zig) alongside stage1 compiler (written in C++ and Zig)</flag>
</use>
<upstream>
<remote-id type="github">ziglang/zig</remote-id>
+ <bugs-to>https://github.com/ziglang/zig/issues</bugs-to>
</upstream>
</pkgmetadata>
diff --git a/dev-lang/zig/zig-0.9.1.ebuild b/dev-lang/zig/zig-0.9.1.ebuild
index a0e3522a22a0..18dd79a4bbad 100644
--- a/dev-lang/zig/zig-0.9.1.ebuild
+++ b/dev-lang/zig/zig-0.9.1.ebuild
@@ -18,9 +18,11 @@ fi
LICENSE="MIT"
SLOT="0"
-IUSE="test"
+IUSE="test +threads"
RESTRICT="!test? ( test )"
+PATCHES=("${FILESDIR}/${P}-fix-single-threaded.patch")
+
BUILD_DIR="${S}/build"
# According to zig's author, zig builds that do not support all targets are not
@@ -56,6 +58,7 @@ src_configure() {
local mycmakeargs=(
-DZIG_USE_CCACHE=OFF
-DZIG_PREFER_CLANG_CPP_DYLIB=ON
+ -DZIG_SINGLE_THREADED="$(usex threads OFF ON)"
)
cmake_src_configure
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index cdac1427ee7e..87dc59b0c0c7 100644
--- a/dev-lang/zig/zig-9999.ebuild
+++ b/dev-lang/zig/zig-9999.ebuild
@@ -18,7 +18,7 @@ fi
LICENSE="MIT"
SLOT="0"
-IUSE="test +stage2"
+IUSE="test +stage2 +threads"
RESTRICT="!test? ( test )"
BUILD_DIR="${S}/build"
@@ -59,6 +59,7 @@ src_configure() {
local mycmakeargs=(
-DZIG_USE_CCACHE=OFF
-DZIG_PREFER_CLANG_CPP_DYLIB=ON
+ -DZIG_SINGLE_THREADED="$(usex threads OFF ON)"
)
cmake_src_configure
@@ -69,7 +70,7 @@ src_compile() {
if use stage2 ; then
cd "${BUILD_DIR}" || die
- ./zig build -p stage2 -Dstatic-llvm=false -Denable-llvm=true || die
+ ./zig build -p stage2 -Dstatic-llvm=false -Denable-llvm=true -Dsingle-threaded="$(usex threads false true)" || die
fi
}
@@ -88,6 +89,9 @@ src_install() {
fi
}
+# see https://github.com/ziglang/zig/issues/3382
+QA_FLAGS_IGNORED="/usr/bin/zig-stage2"
+
pkg_postinst() {
use stage2 && elog "You enabled stage2 USE flag, Zig stage1 was installed as /usr/bin/zig, Zig stage2 was installed as /usr/bin/zig-stage2"
}