diff options
author | Eric Joldasov <bratishkaerik@getgoogleoff.me> | 2023-01-25 10:52:56 +0600 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2023-03-09 11:53:58 +0100 |
commit | e2bc05c42635e53cc3f98b344b81cf50b0cc6e88 (patch) | |
tree | a8b02dfc066f60600760ca0250fff5d9226e4253 /dev-lang/zig-bin | |
parent | dev-lang/zig: slotting, initial support for setting ZIG_{MCPU,TARGET} (diff) | |
download | gentoo-e2bc05c42635e53cc3f98b344b81cf50b0cc6e88.tar.gz gentoo-e2bc05c42635e53cc3f98b344b81cf50b0cc6e88.tar.bz2 gentoo-e2bc05c42635e53cc3f98b344b81cf50b0cc6e88.zip |
dev-lang/zig-bin: slotting
* Slot Zig and handle /usr/bin/zig via eselect-zig
* Add "doc" USE flag for installing language reference and stdlib documentation
Followup to previous commit 6ea1afff4a2aa9c753eb154e51decb2b5996b029.
Signed-off-by: Eric Joldasov <bratishkaerik@getgoogleoff.me>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Diffstat (limited to 'dev-lang/zig-bin')
-rw-r--r-- | dev-lang/zig-bin/zig-bin-0.10.1-r1.ebuild | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/dev-lang/zig-bin/zig-bin-0.10.1-r1.ebuild b/dev-lang/zig-bin/zig-bin-0.10.1-r1.ebuild new file mode 100644 index 000000000000..81c98e238a76 --- /dev/null +++ b/dev-lang/zig-bin/zig-bin-0.10.1-r1.ebuild @@ -0,0 +1,56 @@ +# Copyright 2022-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DESCRIPTION="A robust, optimal, and maintainable programming language" +HOMEPAGE="https://ziglang.org/" +SRC_URI=" + amd64? ( https://ziglang.org/download/${PV}/zig-linux-x86_64-${PV}.tar.xz ) + arm? ( https://ziglang.org/download/${PV}/zig-linux-armv7a-${PV}.tar.xz ) + arm64? ( https://ziglang.org/download/${PV}/zig-linux-aarch64-${PV}.tar.xz ) + riscv? ( https://ziglang.org/download/${PV}/zig-linux-riscv64-${PV}.tar.xz ) + x86? ( https://ziglang.org/download/${PV}/zig-linux-i386-${PV}.tar.xz )" + +LICENSE="MIT" +SLOT="$(ver_cut 1-2)" +KEYWORDS="-* ~amd64 ~arm ~arm64 ~riscv ~x86" +IUSE="doc" + +RDEPEND="app-eselect/eselect-zig" +# Zig provides its standard library in source form "/opt/zig-bin-{PV}/lib/", +# and all other Zig libraries are meant to be consumed in source form, +# because they can use compile-time mechanics (and it is easier for distributions to patch them) +# Here we use this feature for fixing programs that use standard library +# Note: Zig build system is also part of standard library, so we can fix it too +#PATCHES=( ) + +QA_PREBUILT="opt/${P}/zig" + +src_unpack() { + unpack ${A} + + mv "${WORKDIR}/"* "${S}" || die +} + +src_install() { + insinto /opt/ + + use doc && local HTML_DOCS=( "doc/langref.html" "doc/std/" ) + einstalldocs + rm -r ./doc/ || die + + doins -r "${S}" + fperms 0755 "/opt/${P}/zig" + dosym -r "/opt/${P}/zig" "/usr/bin/zig-bin-${PV}" +} + +pkg_postinst() { + elog "0.10.1 release uses self-hosted compiler by default and fixes some bugs from 0.10.0" + elog "But your code still can be un-compilable since some features still not implemented or bugs not fixed" + elog "Upstream recommends:" + elog " * Using old compiler if experiencing such breakage (flag '-fstage1')" + elog " * Waiting for release 0.11.0 with old compiler removed (these changes are already merged in 9999)" + 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" +} |