commit:     b82556e19f62d1962a891d811bc5cab1d3aff1bd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Feb  9 09:52:59 2018 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Feb  9 15:59:58 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b82556e1

dev-ml/llvm-ocaml: Bump to 6.0.0rc2

 dev-ml/llvm-ocaml/Manifest                    |   1 +
 dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild | 127 ++++++++++++++++++++++++++
 2 files changed, 128 insertions(+)

diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index 9f4fafbd243..69a2d356a36 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -1,2 +1,3 @@
 DIST llvm-4.0.1.src.tar.xz 21065652 BLAKE2B 
6327eed2d1feb108440f22d2581d1ff86c10a10c29793538d8d899c7e2dc83d3f7b147d3fd4bcce2bd2bf57c071b08c624aeafe40a3e7a3914506e7751727e6c
 SHA512 
16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
 DIST llvm-5.0.1.src.tar.xz 23428720 BLAKE2B 
3db4d33df21018d17eef0042c0d8d82a8412bd5daa99cfb5405a6ec83c5774178fa76b220e8731c2a9a64dabf898aa90fe29c685327bd63a4f078e8e94a9a77e
 SHA512 
bee1d45fca15ce725b1f2b1339b13eb6f750a3a321cfd099075477ec25835a8ca55b5366172c4aad46592dfd8afe372349ecf264f581463d017f9cee2d63c1cb
+DIST llvm-6.0.0rc2.src.tar.xz 25288140 BLAKE2B 
095f054ce2ccb1eee3def2b8c6cecc610c4392283062338aa20d2de33c951484a2dc6774db2727e19e879307cfc95dda2730185cde8e52f4f45851d8dd809b3e
 SHA512 
3cb3521ba8d90bf2a90c49d753ab5e92f1e0ccfc86946f3767c06d0f276e2c4cf8ff2f984680835efbaa4dae1cd2d3a074468e547785e05a67ea55311b94a0e9

diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild 
b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild
new file mode 100644
index 00000000000..ff74f2cf340
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-6.0.0_rc2.ebuild
@@ -0,0 +1,127 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+: ${CMAKE_MAKEFILE_GENERATOR:=ninja}
+# (needed due to CMAKE_BUILD_TYPE != Gentoo)
+CMAKE_MIN_VERSION=3.7.0-r1
+PYTHON_COMPAT=( python2_7 )
+
+inherit cmake-utils llvm python-any-r1
+
+MY_P=llvm-${PV/_/}.src
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/";
+SRC_URI="http://prereleases.llvm.org/${PV/_//}/${MY_P}.tar.xz";
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+       NVPTX PowerPC Sparc SystemZ X86 XCore )
+ALL_LLVM_TARGETS=( "${ALL_LLVM_TARGETS[@]/#/llvm_targets_}" )
+LLVM_TARGET_USEDEPS=${ALL_LLVM_TARGETS[@]/%/?}
+
+LICENSE="UoI-NCSA"
+SLOT="0/${PV}"
+KEYWORDS=""
+IUSE="debug test ${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(-)]"
+# configparser-3.2 breaks the build (3.3 or none at all are fine)
+DEPEND="${RDEPEND}
+       dev-lang/perl
+       dev-ml/findlib
+       test? ( dev-ml/ounit )
+       !!<dev-python/configparser-3.3.0.2
+       ${PYTHON_DEPS}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+       || ( ${ALL_LLVM_TARGETS[*]} )"
+
+S=${WORKDIR}/${MY_P}
+
+# 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=ON
+               -DLLVM_OCAML_OUT_OF_TREE=ON
+               -DLLVM_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
+               -DWITH_POLLY=OFF
+               -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"
+       )
+
+       # 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
+}

Reply via email to