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: Sat, 30 Apr 2022 07:35:11
Message-Id: 1651304081.0529d9aea23e1793152d31674c85a82a6ed2bd43.mgorny@gentoo
1 commit: 0529d9aea23e1793152d31674c85a82a6ed2bd43
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Wed Apr 27 08:46:50 2022 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 30 07:34:41 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0529d9ae
7
8 dev-ml/llvm-ocaml: Bump to 14.0.3
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.3.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 4dfb61c584a9..bf3dff4f0680 100644
18 --- a/dev-ml/llvm-ocaml/Manifest
19 +++ b/dev-ml/llvm-ocaml/Manifest
20 @@ -1,3 +1,4 @@
21 DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
22 DIST llvmorg-13.0.1.tar.gz 147290251 BLAKE2B 2a44b012a672501761d0c27c6b3a315b69bfef0cd13b078a7e7d2fccc4a9c8c0f2bee0f164c4271c9106b0a99cb06e8b64986f66253b613336719fb86b82541b SHA512 9a8cb5d11964ba88b7624f19ec861fb28701f23956ea3c92f6ac644332d5f41fde97bd8933dd3ee70ed378058c252fa3a3887c8d1af90d219970c2b27691166f
23 DIST llvmorg-14.0.1.tar.gz 158074615 BLAKE2B bf80366461580058494eb101646efcd1a8b55a66818a710c2eb8c649bf88c02fe4552cecf4c1c8637a64e7cee8d644bca31aafc804765ed18f2b5e2975dd6c92 SHA512 0a15aa9cfc978a7b03a1659a2affad65ede66d280f5c12bf0beaaf194cd7bdd57ff438b5f40e64c1e1b88f368de99be349e9d30b544d2bbe4a50f0ebed3307f2
24 +DIST llvmorg-14.0.3.tar.gz 158092596 BLAKE2B ef901df510ec6bc1242595ec330e9c9ee76e696b077d67a8d62b53608c3d18b2f2d7ea3150864e13d9b37a8ce899ebca946ebe72cbc4538700176e20859ddec2 SHA512 511e93fd9b1c414c38fe9e2649679ac0b16cb04f7f7838569d187b04c542a185e364d6db73e96465026e3b2533649eb75ac95507d12514af32b28bdfb66f2646
25
26 diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-14.0.3.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-14.0.3.ebuild
27 new file mode 100644
28 index 000000000000..4dd3009c2bc4
29 --- /dev/null
30 +++ b/dev-ml/llvm-ocaml/llvm-ocaml-14.0.3.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 +}