diff options
Diffstat (limited to 'dev-lang/zig/zig-9999.ebuild')
-rw-r--r-- | dev-lang/zig/zig-9999.ebuild | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild index 1ce53e760265..cdac1427ee7e 100644 --- a/dev-lang/zig/zig-9999.ebuild +++ b/dev-lang/zig/zig-9999.ebuild @@ -12,13 +12,13 @@ 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" + SRC_URI="https://ziglang.org/download/${PV}/${P}.tar.xz" KEYWORDS="~amd64 ~arm ~arm64" 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" +} |