summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBratishkaErik <bratishkaerik@getgoogleoff.me>2022-05-20 18:19:18 +0600
committerJoonas Niilola <juippis@gentoo.org>2022-05-27 10:45:27 +0300
commite65424f0cda5754051c5b5a7178030cd45273ff8 (patch)
treedf3a69d437738c44321acde0a3b5cd47e5ae1833 /dev-lang
parentdev-python/exceptiongroup: Remove old (diff)
downloadgentoo-e65424f0cda5754051c5b5a7178030cd45273ff8.tar.gz
gentoo-e65424f0cda5754051c5b5a7178030cd45273ff8.tar.bz2
gentoo-e65424f0cda5754051c5b5a7178030cd45273ff8.zip
dev-lang/zig: add threads USE flag
Signed-off-by: BratishkaErik <bratishkaerik@getgoogleoff.me> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/zig/files/zig-0.9.1-fix-single-threaded.patch13
-rw-r--r--dev-lang/zig/zig-0.9.1.ebuild5
-rw-r--r--dev-lang/zig/zig-9999.ebuild5
3 files changed, 20 insertions, 3 deletions
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/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..c63dc88b02c2 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
}