summaryrefslogtreecommitdiff
path: root/dev-ml/llvm-ocaml
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-01-24 10:45:40 +0000
committerV3n3RiX <venerix@koprulu.sector>2024-01-24 10:45:40 +0000
commit1804d2ae908b26fe4e3d3a38646c7d6ffa733d92 (patch)
tree6f5cdff53cb2fde48a01817379124dc476b3742d /dev-ml/llvm-ocaml
parent2fa0c8dbba3b2455531e5616eed64f2fe66cb58b (diff)
gentoo auto-resync : 24:01:2024 - 10:45:40
Diffstat (limited to 'dev-ml/llvm-ocaml')
-rw-r--r--dev-ml/llvm-ocaml/Manifest1
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-19.0.0.9999.ebuild110
2 files changed, 111 insertions, 0 deletions
diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index 806924946338..01f7856bd88a 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -14,4 +14,5 @@ EBUILD llvm-ocaml-18.0.0.9999.ebuild 2483 BLAKE2B 6ea355363a7d55022a206144faaa93
EBUILD llvm-ocaml-18.0.0_pre20240106.ebuild 2483 BLAKE2B 6ea355363a7d55022a206144faaa939d1fadea7854c4e7dffda2a17887a75352d843680ca7ade9ffea6cd6d1d99b42d406b1088eb4c14f1ef1a6052ce8da831d SHA512 929ccc4105023cdcf1589047fec4b5e00d1abe7b3f57ea32dd4392e4c161f90cb1dab46abb135f195c108ea4c19867fc7203b31f966dd05af50e35a465ce402a
EBUILD llvm-ocaml-18.0.0_pre20240113.ebuild 2483 BLAKE2B 6ea355363a7d55022a206144faaa939d1fadea7854c4e7dffda2a17887a75352d843680ca7ade9ffea6cd6d1d99b42d406b1088eb4c14f1ef1a6052ce8da831d SHA512 929ccc4105023cdcf1589047fec4b5e00d1abe7b3f57ea32dd4392e4c161f90cb1dab46abb135f195c108ea4c19867fc7203b31f966dd05af50e35a465ce402a
EBUILD llvm-ocaml-18.0.0_pre20240120.ebuild 2483 BLAKE2B 6ea355363a7d55022a206144faaa939d1fadea7854c4e7dffda2a17887a75352d843680ca7ade9ffea6cd6d1d99b42d406b1088eb4c14f1ef1a6052ce8da831d SHA512 929ccc4105023cdcf1589047fec4b5e00d1abe7b3f57ea32dd4392e4c161f90cb1dab46abb135f195c108ea4c19867fc7203b31f966dd05af50e35a465ce402a
+EBUILD llvm-ocaml-19.0.0.9999.ebuild 2483 BLAKE2B 6ea355363a7d55022a206144faaa939d1fadea7854c4e7dffda2a17887a75352d843680ca7ade9ffea6cd6d1d99b42d406b1088eb4c14f1ef1a6052ce8da831d SHA512 929ccc4105023cdcf1589047fec4b5e00d1abe7b3f57ea32dd4392e4c161f90cb1dab46abb135f195c108ea4c19867fc7203b31f966dd05af50e35a465ce402a
MISC metadata.xml 299 BLAKE2B 2feead2cd1b35b3a43335ddd7711f8181b52bc63ee7166608914260c67528add5251349063afbef4f8cf0ec09b2cd4c3ffdd90f2c14ed60bb69ebc03888f6333 SHA512 cd745c54ab18d25bdaff18582105072574103a36cfe7c175ef740f266d00e9fc6f44c332904d23b911c939cf5bdf52973b388923099d8dd5dfef3c283b5cb685
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0.9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0.9999.ebuild
new file mode 100644
index 000000000000..8c4bee7af2e9
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-19.0.0.9999.ebuild
@@ -0,0 +1,110 @@
+# 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 llvm.org 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
+
+pkg_setup() {
+ LLVM_MAX_SLOT=${LLVM_MAJOR} 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}"
+
+ # 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
+}