1 |
commit: 782df2f97104b71174eca0b76ecf5315979a3398 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 5 19:48:32 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 5 19:49:51 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=782df2f9 |
7 |
|
8 |
dev-ml/llvm-ocaml: Add 16.* live ebuilds |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-ml/llvm-ocaml/llvm-ocaml-16.0.0.9999.ebuild | 115 ++++++++++++++++++++++++ |
13 |
1 file changed, 115 insertions(+) |
14 |
|
15 |
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0.9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0.9999.ebuild |
16 |
new file mode 100644 |
17 |
index 000000000000..3f682163a64b |
18 |
--- /dev/null |
19 |
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-16.0.0.9999.ebuild |
20 |
@@ -0,0 +1,115 @@ |
21 |
+# Copyright 1999-2022 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=8 |
25 |
+ |
26 |
+PYTHON_COMPAT=( python3_{8..11} ) |
27 |
+inherit cmake llvm llvm.org python-any-r1 |
28 |
+ |
29 |
+DESCRIPTION="OCaml bindings for LLVM" |
30 |
+HOMEPAGE="https://llvm.org/" |
31 |
+ |
32 |
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA" |
33 |
+SLOT="0/${PV}" |
34 |
+KEYWORDS="" |
35 |
+IUSE="debug test" |
36 |
+RESTRICT="!test? ( test )" |
37 |
+ |
38 |
+RDEPEND=" |
39 |
+ >=dev-lang/ocaml-4.00.0:0= |
40 |
+ dev-ml/ocaml-ctypes:= |
41 |
+ ~sys-devel/llvm-${PV}:=[debug?] |
42 |
+ !sys-devel/llvm[ocaml(-)] |
43 |
+" |
44 |
+ |
45 |
+DEPEND=" |
46 |
+ ${RDEPEND} |
47 |
+" |
48 |
+BDEPEND=" |
49 |
+ ${PYTHON_DEPS} |
50 |
+ dev-lang/perl |
51 |
+ dev-ml/findlib |
52 |
+ >=dev-util/cmake-3.16 |
53 |
+" |
54 |
+ |
55 |
+LLVM_COMPONENTS=( llvm cmake third-party ) |
56 |
+LLVM_USE_TARGETS=llvm |
57 |
+llvm.org_set_globals |
58 |
+ |
59 |
+pkg_setup() { |
60 |
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup |
61 |
+ python-any-r1_pkg_setup |
62 |
+} |
63 |
+ |
64 |
+src_configure() { |
65 |
+ local libdir=$(get_libdir) |
66 |
+ local mycmakeargs=( |
67 |
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib} |
68 |
+ |
69 |
+ -DBUILD_SHARED_LIBS=OFF |
70 |
+ -DLLVM_BUILD_LLVM_DYLIB=ON |
71 |
+ -DLLVM_LINK_LLVM_DYLIB=ON |
72 |
+ -DLLVM_OCAML_OUT_OF_TREE=ON |
73 |
+ |
74 |
+ # cheap hack: LLVM combines both anyway, and the only difference |
75 |
+ # is that the former list is explicitly verified at cmake time |
76 |
+ -DLLVM_TARGETS_TO_BUILD="" |
77 |
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}" |
78 |
+ -DLLVM_BUILD_TESTS=$(usex test) |
79 |
+ |
80 |
+ # disable various irrelevant deps and settings |
81 |
+ -DLLVM_ENABLE_FFI=OFF |
82 |
+ -DLLVM_ENABLE_TERMINFO=OFF |
83 |
+ -DHAVE_HISTEDIT_H=NO |
84 |
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug) |
85 |
+ -DLLVM_ENABLE_EH=ON |
86 |
+ -DLLVM_ENABLE_RTTI=ON |
87 |
+ |
88 |
+ -DLLVM_HOST_TRIPLE="${CHOST}" |
89 |
+ |
90 |
+ -DPython3_EXECUTABLE="${PYTHON}" |
91 |
+ |
92 |
+ # disable go bindings |
93 |
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND |
94 |
+ |
95 |
+ # TODO: ocamldoc |
96 |
+ ) |
97 |
+ |
98 |
+ use test && mycmakeargs+=( |
99 |
+ -DLLVM_LIT_ARGS="$(get_lit_flags)" |
100 |
+ ) |
101 |
+ |
102 |
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844 |
103 |
+ # also: custom rules for OCaml do not work for CPPFLAGS |
104 |
+ use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG" |
105 |
+ cmake_src_configure |
106 |
+ |
107 |
+ local llvm_libdir=$(llvm-config --libdir) |
108 |
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml... |
109 |
+ cd "${BUILD_DIR}/${libdir}" || die |
110 |
+ ln -s "${llvm_libdir}"/*.so . || die |
111 |
+ |
112 |
+ if use test; then |
113 |
+ local llvm_bindir=$(llvm-config --bindir) |
114 |
+ # Force using system-installed tools. |
115 |
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \ |
116 |
+ "${BUILD_DIR}"/test/lit.site.cfg.py || die |
117 |
+ fi |
118 |
+} |
119 |
+ |
120 |
+src_compile() { |
121 |
+ cmake_build ocaml_all |
122 |
+} |
123 |
+ |
124 |
+src_test() { |
125 |
+ # respect TMPDIR! |
126 |
+ local -x LIT_PRESERVES_TMP=1 |
127 |
+ cmake_build check-llvm-bindings-ocaml |
128 |
+} |
129 |
+ |
130 |
+src_install() { |
131 |
+ DESTDIR="${D}" \ |
132 |
+ cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die |
133 |
+ |
134 |
+ dodoc bindings/ocaml/README.txt |
135 |
+} |