Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/zig/
Date: Sun, 08 Sep 2019 15:59:59
Message-Id: 1567958375.220ace90a4fdcec12c40466284e4a4bb3e01fd10.juippis@gentoo
1 commit: 220ace90a4fdcec12c40466284e4a4bb3e01fd10
2 Author: Nick Erdmann <n <AT> nirf <DOT> de>
3 AuthorDate: Fri Aug 2 14:59:01 2019 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 8 15:59:35 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=220ace90
7
8 dev-lang/zig: add version 9999
9
10 Signed-off-by: Nick Erdmann <n <AT> nirf.de>
11 Closes: https://github.com/gentoo/gentoo/pull/12599
12 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
13
14 dev-lang/zig/zig-9999.ebuild | 61 ++++++++++++++++++++++++++++++++++++++++++++
15 1 file changed, 61 insertions(+)
16
17 diff --git a/dev-lang/zig/zig-9999.ebuild b/dev-lang/zig/zig-9999.ebuild
18 new file mode 100644
19 index 00000000000..055f1f17b8a
20 --- /dev/null
21 +++ b/dev-lang/zig/zig-9999.ebuild
22 @@ -0,0 +1,61 @@
23 +# Copyright 2019 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=7
27 +
28 +inherit cmake-utils llvm
29 +
30 +DESCRIPTION="A robust, optimal, and maintainable programming language"
31 +HOMEPAGE="https://ziglang.org/"
32 +LICENSE="MIT"
33 +SLOT="0"
34 +IUSE="+experimental"
35 +
36 +if [[ ${PV} == 9999 ]]; then
37 + EGIT_REPO_URI="https://github.com/ziglang/zig.git"
38 + inherit git-r3
39 +else
40 + SRC_URI="https://github.com/ziglang/zig/archive/${PV}.tar.gz -> ${P}.tar.gz"
41 + KEYWORDS="~amd64"
42 +fi
43 +
44 +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 NVPTX
45 + PowerPC Sparc SystemZ WebAssembly X86 XCore )
46 +ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
47 +# According to zig's author, zig builds that do not support all targets are not
48 +# supported by the upstream project.
49 +LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]}
50 +
51 +RDEPEND="
52 + sys-devel/llvm:8
53 + !experimental? ( sys-devel/llvm:8[${LLVM_TARGET_USEDEPS// /,}] )
54 + sys-devel/clang:8
55 +"
56 +
57 +DEPEND="${RDEPEND}"
58 +
59 +LLVM_MAX_SLOT=8
60 +
61 +llvm_check_deps() {
62 + has_version "sys-devel/clang:${LLVM_SLOT}"
63 +}
64 +
65 +src_prepare() {
66 + if use experimental; then
67 + sed -i '/^NEED_TARGET(/d' cmake/Findllvm.cmake || die "unable to modify cmake/Findllvm.cmake"
68 + fi
69 +
70 + sed -i 's/--prefix "${CMAKE_INSTALL_PREFIX}"/--prefix ".\/${CMAKE_INSTALL_PREFIX}"/' CMakeLists.txt || \
71 + die "unable to fix install path"
72 +
73 + cmake-utils_src_prepare
74 +}
75 +
76 +src_configure() {
77 + local mycmakeargs=(
78 + -DCLANG_INCLUDE_DIRS="$(llvm-config --includedir)"
79 + -DCLANG_LIBDIRS="$(llvm-config --libdir)"
80 + )
81 +
82 + cmake-utils_src_configure
83 +}