1 |
commit: 7db46d9c14a7861364bad78076c8fb0fb2664abd |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jan 30 20:42:29 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jan 30 20:51:17 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7db46d9c |
7 |
|
8 |
dev-ml/llvm-ocaml: Bump to 10.0.0_rc1 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-ml/llvm-ocaml/Manifest | 1 + |
13 |
dev-ml/llvm-ocaml/llvm-ocaml-10.0.0_rc1.ebuild | 126 +++++++++++++++++++++++++ |
14 |
2 files changed, 127 insertions(+) |
15 |
|
16 |
diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest |
17 |
index b3c965e40eb..0034fe2d7c1 100644 |
18 |
--- a/dev-ml/llvm-ocaml/Manifest |
19 |
+++ b/dev-ml/llvm-ocaml/Manifest |
20 |
@@ -1,3 +1,4 @@ |
21 |
DIST llvm-7.1.0.src.tar.xz 28313784 BLAKE2B b78d9a7fc5ef6e352e77d339e5c4eef5ccedf67c05e7abd949e72619aa8a5ed65e7e5e2008354be8e7916d75581719b99f34227838fcc86c5d0080913c2fb22c SHA512 a7dbd5693d1f2dae6b6e52893a100f9349cbfcfb25c5fdcad46364acbff0dbd3573f8fbc026c68eb9fd56335198aa94b866cc3dd7ea0cbd2cbfb5f8fe3444a7a |
22 |
DIST llvm-8.0.1.src.tar.xz 30477608 BLAKE2B 4319c837b36111401e3b0f9659b8d875c89463bcc7816df1aefe1e3ff989860bbaa92504718f8e15416cfd9f3491c13777cd5cb661877b237b342b0e515b93f5 SHA512 82e120be5cabdfd5111aebbea68a663fe229c8861d73802d6ab09a3bf48f60de333e07e61f8fb61beaa14ac2bea24fcd74fa6f761acaf62469f536b79fcb1e16 |
23 |
+DIST llvmorg-10.0.0-rc1.tar.gz 120755822 BLAKE2B a729d37d96ba498cb865c6f708734dccb796b2caabb69167b9aa3b0e12c788f2a5980a048b99d5603da3d26af909fb31f406b4f4743cabae56c45f829a7bf695 SHA512 27137fc700971147c00ded6787eaae9f0bcf98c938fe227a5a559b38d983736f3d086f4ff6772d802c5f48a7d97a97c293261e4af88fcb5a720693b9cb5a4f02 |
24 |
DIST llvmorg-9.0.1.tar.gz 113193320 BLAKE2B b86e405f2b8e00436045fd409fe19cdde75c797b1192c62a22b5ec75e6b4dc8e874a0f33008dc31562445e4cbe53a992b6f48c684255a6a1ef261e595b8b161f SHA512 fa88beeaae94b6d0cd9b5ba38658d0ffed8004035d7d8a4f95c3d31a709b88b581ae9bd7761333c8e5375c44b8f6be01768b5a3be901163159d7e6c43b71da59 |
25 |
|
26 |
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0_rc1.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0_rc1.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..b9f6124e6f0 |
29 |
--- /dev/null |
30 |
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0_rc1.ebuild |
31 |
@@ -0,0 +1,126 @@ |
32 |
+# Copyright 1999-2020 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+PYTHON_COMPAT=( python{2_7,3_{6,7}} ) |
38 |
+inherit cmake-utils llvm llvm.org multiprocessing python-any-r1 |
39 |
+ |
40 |
+DESCRIPTION="OCaml bindings for LLVM" |
41 |
+HOMEPAGE="https://llvm.org/" |
42 |
+LLVM_COMPONENTS=( llvm ) |
43 |
+llvm.org_set_globals |
44 |
+ |
45 |
+# Keep in sync with sys-devel/llvm |
46 |
+ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC AVR ) |
47 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 |
48 |
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore |
49 |
+ "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" ) |
50 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
51 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
52 |
+ |
53 |
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA" |
54 |
+SLOT="0/${PV}" |
55 |
+KEYWORDS="" |
56 |
+IUSE="debug test ${ALL_LLVM_TARGETS[*]}" |
57 |
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )" |
58 |
+RESTRICT="!test? ( test )" |
59 |
+ |
60 |
+RDEPEND=" |
61 |
+ >=dev-lang/ocaml-4.00.0:0= |
62 |
+ dev-ml/ocaml-ctypes:= |
63 |
+ ~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?] |
64 |
+ !sys-devel/llvm[ocaml(-)]" |
65 |
+DEPEND="${RDEPEND}" |
66 |
+BDEPEND=" |
67 |
+ dev-lang/perl |
68 |
+ dev-ml/findlib |
69 |
+ test? ( dev-ml/ounit ) |
70 |
+ ${PYTHON_DEPS}" |
71 |
+ |
72 |
+# least intrusive of all |
73 |
+CMAKE_BUILD_TYPE=RelWithDebInfo |
74 |
+ |
75 |
+pkg_setup() { |
76 |
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup |
77 |
+ python-any-r1_pkg_setup |
78 |
+} |
79 |
+ |
80 |
+src_prepare() { |
81 |
+ # Python is needed to run tests using lit |
82 |
+ python_setup |
83 |
+ |
84 |
+ cmake-utils_src_prepare |
85 |
+} |
86 |
+ |
87 |
+src_configure() { |
88 |
+ local libdir=$(get_libdir) |
89 |
+ local mycmakeargs=( |
90 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
91 |
+ |
92 |
+ -DBUILD_SHARED_LIBS=OFF |
93 |
+ -DLLVM_BUILD_LLVM_DYLIB=ON |
94 |
+ -DLLVM_LINK_LLVM_DYLIB=ON |
95 |
+ -DLLVM_OCAML_OUT_OF_TREE=ON |
96 |
+ |
97 |
+ # cheap hack: LLVM combines both anyway, and the only difference |
98 |
+ # is that the former list is explicitly verified at cmake time |
99 |
+ -DLLVM_TARGETS_TO_BUILD="" |
100 |
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
101 |
+ -DLLVM_BUILD_TESTS=$(usex test) |
102 |
+ |
103 |
+ # disable various irrelevant deps and settings |
104 |
+ -DLLVM_ENABLE_FFI=OFF |
105 |
+ -DLLVM_ENABLE_TERMINFO=OFF |
106 |
+ -DHAVE_HISTEDIT_H=NO |
107 |
+ -DWITH_POLLY=OFF |
108 |
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug) |
109 |
+ -DLLVM_ENABLE_EH=ON |
110 |
+ -DLLVM_ENABLE_RTTI=ON |
111 |
+ |
112 |
+ -DLLVM_HOST_TRIPLE="${CHOST}" |
113 |
+ |
114 |
+ # disable go bindings |
115 |
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND |
116 |
+ |
117 |
+ # TODO: ocamldoc |
118 |
+ ) |
119 |
+ |
120 |
+ use test && mycmakeargs+=( |
121 |
+ -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}" |
122 |
+ ) |
123 |
+ |
124 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
125 |
+ # also: custom rules for OCaml do not work for CPPFLAGS |
126 |
+ use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG" |
127 |
+ cmake-utils_src_configure |
128 |
+ |
129 |
+ local llvm_libdir=$(llvm-config --libdir) |
130 |
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml... |
131 |
+ cd "${BUILD_DIR}/${libdir}" || die |
132 |
+ ln -s "${llvm_libdir}"/*.so . || die |
133 |
+ |
134 |
+ if use test; then |
135 |
+ local llvm_bindir=$(llvm-config --bindir) |
136 |
+ # Force using system-installed tools. |
137 |
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \ |
138 |
+ "${BUILD_DIR}"/test/lit.site.cfg.py || die |
139 |
+ fi |
140 |
+} |
141 |
+ |
142 |
+src_compile() { |
143 |
+ cmake-utils_src_compile ocaml_all |
144 |
+} |
145 |
+ |
146 |
+src_test() { |
147 |
+ # respect TMPDIR! |
148 |
+ local -x LIT_PRESERVES_TMP=1 |
149 |
+ cmake-utils_src_make check-llvm-bindings-ocaml |
150 |
+} |
151 |
+ |
152 |
+src_install() { |
153 |
+ DESTDIR="${D}" \ |
154 |
+ cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die |
155 |
+ |
156 |
+ dodoc bindings/ocaml/README.txt |
157 |
+} |