1 |
commit: b82556e19f62d1962a891d811bc5cab1d3aff1bd |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Feb 9 09:52:59 2018 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Feb 9 15:59:58 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b82556e1 |
7 |
|
8 |
dev-ml/llvm-ocaml: Bump to 6.0.0rc2 |
9 |
|
10 |
dev-ml/llvm-ocaml/Manifest | 1 + |
11 |
dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild | 127 ++++++++++++++++++++++++++ |
12 |
2 files changed, 128 insertions(+) |
13 |
|
14 |
diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest |
15 |
index 9f4fafbd243..69a2d356a36 100644 |
16 |
--- a/dev-ml/llvm-ocaml/Manifest |
17 |
+++ b/dev-ml/llvm-ocaml/Manifest |
18 |
@@ -1,2 +1,3 @@ |
19 |
DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c SHA512 16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d |
20 |
DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e SHA512 bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb |
21 |
+DIST llvm-6.0.0rc2.src.tar.xz 25288140 BLAKE2B 095f054ce2ccb1eee3def2b8c6cecc610c4392283062338aa20d2de33c951484a2dc6774db2727e19e879307cfc95dda2730185cde8e52f4f45851d8dd809b3e SHA512 3cb3521ba8d90bf2a90c49d753ab5e92f1e0ccfc86946f3767c06d0f276e2c4cf8ff2f984680835efbaa4dae1cd2d3a074468e547785e05a67ea55311b94a0e9 |
22 |
|
23 |
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild |
24 |
new file mode 100644 |
25 |
index 00000000000..ff74f2cf340 |
26 |
--- /dev/null |
27 |
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild |
28 |
@@ -0,0 +1,127 @@ |
29 |
+# Copyright 1999-2018 Gentoo Foundation |
30 |
+# Distributed under the terms of the GNU General Public License v2 |
31 |
+ |
32 |
+EAPI=6 |
33 |
+ |
34 |
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja} |
35 |
+# (needed due to CMAKE_BUILD_TYPE != Gentoo) |
36 |
+CMAKE_MIN_VERSION=3.7.0-r1 |
37 |
+PYTHON_COMPAT=( python2_7 ) |
38 |
+ |
39 |
+inherit cmake-utils llvm python-any-r1 |
40 |
+ |
41 |
+MY_P=llvm-${PV/_/}.src |
42 |
+DESCRIPTION="OCaml bindings for LLVM" |
43 |
+HOMEPAGE="https://llvm.org/" |
44 |
+SRC_URI="http://prereleases.llvm.org/${PV/_//}/${MY_P}.tar.xz" |
45 |
+ |
46 |
+# Keep in sync with sys-devel/llvm |
47 |
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430 |
48 |
+ NVPTX PowerPC Sparc SystemZ X86 XCore ) |
49 |
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" ) |
50 |
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?} |
51 |
+ |
52 |
+LICENSE="UoI-NCSA" |
53 |
+SLOT="0/${PV}" |
54 |
+KEYWORDS="" |
55 |
+IUSE="debug test ${ALL_LLVM_TARGETS[*]}" |
56 |
+RESTRICT="!test? ( test )" |
57 |
+ |
58 |
+RDEPEND=" |
59 |
+ >=dev-lang/ocaml-4.00.0:0= |
60 |
+ dev-ml/ocaml-ctypes:= |
61 |
+ ~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,},debug?] |
62 |
+ !sys-devel/llvm[ocaml(-)]" |
63 |
+# configparser-3.2 breaks the build (3.3 or none at all are fine) |
64 |
+DEPEND="${RDEPEND} |
65 |
+ dev-lang/perl |
66 |
+ dev-ml/findlib |
67 |
+ test? ( dev-ml/ounit ) |
68 |
+ !!<dev-python/configparser-3.3.0.2 |
69 |
+ ${PYTHON_DEPS}" |
70 |
+ |
71 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE} |
72 |
+ || ( ${ALL_LLVM_TARGETS[*]} )" |
73 |
+ |
74 |
+S=${WORKDIR}/${MY_P} |
75 |
+ |
76 |
+# least intrusive of all |
77 |
+CMAKE_BUILD_TYPE=RelWithDebInfo |
78 |
+ |
79 |
+pkg_setup() { |
80 |
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup |
81 |
+ python-any-r1_pkg_setup |
82 |
+} |
83 |
+ |
84 |
+src_prepare() { |
85 |
+ # Python is needed to run tests using lit |
86 |
+ python_setup |
87 |
+ |
88 |
+ cmake-utils_src_prepare |
89 |
+} |
90 |
+ |
91 |
+src_configure() { |
92 |
+ local libdir=$(get_libdir) |
93 |
+ local mycmakeargs=( |
94 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
95 |
+ |
96 |
+ -DBUILD_SHARED_LIBS=ON |
97 |
+ -DLLVM_OCAML_OUT_OF_TREE=ON |
98 |
+ -DLLVM_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
99 |
+ -DLLVM_BUILD_TESTS=$(usex test) |
100 |
+ |
101 |
+ # disable various irrelevant deps and settings |
102 |
+ -DLLVM_ENABLE_FFI=OFF |
103 |
+ -DLLVM_ENABLE_TERMINFO=OFF |
104 |
+ -DHAVE_HISTEDIT_H=NO |
105 |
+ -DWITH_POLLY=OFF |
106 |
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug) |
107 |
+ -DLLVM_ENABLE_EH=ON |
108 |
+ -DLLVM_ENABLE_RTTI=ON |
109 |
+ |
110 |
+ -DLLVM_HOST_TRIPLE="${CHOST}" |
111 |
+ |
112 |
+ # disable go bindings |
113 |
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND |
114 |
+ |
115 |
+ # TODO: ocamldoc |
116 |
+ ) |
117 |
+ |
118 |
+ use test && mycmakeargs+=( |
119 |
+ -DLLVM_LIT_ARGS="-vv" |
120 |
+ ) |
121 |
+ |
122 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
123 |
+ # also: custom rules for OCaml do not work for CPPFLAGS |
124 |
+ use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG" |
125 |
+ cmake-utils_src_configure |
126 |
+ |
127 |
+ local llvm_libdir=$(llvm-config --libdir) |
128 |
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml... |
129 |
+ cd "${BUILD_DIR}/${libdir}" || die |
130 |
+ ln -s "${llvm_libdir}"/*.so . || die |
131 |
+ |
132 |
+ if use test; then |
133 |
+ local llvm_bindir=$(llvm-config --bindir) |
134 |
+ # Force using system-installed tools. |
135 |
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \ |
136 |
+ "${BUILD_DIR}"/test/lit.site.cfg.py || die |
137 |
+ fi |
138 |
+} |
139 |
+ |
140 |
+src_compile() { |
141 |
+ cmake-utils_src_compile ocaml_all |
142 |
+} |
143 |
+ |
144 |
+src_test() { |
145 |
+ # respect TMPDIR! |
146 |
+ local -x LIT_PRESERVES_TMP=1 |
147 |
+ cmake-utils_src_make check-llvm-bindings-ocaml |
148 |
+} |
149 |
+ |
150 |
+src_install() { |
151 |
+ DESTDIR="${D}" \ |
152 |
+ cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die |
153 |
+ |
154 |
+ dodoc bindings/ocaml/README.txt |
155 |
+} |