summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Joldasov <bratishkaerik@getgoogleoff.me>2022-09-02 16:22:36 +0600
committerSam James <sam@gentoo.org>2022-09-05 02:23:50 +0100
commit3e4dcebab96edb125e5089b9fd996ebdd36e23fa (patch)
tree5ddd636ebf1f291fac18fcffe2d249f2a71b0819 /dev-lang
parentapp-emulation/virtualbox-guest-additions: add a module alias (diff)
downloadgentoo-3e4dcebab96edb125e5089b9fd996ebdd36e23fa.tar.gz
gentoo-3e4dcebab96edb125e5089b9fd996ebdd36e23fa.tar.bz2
gentoo-3e4dcebab96edb125e5089b9fd996ebdd36e23fa.zip
dev-lang/zig: always install self-hosted compiler, workaround upstream cmake bugs
Closes: https://bugs.gentoo.org/867592 Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me> Closes: https://github.com/gentoo/gentoo/pull/27112 Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang')
-rw-r--r--dev-lang/zig/files/zig-9999-stage2-fix.patch6
-rw-r--r--dev-lang/zig/metadata.xml3
-rw-r--r--dev-lang/zig/zig-9999.ebuild25
3 files changed, 12 insertions, 22 deletions
diff --git a/dev-lang/zig/files/zig-9999-stage2-fix.patch b/dev-lang/zig/files/zig-9999-stage2-fix.patch
index 610ab6b86623..a2fe945c4a39 100644
--- a/dev-lang/zig/files/zig-9999-stage2-fix.patch
+++ b/dev-lang/zig/files/zig-9999-stage2-fix.patch
@@ -1,12 +1,12 @@
diff --git a/build.zig b/build.zig
-index ac0a161..12f7e15 100644
+index c8e757dc4..b698b5680 100644
--- a/build.zig
+++ b/build.zig
-@@ -562,6 +562,7 @@ fn addCmakeCfgOptionsToExe(
+@@ -577,6 +577,7 @@ fn addCmakeCfgOptionsToExe(
else => |e| return e,
};
exe.linkSystemLibrary("unwind");
+ exe.linkSystemLibrary("c_nonshared");
} else if (exe.target.isFreeBSD()) {
- try addCxxKnownPath(b, cfg, exe, "libc++.a", null, need_cpp_includes);
+ try addCxxKnownPath(b, cfg, exe, b.fmt("libc++.{s}", .{lib_suffix}), null, need_cpp_includes);
exe.linkSystemLibrary("pthread");
diff --git a/dev-lang/zig/metadata.xml b/dev-lang/zig/metadata.xml
index c12ebabd226e..a5a5818faae7 100644
--- a/dev-lang/zig/metadata.xml
+++ b/dev-lang/zig/metadata.xml
@@ -9,9 +9,6 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
- <use>
- <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>
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index 32a064ec02fc..1574aa37588a 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 +threads"
+IUSE="test +threads"
RESTRICT="!test? ( test )"
BUILD_DIR="${S}/build"
@@ -56,34 +56,27 @@ src_configure() {
-DZIG_USE_CCACHE=OFF
-DZIG_SHARED_LLVM=ON
-DZIG_SINGLE_THREADED="$(usex !threads)"
+ -DCMAKE_PREFIX_PATH=$(get_llvm_prefix ${LLVM_MAX_SLOT})
+ -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/stage3"
)
cmake_src_configure
}
-src_compile() {
- cmake_src_compile
-
- if use stage2 ; then
- cd "${BUILD_DIR}" || die
- ./zig build -p stage2 -Dstatic-llvm=false -Denable-llvm=true -Dsingle-threaded="$(usex threads false true)" -Dskip-install-lib-files=true --verbose || die
- fi
-}
-
src_test() {
cd "${BUILD_DIR}" || die
- ./zig build test || die
+ ./stage3/bin/zig build test -Dstatic-llvm=false -Denable-llvm=true || die
}
src_install() {
- cmake_src_install
-
- use stage2 && newbin "${BUILD_DIR}/stage2/bin/zig" zig-stage2
+ cd "${BUILD_DIR}" || die
+ DESTDIR="${D}" ./zig2 build install -Denable-stage1=true -Dstatic-llvm=false -Denable-llvm=true --prefix "${EPREFIX}"/usr || die
+ dodoc ../README.md
}
# see https://github.com/ziglang/zig/issues/3382
-QA_FLAGS_IGNORED="usr/bin/zig-stage2"
+QA_FLAGS_IGNORED="usr/bin/zig"
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"
+ elog "If you want to use stage1 backend, use -fstage1 flag"
}