* [gentoo-commits] repo/user/gerislay:master commit in: dev-ml/llvm-ocaml/
@ 2024-06-30 21:07 gerion
0 siblings, 0 replies; only message in thread
From: gerion @ 2024-06-30 21:07 UTC (permalink / raw
To: gentoo-commits
commit: bf99b2e8de4ed1aa572c3c6701e2b898af4fcc66
Author: Gerion Entrup <gerion.entrup <AT> flump <DOT> de>
AuthorDate: Tue Jun 25 08:27:18 2024 +0000
Commit: gerion <gerion.entrup <AT> flump <DOT> de>
CommitDate: Sun Jun 30 21:07:04 2024 +0000
URL: https://gitweb.gentoo.org/repo/user/gerislay.git/commit/?id=bf99b2e8
Revert "dev-ml/llvm-ocaml: Remove LLVM 14"
This reverts commit 3964870eb5419998db9048bd47e0163793bd1bcc.
Signed-off-by: Gerion Entrup <gerion.entrup <AT> flump.de>
dev-ml/llvm-ocaml/llvm-ocaml-14.0.6.ebuild | 115 +++++++++++++++++++++++++++++
1 file changed, 115 insertions(+)
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-14.0.6.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-14.0.6.ebuild
new file mode 100644
index 0000000..18b9d19
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-14.0.6.ebuild
@@ -0,0 +1,115 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..10} )
+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}"
+KEYWORDS="~amd64 ~arm ~x86"
+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
+ >=dev-util/cmake-3.16
+"
+
+LLVM_COMPONENTS=( llvm cmake third-party )
+LLVM_USE_TARGETS=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
+}
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2024-06-30 21:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-30 21:07 [gentoo-commits] repo/user/gerislay:master commit in: dev-ml/llvm-ocaml/ gerion
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox