summaryrefslogtreecommitdiff
path: root/dev-lang/zig/zig-9999.ebuild
diff options
context:
space:
mode:
authorsin-ack <sin-ack@protonmail.com>2025-02-15 00:46:57 +0500
committerSam James <sam@gentoo.org>2025-02-16 16:24:54 +0000
commit6586ae03e438478e8c2db09b2355b519043c2760 (patch)
tree8f38d84660be197908c1f9d4eaf78418b44cfea3 /dev-lang/zig/zig-9999.ebuild
parenteaaa8b9b68a6d7c6f8d36bced910856c0860413f (diff)
downloadgentoo-6586ae03e438478e8c2db09b2355b519043c2760.tar.gz
gentoo-6586ae03e438478e8c2db09b2355b519043c2760.tar.bz2
gentoo-6586ae03e438478e8c2db09b2355b519043c2760.zip
dev-lang/zig: guard `stage3` calls when cross-compiling
They can't be run when cross-compiling unless user has qemu static-usr enabled and used, which we can't check in ebuild. Therefore, we need to also disallow docs building when cross-compiling for the time being. Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net> Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/zig/zig-9999.ebuild')
-rw-r--r--dev-lang/zig/zig-9999.ebuild14
1 files changed, 11 insertions, 3 deletions
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index dda68889ca43..6b440c6bb88b 100644
--- a/dev-lang/zig/zig-9999.ebuild
+++ b/dev-lang/zig/zig-9999.ebuild
@@ -92,6 +92,11 @@ pkg_setup() {
llvm-r1_pkg_setup
fi
+ # Requires running stage3 which is built for cross-target.
+ if use doc && tc-is-cross-compiler; then
+ die "USE=doc is not yet supported when cross-compiling"
+ fi
+
check-reqs_pkg_setup
}
@@ -197,10 +202,13 @@ src_compile() {
cd "${BUILD_DIR}" || die
ZIG_EXE="./zig2" zig_src_compile --prefix "${BUILD_DIR}/stage3/"
- ./stage3/bin/zig env || die "Zig compilation failed"
+ # Requires running stage3 which is built for cross-target.
+ if ! tc-is-cross-compiler; then
+ ./stage3/bin/zig env || die "Zig compilation failed"
- if use doc; then
- ZIG_EXE="./stage3/bin/zig" zig_src_compile langref --prefix "${S}/docgen/"
+ if use doc; then
+ ZIG_EXE="./stage3/bin/zig" zig_src_compile langref --prefix "${S}/docgen/"
+ fi
fi
}