diff options
author | Michał Górny <mgorny@gentoo.org> | 2020-03-24 21:42:09 +0100 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2020-03-24 22:46:14 +0100 |
commit | 1e66f43b785d49d81b4ab6b0588b5b8b42980bdd (patch) | |
tree | 13c9b238ab628e6d06c2b67a09be28311dcc03ec /dev-ml/llvm-ocaml | |
parent | dev-python/lit: Bump to 10.0.0 (diff) | |
download | gentoo-1e66f43b785d49d81b4ab6b0588b5b8b42980bdd.tar.gz gentoo-1e66f43b785d49d81b4ab6b0588b5b8b42980bdd.tar.bz2 gentoo-1e66f43b785d49d81b4ab6b0588b5b8b42980bdd.zip |
dev-ml/llvm-ocaml: Bump to 10.0.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-ml/llvm-ocaml')
-rw-r--r-- | dev-ml/llvm-ocaml/Manifest | 1 | ||||
-rw-r--r-- | dev-ml/llvm-ocaml/llvm-ocaml-10.0.0.ebuild | 125 |
2 files changed, 126 insertions, 0 deletions
diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest index 929804dace45..0a02cd693357 100644 --- a/dev-ml/llvm-ocaml/Manifest +++ b/dev-ml/llvm-ocaml/Manifest @@ -3,4 +3,5 @@ DIST llvm-8.0.1.src.tar.xz 30477608 BLAKE2B 4319c837b36111401e3b0f9659b8d875c894 DIST llvmorg-10.0.0-rc3.tar.gz 120814170 BLAKE2B 432fe0c1e74d3020a269a256e6e456cbfa0b7166dd3f86df6caf3a55e1931c022285fe8afdc4d8998c729c5471acf5308abb336782ddec2ef9b0f58d1ccb5a3c SHA512 aad1df86063612d20c48ea7046940330fe2ac572a146be22ff71d9e65fa3438184cb39a2533fc6afd1e74df26909a9f0d24ebcd7d62e74728cfd81e447f2ffbf DIST llvmorg-10.0.0-rc4.tar.gz 120816191 BLAKE2B 66c497fa682b9bcbdef3776f540e6b2781286df3405b00ab335aa405a19418d9c4571b301a6814b526e363bb9c0b7c0be0dfc85444fb9d636ecf11ee788b2cdd SHA512 b3df32cafbbe9147c7b5cfbfe96c7231dc2e66d32560c6d0bcda90d6863b37bf8c9cb3f080fb459acd1d56c013149b275d0ce58f1678205f8ca737f1c8d034cd DIST llvmorg-10.0.0-rc6.tar.gz 120815075 BLAKE2B 3c5eb3594d30f1d6c4e2fec916a209030c7e3d8ebcf0f7ceb376adc78cd8a5bdf94a7c85d821bd5ea65631cf0a2438c538019fe1d58d1f835f3b9a899207d0c4 SHA512 04d8df9cd14f78fc5f80885f5d2e8fe4a1f66a218079c2574f6f3f8f3a86c2a886763da08a9454465615d89da300022e9e0754ecd4b40e25fedc600c2e66f39b +DIST llvmorg-10.0.0.tar.gz 120804856 BLAKE2B 6b0254f5b913398cdcf2b2ec1ff219888706d2b79d5296590934714e42ac79f6a6547941ac2b1d2c4e6313dd18b6c7068e748aa6ac033e49fccbf5d355aa8191 SHA512 baa182d62fef1851836013ae8a1a00861ea89769778d67fb97b407a9de664e6c85da2af9c5b3f75d2bf34ff6b00004e531ca7e4b3115a26c0e61c575cf2303a0 DIST llvmorg-9.0.1.tar.gz 113193320 BLAKE2B b86e405f2b8e00436045fd409fe19cdde75c797b1192c62a22b5ec75e6b4dc8e874a0f33008dc31562445e4cbe53a992b6f48c684255a6a1ef261e595b8b161f SHA512 fa88beeaae94b6d0cd9b5ba38658d0ffed8004035d7d8a4f95c3d31a709b88b581ae9bd7761333c8e5375c44b8f6be01768b5a3be901163159d7e6c43b71da59 diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0.ebuild new file mode 100644 index 000000000000..5e415032b502 --- /dev/null +++ b/dev-ml/llvm-ocaml/llvm-ocaml-10.0.0.ebuild @@ -0,0 +1,125 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{6,7,8} ) +inherit cmake-utils llvm llvm.org multiprocessing python-any-r1 + +DESCRIPTION="OCaml bindings for LLVM" +HOMEPAGE="https://llvm.org/" +LLVM_COMPONENTS=( llvm ) +llvm.org_set_globals + +# Keep in sync with sys-devel/llvm +ALL_LLVM_EXPERIMENTAL_TARGETS=( ARC AVR ) +ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM 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_}" ) +LLVM_TARGET_USEDEPS=${ALL_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}:=[${LLVM_TARGET_USEDEPS// /,},debug?] + !sys-devel/llvm[ocaml(-)]" +DEPEND="${RDEPEND}" +BDEPEND=" + dev-lang/perl + dev-ml/findlib + test? ( dev-ml/ounit ) + ${PYTHON_DEPS}" + +# least intrusive of all +CMAKE_BUILD_TYPE=RelWithDebInfo + +pkg_setup() { + LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup + python-any-r1_pkg_setup +} + +src_prepare() { + # Python is needed to run tests using lit + python_setup + + cmake-utils_src_prepare +} + +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}" + + # disable go bindings + -DGO_EXECUTABLE=GO_EXECUTABLE-NOTFOUND + + # TODO: ocamldoc + ) + + use test && mycmakeargs+=( + -DLLVM_LIT_ARGS="-vv;-j;${LIT_JOBS:-$(makeopts_jobs "${MAKEOPTS}" "$(get_nproc)")}" + ) + + # 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-utils_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-utils_src_compile ocaml_all +} + +src_test() { + # respect TMPDIR! + local -x LIT_PRESERVES_TMP=1 + cmake-utils_src_make check-llvm-bindings-ocaml +} + +src_install() { + DESTDIR="${D}" \ + cmake -P "${BUILD_DIR}"/bindings/ocaml/cmake_install.cmake || die + + dodoc bindings/ocaml/README.txt +} |