public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2022-10-18 15:00 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2022-10-18 15:00 UTC (permalink / raw
  To: gentoo-commits

commit:     b15d873b0f867c6b2fe6c763bf859ea79ea41074
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Mon Oct 10 03:16:41 2022 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 18 15:00:45 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b15d873b

dev-lang/zig: fix building with Clang 16, fix searching LLD

Upstream PR https://github.com/ziglang/zig/pull/13121

Closes: https://bugs.gentoo.org/877231
Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Closes: https://github.com/gentoo/gentoo/pull/27718
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/zig/files/zig-0.9.1-fix-clang16.patch     | 23 ++++++++++++++++++++++
 .../{zig-0.9.1-r2.ebuild => zig-0.9.1-r3.ebuild}   |  2 ++
 2 files changed, 25 insertions(+)

diff --git a/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch b/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch
new file mode 100644
index 000000000000..deb563378d76
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.9.1-fix-clang16.patch
@@ -0,0 +1,23 @@
+From: Eric Joldasov <bratishkaerik@getgoogleoff.me>
+Fix building with Clang 16
+Upstream PR https://github.com/ziglang/zig/pull/13121
+
+--- a/src/stage1/parse_f128.c
++++ b/src/stage1/parse_f128.c
+@@ -983,14 +983,14 @@ static int isspace(int c)
+     return c == ' ' || (unsigned)c-'\t' < 5;
+ }
+ 
+-static inline float128_t makeInf128() {
++static inline float128_t makeInf128(void) {
+     union ldshape ux;
+     ux.i2.hi = 0x7fff000000000000UL;
+     ux.i2.lo = 0x0UL;
+     return ux.f;
+ }
+ 
+-static inline float128_t makeNaN128() {
++static inline float128_t makeNaN128(void) {
+     uint64_t rand = 0UL;
+     union ldshape ux;
+     ux.i2.hi = 0x7fff000000000000UL | (rand & 0xffffffffffffUL);

diff --git a/dev-lang/zig/zig-0.9.1-r2.ebuild b/dev-lang/zig/zig-0.9.1-r3.ebuild
similarity index 94%
rename from dev-lang/zig/zig-0.9.1-r2.ebuild
rename to dev-lang/zig/zig-0.9.1-r3.ebuild
index 4adbe994a8f3..463cead06e2d 100644
--- a/dev-lang/zig/zig-0.9.1-r2.ebuild
+++ b/dev-lang/zig/zig-0.9.1-r3.ebuild
@@ -23,6 +23,7 @@ IUSE="test +threads"
 RESTRICT="!test? ( test )"
 
 PATCHES=(
+	"${FILESDIR}/${P}-fix-clang16.patch"
 	"${FILESDIR}/${P}-fix-single-threaded.patch"
 	"${FILESDIR}/${P}-fix-riscv.patch"
 	"${FILESDIR}/${P}-fix-bad-hostname-segfault.patch"
@@ -59,6 +60,7 @@ src_configure() {
 		-DZIG_USE_CCACHE=OFF
 		-DZIG_PREFER_CLANG_CPP_DYLIB=ON
 		-DZIG_SINGLE_THREADED="$(usex !threads)"
+		-DCMAKE_PREFIX_PATH=$(get_llvm_prefix ${LLVM_MAX_SLOT})
 	)
 
 	cmake_src_configure


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2024-08-23  2:08 Eli Schwartz
  0 siblings, 0 replies; 7+ messages in thread
From: Eli Schwartz @ 2024-08-23  2:08 UTC (permalink / raw
  To: gentoo-commits

commit:     1adc0bf0ee5b5f6328cae09f925ad75d3c01af01
Author:     Eric Joldasov <bratishkaerik <AT> landless-city <DOT> net>
AuthorDate: Wed Aug  7 10:30:40 2024 +0000
Commit:     Eli Schwartz <eschwartz <AT> gentoo <DOT> org>
CommitDate: Fri Aug 23 02:03:14 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1adc0bf0

dev-lang/zig: drop 0.11.0-r1, 0.12.0

Signed-off-by: Eric Joldasov <bratishkaerik <AT> landless-city.net>
Closes: https://github.com/gentoo/gentoo/pull/38005
Signed-off-by: Eli Schwartz <eschwartz <AT> gentoo.org>

 dev-lang/zig/Manifest                              |   4 -
 .../zig/files/zig-0.11.0-first-try-getconf.patch   | 113 -------------
 dev-lang/zig/zig-0.11.0-r1.ebuild                  | 186 ---------------------
 dev-lang/zig/zig-0.12.0.ebuild                     | 182 --------------------
 4 files changed, 485 deletions(-)

diff --git a/dev-lang/zig/Manifest b/dev-lang/zig/Manifest
index 538062fe0caf..6ab62b044f50 100644
--- a/dev-lang/zig/Manifest
+++ b/dev-lang/zig/Manifest
@@ -1,6 +1,2 @@
-DIST zig-0.11.0.tar.xz 15275316 BLAKE2B 603e4995a36d214ba71cf05b719a04732c8927995c8207ab8fdd574dca3410cdc5ccc8f6aa9964807afc04a5cbce1a3910a6cde4cf12e585cdf7684833217eb2 SHA512 c19a8ae6d440a16dd5e77941fc77c036d1f284f1784376625e63b65f30b4acad62f9f4217bc818c401f88c2c33f8722f26fc467c3e23c29a89178c4b1882d1c4
-DIST zig-0.11.0.tar.xz.minisig 312 BLAKE2B 8df407f07dde36280c945300fd8b803e6e59c026eb7a3eb56e6d2f4fe1047672e17946a3bbe23ccfe9be07b65331e17690e95fd348353be22f7b6d9b73b3f9ca SHA512 565dd1eacb7dd697e6b1ff54517adc1e4775d2523afaeb4f9a3dd404df871b187862211ecbbcf90b42e3a03853677fc1603e7fc8fc5ba7126a054679faa601ca
-DIST zig-0.12.0.tar.xz 17099152 BLAKE2B 2a1248302868156c4ddcb154d075af29886a95a4c29de02ff0981e76a85f5d4109dd5c38f95c2c16f5c942bab7d120ae068c1e122ab8ad421c0213b7e996956c SHA512 0c3d9396fea4905245c7e32ce6bd9b4ff140f061cd8a957929e4c84cf105f5bbcbf2e7c030013ac649edb569e909f65d928b3e8a86f35c9076fb62e996feea14
-DIST zig-0.12.0.tar.xz.minisig 312 BLAKE2B 4b3d1ae45d3b6d81054a39255c0892d9376d05da9ff1076bcf740310c9650b0154ddc39f19caee9dae293719d58a63764e43b694b83fe7031c87ab434aa377f5 SHA512 6e14c1e1926beeb249cb88fb2247ff401f679b64785c3ec8a924e33c894174deb77b48286469a863761bce0ca57524f904995eacf544919dda387c140e6e829e
 DIST zig-0.13.0.tar.xz 17220728 BLAKE2B f4bbacc2012950c556bebc28fc322fc6424bf20fe118e8362373336b6460e514028978584087f6e7f25ed8b8e6991610edce625676a1dd80c1975c5f9ef48775 SHA512 6f5f31f4ba71a11d8b16c7a5a613e124095e503fa6b02d2b77e5b177674c739287e81d98d96dc261fed24bc836caf196f71c3fcc7a6518387df86ba9e03df4dd
 DIST zig-0.13.0.tar.xz.minisig 312 BLAKE2B 2d061257c9c75f9c36b01cfb08dcd2040538a125b9ea2cae8617ae5496e685b165933ce8981494419522b7e19b51fc69a651ecaa4a8930753acf2e4ae3d6e00f SHA512 21c6139c06cba6c5e23a3305fed0c0f1b9b32d9140bd686c26365ce0279d5f53cd081894eaba29f0c1ed51b2e831edf7bd4ae6a7eaee5018a252e312e9b65507

diff --git a/dev-lang/zig/files/zig-0.11.0-first-try-getconf.patch b/dev-lang/zig/files/zig-0.11.0-first-try-getconf.patch
deleted file mode 100644
index 5a63e9e74ad9..000000000000
--- a/dev-lang/zig/files/zig-0.11.0-first-try-getconf.patch
+++ /dev/null
@@ -1,113 +0,0 @@
-From: Eric Joldasov <bratishkaerik@getgoogleoff.me>
-
-Based on https://github.com/ziglang/zig/pull/12567 and https://github.com/ziglang/zig/pull/17671
-with small fixes, all ported to 0.11.0.
-
-First try `getconf GNU_LIBC_VERSION` to detect glibc version,
-If there are any errors, skip to the upstream logic.
-
-Also fix glibc version parsing: if version string does not contain third (patch) component, "std.SemanticVersion.parse" returns parsing error.
-For example, this currently happens with "GLIBC_2.37" or "glibc 2.37" inputs.
-To fix this, we use copy-pasted "std.zig.CrossTarget.parse" function here, that sets omitted patch component to 0.
-
-After applying this patch, both `zig build-exe --show-builtin` and `zig env` show correct version on my default/linux/amd64/17.1/desktop/plasma :
-glibc 2.37.
-
-Bug: https://bugs.gentoo.org/914731
-Bug: https://bugs.gentoo.org/914101
-
-diff --git a/lib/std/zig/system/NativeTargetInfo.zig b/lib/std/zig/system/NativeTargetInfo.zig
-index 99a1a8f2e..0250db968 100644
---- a/lib/std/zig/system/NativeTargetInfo.zig
-+++ b/lib/std/zig/system/NativeTargetInfo.zig
-@@ -19,6 +19,32 @@ dynamic_linker: DynamicLinker = DynamicLinker{},
-
- pub const DynamicLinker = Target.DynamicLinker;
-
-+// Copy-pasted from `std.zig.CrossTarget.parse` to avoid introducing unexpected new public function as part of standard library.
-+/// Parses a version with an omitted patch component, such as "1.0",
-+/// which SemanticVersion.parse is not capable of.
-+fn parseWithOptionalPatchField(ver: []const u8) error{ InvalidVersion, Overflow }!std.SemanticVersion {
-+    const parseVersionComponent = struct {
-+        fn parseVersionComponent(component: []const u8) !usize {
-+            return std.fmt.parseUnsigned(usize, component, 10) catch |err| {
-+                switch (err) {
-+                    error.InvalidCharacter => return error.InvalidVersion,
-+                    error.Overflow => return error.Overflow,
-+                }
-+            };
-+        }
-+    }.parseVersionComponent;
-+    var version_components = mem.splitScalar(u8, ver, '.');
-+    const major = version_components.first();
-+    const minor = version_components.next() orelse return error.InvalidVersion;
-+    const patch = version_components.next() orelse "0";
-+    if (version_components.next() != null) return error.InvalidVersion;
-+    return .{
-+        .major = try parseVersionComponent(major),
-+        .minor = try parseVersionComponent(minor),
-+        .patch = try parseVersionComponent(patch),
-+    };
-+}
-+
- pub const DetectError = error{
-     FileSystem,
-     SystemResources,
-@@ -307,6 +333,39 @@ fn detectAbiAndDynamicLinker(
-     }
-     const ld_info_list = ld_info_list_buffer[0..ld_info_list_len];
-
-+    if (is_linux and !os_is_non_native and cross_target.glibc_version == null) try_getconf: {
-+        var buf: [4096]u8 = undefined;
-+        var fba = std.heap.FixedBufferAllocator.init(&buf);
-+        const allocator = fba.allocator();
-+
-+        const getconf = std.process.Child.exec(.{
-+            .allocator = allocator,
-+            .argv = &.{ "getconf", "GNU_LIBC_VERSION" },
-+            .max_output_bytes = 1024,
-+        }) catch break :try_getconf;
-+        if (!std.mem.startsWith(u8, getconf.stdout, "glibc ")) break :try_getconf;
-+        const version_string = std.mem.trim(u8, getconf.stdout["glibc ".len..], &std.ascii.whitespace);
-+        const glibc_version = parseWithOptionalPatchField(version_string) catch break :try_getconf;
-+
-+        var os_with_glibc = os;
-+        os_with_glibc.version_range.linux.glibc = glibc_version;
-+
-+        const target: Target = .{
-+            .cpu = cpu,
-+            .os = os_with_glibc,
-+            .abi = .gnu,
-+            .ofmt = cross_target.ofmt orelse Target.ObjectFormat.default(os_with_glibc.tag, cpu.arch),
-+        };
-+        const result: NativeTargetInfo = .{
-+            .target = target,
-+            .dynamic_linker = if (cross_target.dynamic_linker.get() == null)
-+                target.standardDynamicLinkerPath()
-+            else
-+                cross_target.dynamic_linker,
-+        };
-+        return result;
-+    }
-+
-     // Best case scenario: the executable is dynamically linked, and we can iterate
-     // over our own shared objects and find a dynamic linker.
-     const elf_file = blk: {
-@@ -563,7 +622,7 @@ fn glibcVerFromSoFile(file: fs.File) !std.SemanticVersion {
-     while (it.next()) |s| {
-         if (mem.startsWith(u8, s, "GLIBC_2.")) {
-             const chopped = s["GLIBC_".len..];
--            const ver = std.SemanticVersion.parse(chopped) catch |err| switch (err) {
-+            const ver = parseWithOptionalPatchField(chopped) catch |err| switch (err) {
-                 error.Overflow => return error.InvalidGnuLibCVersion,
-                 error.InvalidVersion => return error.InvalidGnuLibCVersion,
-             };
-@@ -586,7 +645,7 @@ fn glibcVerFromLinkName(link_name: []const u8, prefix: []const u8) !std.Semantic
-     }
-     // chop off "libc-" and ".so"
-     const link_name_chopped = link_name[prefix.len .. link_name.len - suffix.len];
--    return std.SemanticVersion.parse(link_name_chopped) catch |err| switch (err) {
-+    return parseWithOptionalPatchField(link_name_chopped) catch |err| switch (err) {
-         error.Overflow => return error.InvalidGnuLibCVersion,
-         error.InvalidVersion => return error.InvalidGnuLibCVersion,
-     };

diff --git a/dev-lang/zig/zig-0.11.0-r1.ebuild b/dev-lang/zig/zig-0.11.0-r1.ebuild
deleted file mode 100644
index 8114e11a4f79..000000000000
--- a/dev-lang/zig/zig-0.11.0-r1.ebuild
+++ /dev/null
@@ -1,186 +0,0 @@
-# Copyright 2019-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-LLVM_MAX_SLOT=16
-inherit edo cmake llvm check-reqs toolchain-funcs
-
-DESCRIPTION="A robust, optimal, and maintainable programming language"
-HOMEPAGE="https://ziglang.org/"
-if [[ ${PV} == 9999 ]]; then
-	EGIT_REPO_URI="https://github.com/ziglang/zig.git"
-	inherit git-r3
-else
-	VERIFY_SIG_METHOD=minisig
-	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/minisig-keys/zig-software-foundation.pub
-	inherit verify-sig
-
-	SRC_URI="
-		https://ziglang.org/download/${PV}/${P}.tar.xz
-		verify-sig? ( https://ziglang.org/download/${PV}/${P}.tar.xz.minisig )
-	"
-	KEYWORDS="~amd64 ~arm ~arm64"
-
-	BDEPEND="verify-sig? ( sec-keys/minisig-keys-zig-software-foundation )"
-fi
-
-# project itself: MIT
-# There are bunch of projects under "lib/" folder that are needed for cross-compilation.
-# Files that are unnecessary for cross-compilation are removed by upstream
-# and therefore their licenses (if any special) are not included.
-# lib/libunwind: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libcxxabi: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libcxx: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libc/wasi: || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain
-# lib/libc/musl: MIT BSD-2
-# lib/libc/mingw: ZPL public-domain BSD-2 ISC HPND
-# 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="$(ver_cut 1-2)"
-IUSE="doc"
-
-BUILD_DIR="${S}/build"
-
-# Zig requires zstd and zlib compression support in LLVM, if using LLVM backend.
-# (non-LLVM backends don't require these)
-# They are not required "on their own", so please don't add them here.
-# You can check https://github.com/ziglang/zig-bootstrap in future, to see
-# options that are passed to LLVM CMake building (excluding "static" ofc).
-DEPEND="
-	sys-devel/clang:${LLVM_MAX_SLOT}=
-	sys-devel/lld:${LLVM_MAX_SLOT}=
-	sys-devel/llvm:${LLVM_MAX_SLOT}=[zstd]
-"
-
-RDEPEND="
-	${DEPEND}
-"
-
-IDEPEND="app-eselect/eselect-zig"
-
-# see https://github.com/ziglang/zig/issues/3382
-# For now, Zig Build System doesn't support enviromental CFLAGS/LDFLAGS/etc.
-QA_FLAGS_IGNORED="usr/.*/zig/${PV}/bin/zig"
-
-# Since commit https://github.com/ziglang/zig/commit/e7d28344fa3ee81d6ad7ca5ce1f83d50d8502118
-# Zig uses self-hosted compiler only
-CHECKREQS_MEMORY="4G"
-
-PATCHES=(
-	"${FILESDIR}/zig-0.11.0-first-try-getconf.patch"
-)
-
-llvm_check_deps() {
-	has_version "sys-devel/clang:${LLVM_SLOT}"
-}
-
-ctarget_to_zigtarget() {
-	# Zig's Target Format: arch-os-abi
-	local CTARGET="${CTARGET:-${CHOST}}"
-
-	local ZIG_ARCH
-	case "${CTARGET%%-*}" in
-		i?86)		ZIG_ARCH=x86;;
-		sparcv9)	ZIG_ARCH=sparc64;;
-		*)		ZIG_ARCH="${CTARGET%%-*}";; # Same as in CHOST
-	esac
-
-	local ZIG_OS
-	case "${CTARGET}" in
-		*linux*)	ZIG_OS=linux;;
-		*apple*)	ZIG_OS=macos;;
-	esac
-
-	local ZIG_ABI
-	case "${CTARGET##*-}" in
-		gnu)		ZIG_ABI=gnu;;
-		solaris*)	ZIG_OS=solaris ZIG_ABI=none;;
-		darwin*)	ZIG_ABI=none;;
-		*)		ZIG_ABI="${CTARGET##*-}";; # Same as in CHOST
-	esac
-
-	echo "${ZIG_ARCH}-${ZIG_OS}-${ZIG_ABI}"
-}
-
-get_zig_mcpu() {
-	local ZIG_DEFAULT_MCPU=native
-	tc-is-cross-compiler && ZIG_DEFAULT_MCPU=baseline
-	echo "${ZIG_MCPU:-${ZIG_DEFAULT_MCPU}}"
-}
-
-get_zig_target() {
-	local ZIG_DEFAULT_TARGET=native
-	tc-is-cross-compiler && ZIG_DEFAULT_TARGET="$(ctarget_to_zigtarget)"
-	echo "${ZIG_TARGET:-${ZIG_DEFAULT_TARGET}}"
-}
-
-pkg_setup() {
-	llvm_pkg_setup
-	check-reqs_pkg_setup
-}
-
-src_configure() {
-	# Useful for debugging and a little bit more deterministic.
-	export ZIG_LOCAL_CACHE_DIR="${T}/zig-local-cache"
-	export ZIG_GLOBAL_CACHE_DIR="${T}/zig-global-cache"
-
-	local mycmakeargs=(
-		-DZIG_USE_CCACHE=OFF
-		-DZIG_SHARED_LLVM=ON
-		-DZIG_TARGET_TRIPLE="$(get_zig_target)"
-		-DZIG_TARGET_MCPU="$(get_zig_mcpu)"
-		-DZIG_USE_LLVM_CONFIG=ON
-		-DCMAKE_PREFIX_PATH="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
-		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/$(get_libdir)/zig/${PV}"
-	)
-
-	cmake_src_configure
-}
-
-src_compile() {
-	cmake_src_compile
-
-	"${BUILD_DIR}/stage3/bin/zig" env || die "Zig compilation failed"
-
-	if use doc; then
-		cd "${BUILD_DIR}" || die
-		edo ./stage3/bin/zig build std-docs --prefix "${S}/docgen/"
-		edo ./stage3/bin/zig build langref --prefix "${S}/docgen/"
-	fi
-}
-
-src_test() {
-	cd "${BUILD_DIR}" || die
-	local ZIG_TEST_ARGS="-Dstatic-llvm=false -Denable-llvm -Dskip-non-native \
-		-Doptimize=ReleaseSafe -Dtarget=$(get_zig_target) -Dcpu=$(get_zig_mcpu)"
-	local ZIG_TEST_STEPS=(
-		test-cases test-fmt test-behavior test-compiler-rt test-universal-libc test-compare-output
-		test-standalone test-c-abi test-link test-stack-traces test-cli test-asm-link test-translate-c
-		test-run-translated-c test-std
-	)
-
-	local step
-	for step in "${ZIG_TEST_STEPS[@]}" ; do
-		edob ./stage3/bin/zig build ${step} ${ZIG_TEST_ARGS}
-	done
-}
-
-src_install() {
-	use doc && local HTML_DOCS=( "docgen/doc/langref.html" "docgen/doc/std" )
-	cmake_src_install
-
-	cd "${ED}/usr/$(get_libdir)/zig/${PV}/" || die
-	mv lib/zig/ lib2/ || die
-	rm -rf lib/ || die
-	mv lib2/ lib/ || die
-	dosym -r "/usr/$(get_libdir)/zig/${PV}/bin/zig" "/usr/bin/zig-${PV}"
-}
-
-pkg_postinst() {
-	eselect zig update ifunset
-}
-
-pkg_postrm() {
-	eselect zig update ifunset
-}

diff --git a/dev-lang/zig/zig-0.12.0.ebuild b/dev-lang/zig/zig-0.12.0.ebuild
deleted file mode 100644
index 2b89e41832af..000000000000
--- a/dev-lang/zig/zig-0.12.0.ebuild
+++ /dev/null
@@ -1,182 +0,0 @@
-# Copyright 2019-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-LLVM_MAX_SLOT=17
-inherit edo cmake llvm check-reqs toolchain-funcs
-
-DESCRIPTION="A robust, optimal, and maintainable programming language"
-HOMEPAGE="https://ziglang.org/"
-if [[ ${PV} == 9999 ]]; then
-	EGIT_REPO_URI="https://github.com/ziglang/zig.git"
-	inherit git-r3
-else
-	VERIFY_SIG_METHOD=minisig
-	VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/minisig-keys/zig-software-foundation.pub
-	inherit verify-sig
-
-	SRC_URI="
-		https://ziglang.org/download/${PV}/${P}.tar.xz
-		verify-sig? ( https://ziglang.org/download/${PV}/${P}.tar.xz.minisig )
-	"
-	KEYWORDS="~amd64 ~arm ~arm64"
-
-	BDEPEND="verify-sig? ( sec-keys/minisig-keys-zig-software-foundation )"
-fi
-
-# project itself: MIT
-# There are bunch of projects under "lib/" folder that are needed for cross-compilation.
-# Files that are unnecessary for cross-compilation are removed by upstream
-# and therefore their licenses (if any special) are not included.
-# lib/libunwind: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libcxxabi: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libcxx: Apache-2.0-with-LLVM-exceptions || ( UoI-NCSA MIT )
-# lib/libc/wasi: || ( Apache-2.0-with-LLVM-exceptions Apache-2.0 MIT BSD-2 ) public-domain
-# lib/libc/musl: MIT BSD-2
-# lib/libc/mingw: ZPL public-domain BSD-2 ISC HPND
-# 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="$(ver_cut 1-2)"
-IUSE="doc"
-
-BUILD_DIR="${S}/build"
-
-# Zig requires zstd and zlib compression support in LLVM, if using LLVM backend.
-# (non-LLVM backends don't require these)
-# They are not required "on their own", so please don't add them here.
-# You can check https://github.com/ziglang/zig-bootstrap in future, to see
-# options that are passed to LLVM CMake building (excluding "static" ofc).
-DEPEND="
-	sys-devel/clang:${LLVM_MAX_SLOT}=
-	sys-devel/lld:${LLVM_MAX_SLOT}=
-	sys-devel/llvm:${LLVM_MAX_SLOT}=[zstd]
-"
-
-RDEPEND="
-	${DEPEND}
-"
-
-IDEPEND="app-eselect/eselect-zig"
-
-# see https://github.com/ziglang/zig/issues/3382
-# For now, Zig Build System doesn't support enviromental CFLAGS/LDFLAGS/etc.
-QA_FLAGS_IGNORED="usr/.*/zig/${PV}/bin/zig"
-
-# Since commit https://github.com/ziglang/zig/commit/e7d28344fa3ee81d6ad7ca5ce1f83d50d8502118
-# Zig uses self-hosted compiler only
-CHECKREQS_MEMORY="4G"
-
-llvm_check_deps() {
-	has_version "sys-devel/clang:${LLVM_SLOT}"
-}
-
-ctarget_to_zigtarget() {
-	# Zig's Target Format: arch-os-abi
-	local CTARGET="${CTARGET:-${CHOST}}"
-
-	local ZIG_ARCH
-	case "${CTARGET%%-*}" in
-		i?86)		ZIG_ARCH=x86;;
-		sparcv9)	ZIG_ARCH=sparc64;;
-		*)		ZIG_ARCH="${CTARGET%%-*}";; # Same as in CHOST
-	esac
-
-	local ZIG_OS
-	case "${CTARGET}" in
-		*linux*)	ZIG_OS=linux;;
-		*apple*)	ZIG_OS=macos;;
-	esac
-
-	local ZIG_ABI
-	case "${CTARGET##*-}" in
-		gnu)		ZIG_ABI=gnu;;
-		solaris*)	ZIG_OS=solaris ZIG_ABI=none;;
-		darwin*)	ZIG_ABI=none;;
-		*)		ZIG_ABI="${CTARGET##*-}";; # Same as in CHOST
-	esac
-
-	echo "${ZIG_ARCH}-${ZIG_OS}-${ZIG_ABI}"
-}
-
-get_zig_mcpu() {
-	local ZIG_DEFAULT_MCPU=native
-	tc-is-cross-compiler && ZIG_DEFAULT_MCPU=baseline
-	echo "${ZIG_MCPU:-${ZIG_DEFAULT_MCPU}}"
-}
-
-get_zig_target() {
-	local ZIG_DEFAULT_TARGET=native
-	tc-is-cross-compiler && ZIG_DEFAULT_TARGET="$(ctarget_to_zigtarget)"
-	echo "${ZIG_TARGET:-${ZIG_DEFAULT_TARGET}}"
-}
-
-pkg_setup() {
-	llvm_pkg_setup
-	check-reqs_pkg_setup
-}
-
-src_configure() {
-	# Useful for debugging and a little bit more deterministic.
-	export ZIG_LOCAL_CACHE_DIR="${T}/zig-local-cache"
-	export ZIG_GLOBAL_CACHE_DIR="${T}/zig-global-cache"
-
-	local mycmakeargs=(
-		-DZIG_USE_CCACHE=OFF
-		-DZIG_SHARED_LLVM=ON
-		-DZIG_TARGET_TRIPLE="$(get_zig_target)"
-		-DZIG_TARGET_MCPU="$(get_zig_mcpu)"
-		-DZIG_USE_LLVM_CONFIG=ON
-		-DCMAKE_PREFIX_PATH="$(get_llvm_prefix ${LLVM_MAX_SLOT})"
-		-DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/$(get_libdir)/zig/${PV}"
-	)
-
-	cmake_src_configure
-}
-
-src_compile() {
-	cmake_src_compile
-
-	"${BUILD_DIR}/stage3/bin/zig" env || die "Zig compilation failed"
-
-	if use doc; then
-		cd "${BUILD_DIR}" || die
-		edo ./stage3/bin/zig build std-docs --prefix "${S}/docgen/"
-		edo ./stage3/bin/zig build langref --prefix "${S}/docgen/"
-	fi
-}
-
-src_test() {
-	cd "${BUILD_DIR}" || die
-	local ZIG_TEST_ARGS="-Dstatic-llvm=false -Denable-llvm -Dskip-non-native \
-		-Doptimize=ReleaseSafe -Dtarget=$(get_zig_target) -Dcpu=$(get_zig_mcpu)"
-	local ZIG_TEST_STEPS=(
-		test-cases test-fmt test-behavior test-compiler-rt test-universal-libc test-compare-output
-		test-standalone test-c-abi test-link test-stack-traces test-cli test-asm-link test-translate-c
-		test-run-translated-c test-std
-	)
-
-	local step
-	for step in "${ZIG_TEST_STEPS[@]}" ; do
-		edob ./stage3/bin/zig build ${step} ${ZIG_TEST_ARGS}
-	done
-}
-
-src_install() {
-	use doc && local HTML_DOCS=( "docgen/doc/langref.html" "docgen/doc/std" )
-	cmake_src_install
-
-	cd "${ED}/usr/$(get_libdir)/zig/${PV}/" || die
-	mv lib/zig/ lib2/ || die
-	rm -rf lib/ || die
-	mv lib2/ lib/ || die
-	dosym -r "/usr/$(get_libdir)/zig/${PV}/bin/zig" "/usr/bin/zig-${PV}"
-}
-
-pkg_postinst() {
-	eselect zig update ifunset
-}
-
-pkg_postrm() {
-	eselect zig update ifunset
-}


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2023-07-09  2:02 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2023-07-09  2:02 UTC (permalink / raw
  To: gentoo-commits

commit:     8f377950b088ae4240db530fee28ddb3a23c2013
Author:     Violet Purcell <vimproved <AT> inventati <DOT> org>
AuthorDate: Fri Jul  7 19:17:09 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jul  9 02:02:27 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f377950

dev-lang/zig: Backport fix for musl 1.2.4

Signed-off-by: Violet Purcell <vimproved <AT> inventati.org>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../zig/files/zig-0.10.1-musl-1.2.4-lfs64.patch    | 220 +++++++++++++++++++++
 .../{zig-0.10.1-r2.ebuild => zig-0.10.1-r3.ebuild} |   1 +
 2 files changed, 221 insertions(+)

diff --git a/dev-lang/zig/files/zig-0.10.1-musl-1.2.4-lfs64.patch b/dev-lang/zig/files/zig-0.10.1-musl-1.2.4-lfs64.patch
new file mode 100644
index 000000000000..05a550a7920e
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.10.1-musl-1.2.4-lfs64.patch
@@ -0,0 +1,220 @@
+From https://github.com/ziglang/zig/commit/b20ccff515364cdb8f3e733cc950e53ab77656db Mon Sep 17 00:00:00 2001
+From: Andrew Kelley <andrew@ziglang.org>
+Date: Mon, 19 Jun 2023 15:17:01 -0700
+Subject: [PATCH] std.os: update logic for 64-bit symbol choice
+
+musl v1.2.4 dropped the "64"-suffixed aliases for legacy "LFS64" ("large
+file support") interfaces, so this commit changes the corresponding Zig
+logic to call the correct names.
+--- a/lib/std/os.zig
++++ b/lib/std/os.zig
+@@ -890,10 +890,7 @@ pub fn pread(fd: fd_t, buf: []u8, offset: u64) PReadError!usize {
+     };
+     const adjusted_len = @min(max_count, buf.len);
+ 
+-    const pread_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.pread64
+-    else
+-        system.pread;
++    const pread_sym = if (lfs64_abi) system.pread64 else system.pread;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     while (true) {
+@@ -966,10 +963,7 @@ pub fn ftruncate(fd: fd_t, length: u64) TruncateError!void {
+     }
+ 
+     while (true) {
+-        const ftruncate_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-            system.ftruncate64
+-        else
+-            system.ftruncate;
++        const ftruncate_sym = if (lfs64_abi) system.ftruncate64 else system.ftruncate;
+ 
+         const ilen = @bitCast(i64, length); // the OS treats this as unsigned
+         switch (errno(ftruncate_sym(fd, ilen))) {
+@@ -1034,10 +1028,7 @@ pub fn preadv(fd: fd_t, iov: []const iovec, offset: u64) PReadError!usize {
+ 
+     const iov_count = math.cast(u31, iov.len) orelse math.maxInt(u31);
+ 
+-    const preadv_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.preadv64
+-    else
+-        system.preadv;
++    const preadv_sym = if (lfs64_abi) system.preadv64 else system.preadv;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     while (true) {
+@@ -1311,10 +1302,7 @@ pub fn pwrite(fd: fd_t, bytes: []const u8, offset: u64) PWriteError!usize {
+     };
+     const adjusted_len = @min(max_count, bytes.len);
+ 
+-    const pwrite_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.pwrite64
+-    else
+-        system.pwrite;
++    const pwrite_sym = if (lfs64_abi) system.pwrite64 else system.pwrite;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     while (true) {
+@@ -1400,10 +1388,7 @@ pub fn pwritev(fd: fd_t, iov: []const iovec_const, offset: u64) PWriteError!usiz
+         }
+     }
+ 
+-    const pwritev_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.pwritev64
+-    else
+-        system.pwritev;
++    const pwritev_sym = if (lfs64_abi) system.pwritev64 else system.pwritev;
+ 
+     const iov_count = if (iov.len > IOV_MAX) IOV_MAX else @intCast(u31, iov.len);
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+@@ -1514,10 +1499,7 @@ pub fn openZ(file_path: [*:0]const u8, flags: u32, perm: mode_t) OpenError!fd_t
+         return open(mem.sliceTo(file_path, 0), flags, perm);
+     }
+ 
+-    const open_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.open64
+-    else
+-        system.open;
++    const open_sym = if (lfs64_abi) system.open64 else system.open;
+ 
+     while (true) {
+         const rc = open_sym(file_path, flags, perm);
+@@ -1730,10 +1712,7 @@ pub fn openatZ(dir_fd: fd_t, file_path: [*:0]const u8, flags: u32, mode: mode_t)
+         return openat(dir_fd, mem.sliceTo(file_path, 0), flags, mode);
+     }
+ 
+-    const openat_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.openat64
+-    else
+-        system.openat;
++    const openat_sym = if (lfs64_abi) system.openat64 else system.openat;
+ 
+     while (true) {
+         const rc = openat_sym(dir_fd, file_path, flags, mode);
+@@ -4117,10 +4096,7 @@ pub fn fstat(fd: fd_t) FStatError!Stat {
+         @compileError("fstat is not yet implemented on Windows");
+     }
+ 
+-    const fstat_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.fstat64
+-    else
+-        system.fstat;
++    const fstat_sym = if (lfs64_abi) system.fstat64 else system.fstat;
+ 
+     var stat = mem.zeroes(Stat);
+     switch (errno(fstat_sym(fd, &stat))) {
+@@ -4176,10 +4152,7 @@ pub fn fstatatZ(dirfd: fd_t, pathname: [*:0]const u8, flags: u32) FStatAtError!S
+         return fstatatWasi(dirfd, mem.sliceTo(pathname), flags);
+     }
+ 
+-    const fstatat_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.fstatat64
+-    else
+-        system.fstatat;
++    const fstatat_sym = if (lfs64_abi) system.fstatat64 else system.fstatat;
+ 
+     var stat = mem.zeroes(Stat);
+     switch (errno(fstatat_sym(dirfd, pathname, &stat, flags))) {
+@@ -4416,10 +4389,7 @@ pub fn mmap(
+     fd: fd_t,
+     offset: u64,
+ ) MMapError![]align(mem.page_size) u8 {
+-    const mmap_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.mmap64
+-    else
+-        system.mmap;
++    const mmap_sym = if (lfs64_abi) system.mmap64 else system.mmap;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     const rc = mmap_sym(ptr, length, prot, flags, fd, ioffset);
+@@ -4823,10 +4793,7 @@ pub fn lseek_SET(fd: fd_t, offset: u64) SeekError!void {
+         }
+     }
+ 
+-    const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.lseek64
+-    else
+-        system.lseek;
++    const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     switch (errno(lseek_sym(fd, ioffset, SEEK.SET))) {
+@@ -4870,10 +4837,7 @@ pub fn lseek_CUR(fd: fd_t, offset: i64) SeekError!void {
+             else => |err| return unexpectedErrno(err),
+         }
+     }
+-    const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.lseek64
+-    else
+-        system.lseek;
++    const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     switch (errno(lseek_sym(fd, ioffset, SEEK.CUR))) {
+@@ -4917,10 +4881,7 @@ pub fn lseek_END(fd: fd_t, offset: i64) SeekError!void {
+             else => |err| return unexpectedErrno(err),
+         }
+     }
+-    const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.lseek64
+-    else
+-        system.lseek;
++    const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek;
+ 
+     const ioffset = @bitCast(i64, offset); // the OS treats this as unsigned
+     switch (errno(lseek_sym(fd, ioffset, SEEK.END))) {
+@@ -4964,10 +4925,7 @@ pub fn lseek_CUR_get(fd: fd_t) SeekError!u64 {
+             else => |err| return unexpectedErrno(err),
+         }
+     }
+-    const lseek_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.lseek64
+-    else
+-        system.lseek;
++    const lseek_sym = if (lfs64_abi) system.lseek64 else system.lseek;
+ 
+     const rc = lseek_sym(fd, 0, SEEK.CUR);
+     switch (errno(rc)) {
+@@ -6169,10 +6127,7 @@ pub fn sendfile(
+             // TODO we should not need this cast; improve return type of @min
+             const adjusted_count = @intCast(usize, adjusted_count_tmp);
+ 
+-            const sendfile_sym = if (builtin.link_libc)
+-                system.sendfile64
+-            else
+-                system.sendfile;
++            const sendfile_sym = if (lfs64_abi) system.sendfile64 else system.sendfile;
+ 
+             while (true) {
+                 var offset: off_t = @bitCast(off_t, in_offset);
+@@ -7050,10 +7005,7 @@ pub fn prctl(option: PR, args: anytype) PrctlError!u31 {
+ pub const GetrlimitError = UnexpectedError;
+ 
+ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit {
+-    const getrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.getrlimit64
+-    else
+-        system.getrlimit;
++    const getrlimit_sym = if (lfs64_abi) system.getrlimit64 else system.getrlimit;
+ 
+     var limits: rlimit = undefined;
+     switch (errno(getrlimit_sym(resource, &limits))) {
+@@ -7067,10 +7019,7 @@ pub fn getrlimit(resource: rlimit_resource) GetrlimitError!rlimit {
+ pub const SetrlimitError = error{ PermissionDenied, LimitTooBig } || UnexpectedError;
+ 
+ pub fn setrlimit(resource: rlimit_resource, limits: rlimit) SetrlimitError!void {
+-    const setrlimit_sym = if (builtin.os.tag == .linux and builtin.link_libc)
+-        system.setrlimit64
+-    else
+-        system.setrlimit;
++    const setrlimit_sym = if (lfs64_abi) system.setrlimit64 else system.setrlimit;
+ 
+     switch (errno(setrlimit_sym(resource, &limits))) {
+         .SUCCESS => return,
+@@ -7339,3 +7288,5 @@ pub fn ptrace(request: u32, pid: pid_t, addr: usize, signal: usize) PtraceError!
+         },
+     };
+ }
++
++const lfs64_abi = builtin.os.tag == .linux and builtin.link_libc and builtin.abi.isGnu();

diff --git a/dev-lang/zig/zig-0.10.1-r2.ebuild b/dev-lang/zig/zig-0.10.1-r3.ebuild
similarity index 99%
rename from dev-lang/zig/zig-0.10.1-r2.ebuild
rename to dev-lang/zig/zig-0.10.1-r3.ebuild
index 6200470dec94..b85fc3c95232 100644
--- a/dev-lang/zig/zig-0.10.1-r2.ebuild
+++ b/dev-lang/zig/zig-0.10.1-r3.ebuild
@@ -61,6 +61,7 @@ CHECKREQS_MEMORY="10G"
 
 PATCHES=(
 	"${FILESDIR}/zig-0.10.0-build-dir-install-stage3.patch"
+	"${FILESDIR}/zig-0.10.1-musl-1.2.4-lfs64.patch"
 )
 
 llvm_check_deps() {


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2023-01-14 19:17 Sam James
  0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2023-01-14 19:17 UTC (permalink / raw
  To: gentoo-commits

commit:     766ffdacc8e269ad975a010bb9124024e7272fd7
Author:     Eric Joldasov <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Fri Jan 13 11:47:46 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Jan 14 19:14:51 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=766ffdac

dev-lang/zig: fix patch from previous commit

I'm sorry for possible incovenience caused by this (I hope that it was, since it
didn't look SO bad). Explained in and rebased upstream PR too.

Fixes: 28fcae31f91eb30b62c8d55b39207238d377f0c2
Closes: https://bugs.gentoo.org/890457
Closes: https://bugs.gentoo.org/890459

Signed-off-by: Eric Joldasov <bratishkaerik <AT> getgoogleoff.me>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../zig-0.10.0-build-dir-install-stage3.patch      | 24 +++++++++++++++++-----
 .../{zig-0.10.0.ebuild => zig-0.10.0-r1.ebuild}    |  0
 2 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/dev-lang/zig/files/zig-0.10.0-build-dir-install-stage3.patch b/dev-lang/zig/files/zig-0.10.0-build-dir-install-stage3.patch
index c44632f5111e..5704e4ba7921 100644
--- a/dev-lang/zig/files/zig-0.10.0-build-dir-install-stage3.patch
+++ b/dev-lang/zig/files/zig-0.10.0-build-dir-install-stage3.patch
@@ -1,18 +1,32 @@
 From: Eric Joldasov <bratishkaerik@getgoogleoff.me>
 
 Install 'zig' binary in 'build_dir/stage3' directory so that we can find it and use for testing.
+Also split "add_custom_target(stage3 ALL" and command that it invokes, so that it won't retry it during installation,
+as target will be considered not out-of-date. (Bug https://bugs.gentoo.org/890457 and https://bugs.gentoo.org/890459).
 Upstream PR https://github.com/ziglang/zig/pull/14255.
+
 --- a/CMakeLists.txt
 +++ b/CMakeLists.txt
-@@ -1094,7 +1094,7 @@ set(ZIG_BUILD_ARGS
+@@ -1094,10 +1094,14 @@ set(ZIG_BUILD_ARGS
  )
  
  add_custom_target(stage3 ALL
 -    COMMAND zig2 build compile ${ZIG_BUILD_ARGS}
-+    COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
-     DEPENDS zig2
-     COMMENT STATUS "Building stage3"
-     WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+-    DEPENDS zig2
+-    COMMENT STATUS "Building stage3"
+-    WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
++  DEPENDS "${CMAKE_BINARY_DIR}/stage3/bin/zig"
++)
++
++add_custom_command(
++  OUTPUT "${CMAKE_BINARY_DIR}/stage3/bin/zig"
++  COMMAND zig2 build --prefix "${CMAKE_BINARY_DIR}/stage3" ${ZIG_BUILD_ARGS}
++  COMMENT STATUS "Building stage3"
++  WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
+ )
+ 
+ install(CODE "set(ZIG_EXECUTABLE \"${ZIG_EXECUTABLE}\")")
+
 --- a/build.zig
 +++ b/build.zig
 @@ -148,10 +148,6 @@ pub fn build(b: *Builder) !void {

diff --git a/dev-lang/zig/zig-0.10.0.ebuild b/dev-lang/zig/zig-0.10.0-r1.ebuild
similarity index 100%
rename from dev-lang/zig/zig-0.10.0.ebuild
rename to dev-lang/zig/zig-0.10.0-r1.ebuild


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2022-04-30  8:13 Joonas Niilola
  0 siblings, 0 replies; 7+ messages in thread
From: Joonas Niilola @ 2022-04-30  8:13 UTC (permalink / raw
  To: gentoo-commits

commit:     2647a868c09f98a97fad19e0070a4abab851376c
Author:     BratishkaErik <bratishkaerik <AT> getgoogleoff <DOT> me>
AuthorDate: Tue Apr 19 13:44:23 2022 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Sat Apr 30 08:13:20 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2647a868

dev-lang/zig: add stage2 support (on -9999)

Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: BratishkaErik <bratishkaerik <AT> getgoogleoff.me>
Closes: https://github.com/gentoo/gentoo/pull/25085
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 dev-lang/zig/files/zig-9999-stage2-fix.patch | 12 ++++++++++++
 dev-lang/zig/metadata.xml                    |  3 +++
 dev-lang/zig/zig-9999.ebuild                 | 28 +++++++++++++++++++++++++++-
 3 files changed, 42 insertions(+), 1 deletion(-)

diff --git a/dev-lang/zig/files/zig-9999-stage2-fix.patch b/dev-lang/zig/files/zig-9999-stage2-fix.patch
new file mode 100644
index 000000000000..520be382c562
--- /dev/null
+++ b/dev-lang/zig/files/zig-9999-stage2-fix.patch
@@ -0,0 +1,12 @@
+diff --git a/build.zig b/build.zig
+index 4d3cf49..4601935 100644
+--- a/build.zig
++++ b/build.zig
+@@ -550,6 +550,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);
+             exe.linkSystemLibrary("pthread");

diff --git a/dev-lang/zig/metadata.xml b/dev-lang/zig/metadata.xml
index 9a74b67c8634..6555f4c1c940 100644
--- a/dev-lang/zig/metadata.xml
+++ b/dev-lang/zig/metadata.xml
@@ -2,6 +2,9 @@
 <!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
 <pkgmetadata>
 	<!-- maintainer-needed -->
+	<use>
+		<flag name="stage2">Install stage2 alongside stage1</flag>
+	</use>
 	<upstream>
 		<remote-id type="github">ziglang/zig</remote-id>
 	</upstream>

diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
index a0e3522a22a0..cdac1427ee7e 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"
+IUSE="test +stage2"
 RESTRICT="!test? ( test )"
 
 BUILD_DIR="${S}/build"
@@ -47,6 +47,9 @@ llvm_check_deps() {
 # see https://github.com/ziglang/zig/wiki/Troubleshooting-Build-Issues#high-memory-requirements
 CHECKREQS_MEMORY="10G"
 
+# see https://github.com/ziglang/zig/issues/11137
+PATCHES=( "${FILESDIR}/${P}-stage2-fix.patch" )
+
 pkg_setup() {
 	llvm_pkg_setup
 	check-reqs_pkg_setup
@@ -61,7 +64,30 @@ src_configure() {
 	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 || die
+	fi
+}
+
 src_test() {
 	cd "${BUILD_DIR}" || die
 	./zig build test || die
 }
+
+src_install() {
+	cmake_src_install
+
+	if use stage2 ; then
+		cd "${BUILD_DIR}" || die
+		mv ./stage2/bin/zig zig-stage2 || die
+		dobin zig-stage2
+	fi
+}
+
+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"
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2020-07-30 22:11 Michał Górny
  0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2020-07-30 22:11 UTC (permalink / raw
  To: gentoo-commits

commit:     fe45fe353d86f7b7990f38998cd176ca6dec9d1d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 29 11:41:17 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jul 30 22:09:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fe45fe35

dev-lang/zig: Remove old (LLVM 8)

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-lang/zig/Manifest                              |  1 -
 .../zig/files/zig-0.4.0-r1-build-artifacts.patch   | 61 ----------------------
 .../zig/files/zig-0.4.0-r1-suppress-warnings.patch | 31 -----------
 dev-lang/zig/zig-0.4.0-r1.ebuild                   | 49 -----------------
 4 files changed, 142 deletions(-)

diff --git a/dev-lang/zig/Manifest b/dev-lang/zig/Manifest
index a3f8c62566b..681529cf54a 100644
--- a/dev-lang/zig/Manifest
+++ b/dev-lang/zig/Manifest
@@ -1,2 +1 @@
-DIST zig-0.4.0.tar.gz 8924757 BLAKE2B 5ca3377f205694ff02360900b49eee7347cdf1cdaef90f1be071eff2610425ed453dfb35928fbe65b25f151b7153ab838c887d362ed3cd746f07833ae42510fd SHA512 423915730bc4ae9a67db3731a96471467826d16e59b87b3541f3e8ed2436f941939f22ccbebdb9a958a195b05360eb65f5be1658b32a01cc8db55c6e581eb039
 DIST zig-0.5.0.tar.gz 15743912 BLAKE2B 1a28dffebc24200cf51e1d94ff7203c8de5641e1a299eff58e808a5a8f3257fc8ff771699a0f90733702b90e5536990adc5bf41b973b4ea642081ef788f7a83d SHA512 9fc2ef827421e54e8db98ce3474ba3bbe9119b0b9aa30b4edd78d73277d2384067b5c78f4ebbca350a97ac230131e7f71e6d54c1e75fc74e1833ce6c51c402df

diff --git a/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch b/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch
deleted file mode 100644
index 11868e93a8a..00000000000
--- a/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch
+++ /dev/null
@@ -1,61 +0,0 @@
-From 81767a658d07219a402384f98a7553abcbbd2e70 Mon Sep 17 00:00:00 2001
-From: Marc Tiehuis <marctiehuis@gmail.com>
-Date: Thu, 18 Apr 2019 18:58:12 +1200
-Subject: [PATCH] Don't install stage2 artifacts
-
-Fixes #2220.
----
- CMakeLists.txt          | 11 ++++++++++-
- 1 file changed, 11 insertions(+), 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 1b017a881..047d538e8 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -58,6 +58,16 @@ endif()
- 
- set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
- 
-+# Handle multi-config builds and place each into a common lib. The VS generator
-+# for example will append a Debug folder by default if not explicitly specified.
-+set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
-+set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
-+foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
-+    string(TOUPPER ${CONFIG_TYPE} CONFIG_TYPE)
-+    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
-+    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
-+endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
-+
- if(ZIG_FORCE_EXTERNAL_LLD)
-     find_package(lld)
-     include_directories(${LLVM_INCLUDE_DIRS})
-@@ -253,7 +263,6 @@ else()
-         embedded_lld_wasm
-         embedded_lld_lib
-     )
--    install(TARGETS embedded_lld_elf embedded_lld_coff embedded_lld_mingw embedded_lld_wasm embedded_lld_lib DESTINATION "${ZIG_CPP_LIB_DIR}")
- endif()
- 
- # No patches have been applied to SoftFloat-3e
-
-From 40fe6afdad1a8676b5d3a5dd23d6d50d6ea9f059 Mon Sep 17 00:00:00 2001
-From: Marc Tiehuis <marctiehuis@gmail.com>
-Date: Wed, 1 May 2019 17:39:23 +1200
-Subject: [PATCH] Don't install zig_cpp lib for stage2 target
-
-Missed in last commit. See #2220.
----
- CMakeLists.txt | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 047d538e8..9881ce1de 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -6671,6 +6681,5 @@
- endif()
- install(TARGETS zig DESTINATION bin)
--install(TARGETS zig_cpp DESTINATION "${ZIG_CPP_LIB_DIR}")
- 
- foreach(file ${ZIG_C_HEADER_FILES})
-     get_filename_component(file_dir "${C_HEADERS_DEST}/${file}" DIRECTORY)

diff --git a/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch b/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch
deleted file mode 100644
index 1dc92f88ecb..00000000000
--- a/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-Don't attempt to look for static libraries that we're not going to use.
-The warnings are only triggered when building with portage.
-
---- a/cmake/Findllvm.cmake
-+++ b/cmake/Findllvm.cmake
-@@ -50,25 +50,6 @@
-     endif()
- endfunction(NEED_TARGET)
- 
--if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
--  execute_process(
--      COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
--      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
--      OUTPUT_STRIP_TRAILING_WHITESPACE)
--  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")
--
--  execute_process(
--      COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
--      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
--      OUTPUT_STRIP_TRAILING_WHITESPACE)
--  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
--
--  execute_process(
--      COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
--      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
--      OUTPUT_STRIP_TRAILING_WHITESPACE)
--  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
--endif()
- if(NOT LLVM_LIBRARIES)
-   execute_process(
-       COMMAND ${LLVM_CONFIG_EXE} --libs

diff --git a/dev-lang/zig/zig-0.4.0-r1.ebuild b/dev-lang/zig/zig-0.4.0-r1.ebuild
deleted file mode 100644
index bedd9d7ba9b..00000000000
--- a/dev-lang/zig/zig-0.4.0-r1.ebuild
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-inherit cmake-utils llvm
-
-DESCRIPTION="A robust, optimal, and maintainable programming language"
-HOMEPAGE="https://ziglang.org/"
-LICENSE="MIT"
-SLOT="0"
-IUSE="+experimental"
-
-if [[ ${PV} == 9999 ]]; then
-	EGIT_REPO_URI="https://github.com/ziglang/zig.git"
-	inherit git-r3
-else
-	SRC_URI="https://github.com/ziglang/zig/archive/${PV}.tar.gz -> ${P}.tar.gz"
-	KEYWORDS="~amd64"
-fi
-
-ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX
-	PowerPC Sparc SystemZ WebAssembly X86 XCore )
-ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
-# According to zig's author, zig builds that do not support all targets are not
-# supported by the upstream project.
-LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]}
-
-RDEPEND="
-	sys-devel/llvm:8
-	!experimental? ( sys-devel/llvm:8[${LLVM_TARGET_USEDEPS// /,}] )
-"
-
-DEPEND="${RDEPEND}"
-
-PATCHES=(
-	"${FILESDIR}/zig-0.4.0-r1-build-artifacts.patch"
-	"${FILESDIR}/zig-0.4.0-r1-suppress-warnings.patch"
-)
-
-LLVM_MAX_SLOT=8
-
-src_prepare() {
-	if use experimental; then
-		sed -i '/^NEED_TARGET(/d' cmake/Findllvm.cmake || die "unable to modify cmake/Findllvm.cmake"
-	fi
-
-	cmake-utils_src_prepare
-}


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/
@ 2019-08-07 18:28 Joonas Niilola
  0 siblings, 0 replies; 7+ messages in thread
From: Joonas Niilola @ 2019-08-07 18:28 UTC (permalink / raw
  To: gentoo-commits

commit:     d71767d8b9454f990c4f220aacc316e2914b7af6
Author:     Nick Erdmann <n <AT> nirf <DOT> de>
AuthorDate: Sat Aug  3 15:05:42 2019 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Aug  7 18:27:26 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d71767d8

dev-lang/zig: switch to EAPI=6, use patch files

Signed-off-by: Nick Erdmann <n <AT> nirf.de>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../zig/files/zig-0.4.0-r1-build-artifacts.patch   | 61 ++++++++++++++++++++++
 .../zig/files/zig-0.4.0-r1-suppress-warnings.patch | 31 +++++++++++
 dev-lang/zig/zig-0.4.0-r1.ebuild                   | 47 +++++++++++++++++
 3 files changed, 139 insertions(+)

diff --git a/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch b/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch
new file mode 100644
index 00000000000..11868e93a8a
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.4.0-r1-build-artifacts.patch
@@ -0,0 +1,61 @@
+From 81767a658d07219a402384f98a7553abcbbd2e70 Mon Sep 17 00:00:00 2001
+From: Marc Tiehuis <marctiehuis@gmail.com>
+Date: Thu, 18 Apr 2019 18:58:12 +1200
+Subject: [PATCH] Don't install stage2 artifacts
+
+Fixes #2220.
+---
+ CMakeLists.txt          | 11 ++++++++++-
+ 1 file changed, 11 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 1b017a881..047d538e8 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -58,6 +58,16 @@ endif()
+ 
+ set(ZIG_CPP_LIB_DIR "${CMAKE_BINARY_DIR}/zig_cpp")
+ 
++# Handle multi-config builds and place each into a common lib. The VS generator
++# for example will append a Debug folder by default if not explicitly specified.
++set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
++set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ZIG_CPP_LIB_DIR})
++foreach(CONFIG_TYPE ${CMAKE_CONFIGURATION_TYPES})
++    string(TOUPPER ${CONFIG_TYPE} CONFIG_TYPE)
++    set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
++    set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_${CONFIG_TYPE} ${ZIG_CPP_LIB_DIR})
++endforeach(CONFIG_TYPE CMAKE_CONFIGURATION_TYPES)
++
+ if(ZIG_FORCE_EXTERNAL_LLD)
+     find_package(lld)
+     include_directories(${LLVM_INCLUDE_DIRS})
+@@ -253,7 +263,6 @@ else()
+         embedded_lld_wasm
+         embedded_lld_lib
+     )
+-    install(TARGETS embedded_lld_elf embedded_lld_coff embedded_lld_mingw embedded_lld_wasm embedded_lld_lib DESTINATION "${ZIG_CPP_LIB_DIR}")
+ endif()
+ 
+ # No patches have been applied to SoftFloat-3e
+
+From 40fe6afdad1a8676b5d3a5dd23d6d50d6ea9f059 Mon Sep 17 00:00:00 2001
+From: Marc Tiehuis <marctiehuis@gmail.com>
+Date: Wed, 1 May 2019 17:39:23 +1200
+Subject: [PATCH] Don't install zig_cpp lib for stage2 target
+
+Missed in last commit. See #2220.
+---
+ CMakeLists.txt | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 047d538e8..9881ce1de 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6671,6 +6681,5 @@
+ endif()
+ install(TARGETS zig DESTINATION bin)
+-install(TARGETS zig_cpp DESTINATION "${ZIG_CPP_LIB_DIR}")
+ 
+ foreach(file ${ZIG_C_HEADER_FILES})
+     get_filename_component(file_dir "${C_HEADERS_DEST}/${file}" DIRECTORY)

diff --git a/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch b/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch
new file mode 100644
index 00000000000..1dc92f88ecb
--- /dev/null
+++ b/dev-lang/zig/files/zig-0.4.0-r1-suppress-warnings.patch
@@ -0,0 +1,31 @@
+Don't attempt to look for static libraries that we're not going to use.
+The warnings are only triggered when building with portage.
+
+--- a/cmake/Findllvm.cmake
++++ b/cmake/Findllvm.cmake
+@@ -50,25 +50,6 @@
+     endif()
+ endfunction(NEED_TARGET)
+ 
+-if(NOT(CMAKE_BUILD_TYPE STREQUAL "Debug") OR ZIG_STATIC)
+-  execute_process(
+-      COMMAND ${LLVM_CONFIG_EXE} --libfiles --link-static
+-      OUTPUT_VARIABLE LLVM_LIBRARIES_SPACES
+-      OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  string(REPLACE " " ";" LLVM_LIBRARIES "${LLVM_LIBRARIES_SPACES}")
+-
+-  execute_process(
+-      COMMAND ${LLVM_CONFIG_EXE} --system-libs --link-static
+-      OUTPUT_VARIABLE LLVM_SYSTEM_LIBS_SPACES
+-      OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  string(REPLACE " " ";" LLVM_SYSTEM_LIBS "${LLVM_SYSTEM_LIBS_SPACES}")
+-
+-  execute_process(
+-      COMMAND ${LLVM_CONFIG_EXE} --libdir --link-static
+-      OUTPUT_VARIABLE LLVM_LIBDIRS_SPACES
+-      OUTPUT_STRIP_TRAILING_WHITESPACE)
+-  string(REPLACE " " ";" LLVM_LIBDIRS "${LLVM_LIBDIRS_SPACES}")
+-endif()
+ if(NOT LLVM_LIBRARIES)
+   execute_process(
+       COMMAND ${LLVM_CONFIG_EXE} --libs

diff --git a/dev-lang/zig/zig-0.4.0-r1.ebuild b/dev-lang/zig/zig-0.4.0-r1.ebuild
new file mode 100644
index 00000000000..de7dd259a3d
--- /dev/null
+++ b/dev-lang/zig/zig-0.4.0-r1.ebuild
@@ -0,0 +1,47 @@
+# Copyright 2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit cmake-utils llvm
+
+DESCRIPTION="A robust, optimal, and maintainable programming language"
+HOMEPAGE="https://ziglang.org/"
+LICENSE="MIT"
+SLOT="0"
+IUSE="+experimental"
+
+if [[ ${PV} == 9999 ]]; then
+	EGIT_REPO_URI="https://github.com/ziglang/zig.git"
+	inherit git-r3
+else
+	SRC_URI="https://github.com/ziglang/zig/archive/${PV}.tar.gz -> ${P}.tar.gz"
+	KEYWORDS="~amd64"
+fi
+
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX
+	PowerPC Sparc SystemZ WebAssembly X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+# According to zig's author, zig builds that do not support all targets are not
+# supported by the upstream project.
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]}
+
+RDEPEND="
+	sys-devel/llvm:8
+	!experimental? ( sys-devel/llvm:8[${LLVM_TARGET_USEDEPS// /,}] )
+"
+
+DEPEND="${RDEPEND}"
+
+PATCHES=(
+	"${FILESDIR}/zig-0.4.0-r1-build-artifacts.patch"
+	"${FILESDIR}/zig-0.4.0-r1-suppress-warnings.patch"
+)
+
+src_prepare() {
+	if use experimental; then
+		sed -i '/^NEED_TARGET(/d' cmake/Findllvm.cmake || die "unable to modify cmake/Findllvm.cmake"
+	fi
+
+	cmake-utils_src_prepare
+}


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-08-23  2:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-18 15:00 [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/files/, dev-lang/zig/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2024-08-23  2:08 Eli Schwartz
2023-07-09  2:02 Sam James
2023-01-14 19:17 Sam James
2022-04-30  8:13 Joonas Niilola
2020-07-30 22:11 Michał Górny
2019-08-07 18:28 Joonas Niilola

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox