summaryrefslogtreecommitdiff
path: root/dev-ml
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2021-07-09 09:39:10 +0200
committerMichał Górny <mgorny@gentoo.org>2021-07-09 16:43:57 +0200
commit2d6ead92379f4ebfb0af4928c5c944e5fc841d97 (patch)
tree6b8d83f75ce4de0ad9c3f3f21826d211061f7c03 /dev-ml
parentsys-devel/llvm: Bump to 12.0.1 (final) (diff)
downloadgentoo-2d6ead92379f4ebfb0af4928c5c944e5fc841d97.tar.gz
gentoo-2d6ead92379f4ebfb0af4928c5c944e5fc841d97.tar.bz2
gentoo-2d6ead92379f4ebfb0af4928c5c944e5fc841d97.zip
dev-ml/llvm-ocaml: Bump to 12.0.1 (final)
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-ml')
-rw-r--r--dev-ml/llvm-ocaml/Manifest1
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-12.0.1.ebuild124
2 files changed, 125 insertions, 0 deletions
diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index c5254d02f1d1..f3cacde58cc0 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -2,3 +2,4 @@ DIST llvmorg-10.0.1.tar.gz 120880730 BLAKE2B 30f19f56c4d1f6abcda5fec76256219d1e3
DIST llvmorg-11.1.0.tar.gz 122776532 BLAKE2B ca842ff4afff8f44c82b5e7383962a9c45ca1c93b64fa4c6ebcd70a1d3849dbad2b8e4e24fba02d144c6266d7fab3607ebc6999b28c229cb35256cf40f26a985 SHA512 9a8ce022a935eed42fa71a224f2a207122aadcbef58ee855fdb4825f879e7d028e4dcff22c19b9d336db1c8bf63fb84372d44981acf84615f757e54306c92b81
DIST llvmorg-12.0.0.tar.gz 134226215 BLAKE2B f9c3ba8c58571855caa4f206fd285c9b5be66672fb0814cb8bc0964a051f57f5d35013aa1e27cbda502652b37df1ec23474129109e76a42066847860db441dbe SHA512 0cff02155c5ac0d6db2b72d60d9819d5b5dd859663b45f721b1c7540239c2fceb1f57d9173f6870c49de851c242ed8e85c5c6d6577a1f8092a7c5dcd12513b26
DIST llvmorg-12.0.1-rc4.tar.gz 134278617 BLAKE2B d407421c7244bb125151e69e2a341f1af0a0cf8c1fda3b8ae3d4114c3a285d6307620bbf82b22d96d2c7782b37b0975e87be80c24e3ce1fdc71152734be1e8f8 SHA512 1a2c18435a970491eb9fc9381ba66af726e17dcbd5bf6774f9341b1e82fd35f2e5686844743f5317ebd2106b902c39e09aa98102e58a86e290b29102241c949f
+DIST llvmorg-12.0.1.tar.gz 134259748 BLAKE2B f41de787bc73ff2edfda1b22cc8602be6f65f37dd9e4c8888533cfa8c3ccdcf4f108aaab9de23ab0ab987966eb160f2a553a0bdff99461e71ddd5bfcd086090d SHA512 6eb0dc18e2c25935fabfdfc48b0114be0939158dfdef7b85b395fe2e71042672446af0e68750aae003c9847d10d1f63316fe95d3df738d18f249174292b1b9e1
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-12.0.1.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-12.0.1.ebuild
new file mode 100644
index 000000000000..f23d09a83d7a
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-12.0.1.ebuild
@@ -0,0 +1,124 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{8..10} )
+inherit cmake llvm llvm.org python-any-r1
+
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC CSKY VE )
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM AVR BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC RISCV Sparc SystemZ WebAssembly X86 XCore
+ "${ALL_LLVM_EXPERIMENTAL_TARGETS[@]}" )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS="~amd64 ~arm ~x86"
+IUSE="debug test ${ALL_LLVM_TARGETS[*]}"
+REQUIRED_USE="|| ( ${ALL_LLVM_TARGETS[*]} )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ >=dev-lang/ocaml-4.00.0:0=
+ dev-ml/ocaml-ctypes:=
+ ~sys-devel/llvm-${PV}:=[debug?]
+ !sys-devel/llvm[ocaml(-)]"
+for x in "${ALL_LLVM_TARGETS[@]}"; do
+ RDEPEND+="
+ ${x}? ( ~sys-devel/llvm-${PV}[${x}] )"
+done
+unset x
+
+DEPEND="${RDEPEND}"
+BDEPEND="
+ dev-lang/perl
+ dev-ml/findlib
+ >=dev-util/cmake-3.16
+ test? ( dev-ml/ounit2 )
+ ${PYTHON_DEPS}"
+
+LLVM_COMPONENTS=( llvm )
+llvm.org_set_globals
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
+src_configure() {
+ local libdir=$(get_libdir)
+ local mycmakeargs=(
+ -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
+
+ -DBUILD_SHARED_LIBS=OFF
+ -DLLVM_BUILD_LLVM_DYLIB=ON
+ -DLLVM_LINK_LLVM_DYLIB=ON
+ -DLLVM_OCAML_OUT_OF_TREE=ON
+
+ # cheap hack: LLVM combines both anyway, and the only difference
+ # is that the former list is explicitly verified at cmake time
+ -DLLVM_TARGETS_TO_BUILD=""
+ -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="${LLVM_TARGETS// /;}"
+ -DLLVM_BUILD_TESTS=$(usex test)
+
+ # disable various irrelevant deps and settings
+ -DLLVM_ENABLE_FFI=OFF
+ -DLLVM_ENABLE_TERMINFO=OFF
+ -DHAVE_HISTEDIT_H=NO
+ -DLLVM_ENABLE_ASSERTIONS=$(usex debug)
+ -DLLVM_ENABLE_EH=ON
+ -DLLVM_ENABLE_RTTI=ON
+
+ -DLLVM_HOST_TRIPLE="${CHOST}"
+
+ -DPython3_EXECUTABLE="${PYTHON}"
+
+ # disable go bindings
+ -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND
+
+ # TODO: ocamldoc
+ )
+
+ use test && mycmakeargs+=(
+ -DLLVM_LIT_ARGS="$(get_lit_flags)"
+ )
+
+ # LLVM_ENABLE_ASSERTIONS=NO does not guarantee this for us, #614844
+ # also: custom rules for OCaml do not work for CPPFLAGS
+ use debug || local -x CFLAGS="${CFLAGS} -DNDEBUG"
+ cmake_src_configure
+
+ local llvm_libdir=$(llvm-config --libdir)
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml...
+ cd "${BUILD_DIR}/${libdir}" || die
+ ln -s "${llvm_libdir}"/*.so . || die
+
+ if use test; then
+ local llvm_bindir=$(llvm-config --bindir)
+ # Force using system-installed tools.
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \
+ "${BUILD_DIR}"/test/lit.site.cfg.py || die
+ fi
+}
+
+src_compile() {
+ cmake_build ocaml_all
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ cmake_build check-llvm-bindings-ocaml
+}
+
+src_install() {
+ DESTDIR="${D}" \
+ cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die
+
+ dodoc bindings/ocaml/README.txt
+}