commit:     253221695243f2d5ae1cdd4546ac05973024b1c9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat May  4 19:24:45 2024 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat May  4 19:57:01 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=25322169

dev-ml/llvm-ocaml: Add 19.0.0_pre20240504 snapshot

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-ml/llvm-ocaml/Manifest                         |   1 +
 .../llvm-ocaml-19.0.0_pre20240504.ebuild           | 107 +++++++++++++++++++++
 2 files changed, 108 insertions(+)

diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index 7208264ba84d..1eab4b42dc8e 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -9,3 +9,4 @@ DIST llvm-project-18.1.4.src.tar.xz.sig 566 BLAKE2B 
b74fd219d7bcdf197b4e711cfbb2
 DIST llvm-project-18.1.5.src.tar.xz 132061072 BLAKE2B 
bfdd987d5992a4d94ae8b14792df3be67a8e8fdf1daef9834cdaa2132df1b7ddb72ba0aabbb34b171a73d0f3b2b0f61e7160f0b278a67fd4850e3f501fd21531
 SHA512 
9e2f1e251b3754a24a0b39676d78c98692887c05c85cf0bee50fd44d9635290019930d4dabd1ff4ba3c9c1067e7e0e09aa1bbcd3d76687f919a1d44ba85eee20
 DIST llvm-project-18.1.5.src.tar.xz.sig 566 BLAKE2B 
ad935db71ec3b9fc885d696af440764a71fe7cafc5b3ca0b25a2963100d9cb3790392daebcac1341716c95a8da3c6243f5a8667fea1ed18b93fc8baa495414c9
 SHA512 
3cbca1059d940f3bd7bd72d68f2828039b66304980cc5f43769649e5494fc7d71117bf8aba5cc7f7a2ffca52f60ba30fadf3b28f984fd49ddb14300e30b45237
 DIST llvm-project-338561657685c1831a53563b1bc36ffc7470239e.tar.gz 209715501 
BLAKE2B 
49152479d4f2cae430e783784d0cfcc129134f5cc0bf12c72701cd15e59cb3e1be2f61385ba9baa93d1d1193e89374ac8877b909650c163b681d1fcd26732cdc
 SHA512 
d34bbe82e85c5b9d493029ad7b46e802f06f7e7a8a48515d0043c58c3251271f8f3e1e11c47eb91bd3db2477f819d33b43ddebb276eb9601c5ad141e463c9682
+DIST llvm-project-76aa042dde6ba9ba57c680950f5818259ee02690.tar.gz 210235525 
BLAKE2B 
fbbb8e70e0a08bde1fa2277746f692399fa15015b69693f5e8d3297abf02dfb7b36c535880f5c6924c870652dd3106936776d57c34b22234a5419f75b3561bb7
 SHA512 
9107551ceb2b28aa735006144b3344801ea861d7b49eae4881831af507314fb8da2bf5e8a3a407aeebd2eee01fbfad2ca90269d2331fe43cca5c2cc49dd257b7

diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0_pre20240504.ebuild 
b/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0_pre20240504.ebuild
new file mode 100644
index 000000000000..879c30db0807
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0_pre20240504.ebuild
@@ -0,0 +1,107 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+inherit cmake llvm.org llvm-utils python-any-r1
+
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/";
+
+LICENSE="Apache-2.0-with-LLVM-exceptions UoI-NCSA"
+SLOT="0/${PV}"
+IUSE="+debug test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+       >=dev-lang/ocaml-4.00.0:0=
+       dev-ml/ocaml-ctypes:=
+       ~sys-devel/llvm-${PV}:=[debug?]
+       !sys-devel/llvm[ocaml(-)]
+"
+
+DEPEND="
+       ${RDEPEND}
+"
+BDEPEND="
+       ${PYTHON_DEPS}
+       dev-lang/perl
+       dev-ml/findlib
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_USE_TARGETS=llvm
+llvm.org_set_globals
+
+src_configure() {
+       llvm_prepend_path "${LLVM_MAJOR}"
+
+       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}"
+
+               # 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
+}

Reply via email to