diff options
author | Eric Joldasov <bratishkaerik@getgoogleoff.me> | 2022-11-01 09:56:36 +0600 |
---|---|---|
committer | Sam James <sam@gentoo.org> | 2022-11-07 06:51:57 +0000 |
commit | f28480799d348da161f8d121df2fb99c73250ab3 (patch) | |
tree | 5c5b1136fbc88e7182410981d77860fe6a82a3b3 /dev-lang/zig | |
parent | app-misc/rlwrap: add 0.46.1 (diff) | |
download | gentoo-f28480799d348da161f8d121df2fb99c73250ab3.tar.gz gentoo-f28480799d348da161f8d121df2fb99c73250ab3.tar.bz2 gentoo-f28480799d348da161f8d121df2fb99c73250ab3.zip |
dev-lang/zig: add 0.10.0
Drop "threads" USE flag, since this is default and well-tested
configuration by upstream.
Drop "test" USE flag, since it doesn't require special dependencies (or preparations)
necessary to run tests.
Bug: https://bugs.gentoo.org/876181
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'dev-lang/zig')
-rw-r--r-- | dev-lang/zig/Manifest | 1 | ||||
-rw-r--r-- | dev-lang/zig/zig-0.10.0.ebuild | 81 | ||||
-rw-r--r-- | dev-lang/zig/zig-9999.ebuild | 9 |
3 files changed, 86 insertions, 5 deletions
diff --git a/dev-lang/zig/Manifest b/dev-lang/zig/Manifest index f18eeb3ba012..fd2ecb470579 100644 --- a/dev-lang/zig/Manifest +++ b/dev-lang/zig/Manifest @@ -1,2 +1,3 @@ +DIST zig-0.10.0.tar.xz 14530912 BLAKE2B 5949a44ee039b7d5a163344a0fc26af8dd9cf311ed25c7092a665bb59ec7dec8dc3cd39918d81ef02c707aa8989b038fb21dfba3927fd31153a1404739b4ea3c SHA512 9d83ce51cc0ce404c06da820179c1cc47aa50e573fb1c831a96baa12c6b5226abe85b384110f2ffc4cbdc5f24eaba1f14a4e3249ffeaa248c0d73ba29859e682 DIST zig-0.9.1-fix-detecting-abi.patch 22233 BLAKE2B fa523c4c4c23a74c0b4f85c6d2d91ef98b31d25694bb9dbc7988b82db972a16ab273aa9f1883cfa8ca79ef7fc56fca67d0a8656ba248b6db47bc902b7ac64a93 SHA512 259967f88f54c20f556bd9d67189ce3a2cfeb0250f0cee4dffb29020d976d61265a5dd9ae9cfcadfb7b1e152b47ee17f4184eafac2b80495f4ee8f98733cd692 DIST zig-0.9.1.tar.xz 13940828 BLAKE2B 996b0e945f61b01dddbb7c8674a9e2d2d01b93eb48fdfd2c986496330990ffa64cba15f8bd8518b90ef6f514759ba6cc3fd31d6044c5b11b92bf92e3f7f15303 SHA512 0b8a5f9b7e34e4252536f59bc91429f1e76b2bf8e01f024095919f6ecf34db56b5c86c554fbb94bdcb5255394c87f2c87519c8f34c631f53816927ec0882ae2d diff --git a/dev-lang/zig/zig-0.10.0.ebuild b/dev-lang/zig/zig-0.10.0.ebuild new file mode 100644 index 000000000000..451df4ef6f6d --- /dev/null +++ b/dev-lang/zig/zig-0.10.0.ebuild @@ -0,0 +1,81 @@ +# Copyright 2019-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +LLVM_MAX_SLOT=15 +inherit cmake llvm check-reqs + +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 + SRC_URI="https://ziglang.org/download/${PV}/${P}.tar.xz" + KEYWORDS="~amd64 ~arm ~arm64" +fi + +LICENSE="MIT" +SLOT="0" + +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} + !dev-lang/zig-bin +" + +llvm_check_deps() { + has_version "sys-devel/clang:${LLVM_SLOT}" +} + +# see https://ziglang.org/download/0.10.0/release-notes.html#Self-Hosted-Compiler +# 0.10.0 release - ~9.6 GiB, since we use compiler written in C++ for bootstrapping +# 0.11.0 release - ~2.8 GiB, since we will (at least according to roadmap) use self-hosted compiler +# (transpiled to C via C backend) for bootstrapping +CHECKREQS_MEMORY="10G" + +pkg_setup() { + llvm_pkg_setup + check-reqs_pkg_setup +} + +src_configure() { + local mycmakeargs=( + -DZIG_USE_CCACHE=OFF + -DZIG_SHARED_LLVM=ON + -DCMAKE_PREFIX_PATH=$(get_llvm_prefix ${LLVM_MAX_SLOT}) + ) + + cmake_src_configure +} + +src_test() { + cd "${BUILD_DIR}" || die + ./zig2 build test -Dstatic-llvm=false -Denable-llvm=true -Dskip-non-native=true || die +} + +# see https://github.com/ziglang/zig/issues/3382 +# For now, Zig doesn't support CFLAGS/LDFLAGS/etc. +QA_FLAGS_IGNORED="usr/bin/zig" + +pkg_postinst() { + elog "0.10.0 release introduces self-hosted compiler for general use by default" + elog "It means that your code can be un-compilable since this compiler has some new or removed features and new or fixed bugs" + elog "Upstream recommends using stage1 if experiencing such breakage," + elog "until bugfix release 0.10.1 or release 0.11.0 where old compiler will be fully replaced" + elog "You can use old compiler by using '-fstage1' flag" + elog "Also see: https://ziglang.org/download/0.10.0/release-notes.html#Self-Hosted-Compiler" + elog "and https://ziglang.org/download/0.10.0/release-notes.html#How-to-Upgrade" +} diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild index f4f7a100d588..b5b25d1f884f 100644 --- a/dev-lang/zig/zig-9999.ebuild +++ b/dev-lang/zig/zig-9999.ebuild @@ -42,7 +42,10 @@ llvm_check_deps() { has_version "sys-devel/clang:${LLVM_SLOT}" } -# see https://github.com/ziglang/zig/wiki/Troubleshooting-Build-Issues#high-memory-requirements +# see https://ziglang.org/download/0.10.0/release-notes.html#Self-Hosted-Compiler +# 0.10.0 release - 9.6 GiB, since we use compiler written in C++ for bootstrapping +# 0.11.0 release - ~2.8 GiB, since we will (at least according to roadmap) use self-hosted compiler +# (transpiled to C via C backend) for bootstrapping CHECKREQS_MEMORY="10G" pkg_setup() { @@ -68,7 +71,3 @@ src_test() { # see https://github.com/ziglang/zig/issues/3382 QA_FLAGS_IGNORED="usr/bin/zig" - -pkg_postinst() { - elog "If you want to use stage1 backend, use -fstage1 flag" -} |