Gentoo Archives: gentoo-commits

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