commit: eaaa8b9b68a6d7c6f8d36bced910856c0860413f
Author: Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Tue Dec 17 21:23:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Feb 16 16:24:54 2025 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eaaa8b9b
dev-lang/zig: add `debug` USE-flag
Controls debug extensions such as `zig dump-zir` or
`zig build-exe --debug-compile-errors` and can change default when
building Zig itself from `ReleaseFast` to `ReleaseSafe`.
Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>
dev-lang/zig/metadata.xml | 1 +
dev-lang/zig/{zig-9999.ebuild => zig-0.13.0-r3.ebuild} | 16 +++++++++++++---
dev-lang/zig/zig-9999.ebuild | 7 +++++--
3 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/dev-lang/zig/metadata.xml b/dev-lang/zig/metadata.xml
index 2364982009cc..34e44a88bfa3 100644
--- a/dev-lang/zig/metadata.xml
+++ b/dev-lang/zig/metadata.xml
@@ -10,6 +10,7 @@
<name>Proxy Maintainers</name>
</maintainer>
<use>
+ <flag name="debug">Build with debug extensions enabled.</flag>
<flag name="llvm">Build with LLVM backend and extensions
enabled.</flag>
</use>
<upstream>
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-0.13.0-r3.ebuild
similarity index 93%
copy from dev-lang/zig/zig-9999.ebuild
copy to dev-lang/zig/zig-0.13.0-r3.ebuild
index 9fe4558461eb..5d982900f831 100644
--- a/dev-lang/zig/zig-9999.ebuild
+++ b/dev-lang/zig/zig-0.13.0-r3.ebuild
@@ -3,7 +3,7 @@
EAPI=8
-LLVM_COMPAT=( 19 )
+LLVM_COMPAT=( 18 )
LLVM_OPTIONAL=1
ZIG_SLOT="$(ver_cut 1-2)"
@@ -24,6 +24,7 @@ else
SRC_URI="
https://ziglang.org/download/${PV}/${P}.tar.xz
verify-sig? (
https://ziglang.org/download/${PV}/${P}.tar.xz.minisig )
+
https://codeberg.org/BratishkaErik/distfiles/releases/download/dev-lang%2Fzig-${PV}/${P}-llvm-18.1.8-r6-fix.patch
"
KEYWORDS="~amd64 ~arm ~arm64"
@@ -43,7 +44,7 @@ fi
# lib/libc/glibc: BSD HPND ISC inner-net LGPL-2.1+
LICENSE="MIT Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) || (
Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain BSD-2 ZPL
ISC HPND BSD inner-net LGPL-2.1+"
SLOT="${ZIG_SLOT}"
-IUSE="doc +llvm"
+IUSE="debug doc +llvm"
REQUIRED_USE="
!llvm? ( !doc )
llvm? ( ${LLVM_REQUIRED_USE} )
@@ -74,6 +75,12 @@ IDEPEND="app-eselect/eselect-zig"
DOCS=( "README.md" "doc/build.zig.zon.md" )
+PATCHES=(
+ "${FILESDIR}/zig-0.13.0-test-std-kernel-version.patch"
+ "${FILESDIR}/zig-0.13.0-skip-test-stack_iterator.patch"
+ "${DISTDIR}/${P}-llvm-18.1.8-r6-fix.patch"
+)
+
# zig.eclass does not set this for us since we use ZIG_OPTIONAL=1
QA_FLAGS_IGNORED="usr/.*/zig/${PV}/bin/zig"
@@ -142,7 +149,10 @@ src_configure() {
-Dno-langref
-Dstd-docs=false
- --release=fast
+ # More commands and options if "debug" is enabled.
+ -Ddebug-extensions=$(usex debug true false)
+ # More asserts and so on by default if "debug" is enabled.
+ --release=$(usex debug safe fast)
)
if use llvm; then
my_zbs_args+=(
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index 9fe4558461eb..dda68889ca43 100644
--- a/dev-lang/zig/zig-9999.ebuild
+++ b/dev-lang/zig/zig-9999.ebuild
@@ -43,7 +43,7 @@ fi
# lib/libc/glibc: BSD HPND ISC inner-net LGPL-2.1+
LICENSE="MIT Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT ) || (
Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain BSD-2 ZPL
ISC HPND BSD inner-net LGPL-2.1+"
SLOT="${ZIG_SLOT}"
-IUSE="doc +llvm"
+IUSE="debug doc +llvm"
REQUIRED_USE="
!llvm? ( !doc )
llvm? ( ${LLVM_REQUIRED_USE} )
@@ -142,7 +142,10 @@ src_configure() {
-Dno-langref
-Dstd-docs=false
- --release=fast
+ # More commands and options if "debug" is enabled.
+ -Ddebug-extensions=$(usex debug true false)
+ # More asserts and so on by default if "debug" is enabled.
+ --release=$(usex debug safe fast)
)
if use llvm; then
my_zbs_args+=(