commit:     8bd3320c03f2f53ba37fcd2d068c6c05167dedf4
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Fri Sep  8 09:06:31 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  8 17:30:31 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bd3320c

dev-ml/llvm-ocaml: Bump to 5.0.0

 dev-ml/llvm-ocaml/Manifest                |   1 +
 dev-ml/llvm-ocaml/llvm-ocaml-5.0.0.ebuild | 133 ++++++++++++++++++++++++++++++
 2 files changed, 134 insertions(+)

diff --git a/dev-ml/llvm-ocaml/Manifest b/dev-ml/llvm-ocaml/Manifest
index 37588db7c72..69c3374ad8e 100644
--- a/dev-ml/llvm-ocaml/Manifest
+++ b/dev-ml/llvm-ocaml/Manifest
@@ -1 +1,2 @@
 DIST llvm-4.0.1.src.tar.xz 21065652 SHA256 
da783db1f82d516791179fe103c71706046561f7972b18f0049242dee6712b51 SHA512 
16adc39b34ddb628f81b171119a8e2a0e9138b25011e803ef0b688e2fbea116fc4953d3a1b61b90a98a75e33619f81566b7cb06a9a2ea4d04ac5e0eb303a2d1d
 WHIRLPOOL 
1626ff270f7ce4801d02a0797b227fda9314ff5c0c01d653111599e9a4d2854c4d9edc3c698a7abee8d79d6bce8b18dc619fbced3c07ca610d44a248d65830cc
+DIST llvm-5.0.0.src.tar.xz 23411980 SHA256 
e35dcbae6084adcf4abb32514127c5eabd7d63b733852ccdb31e06f1373136da SHA512 
e6d8fdcb5bf27bded814d02f39f69c6171bc3a512d5957c03e5ac2e231f903b7de87634b059bd5c5da670f7c3a8f7a538f6299225799f15f921857f1452f6b3a
 WHIRLPOOL 
6a99edbdc3e6726dc8ff9126b110fd7560faac46601407722e6dd80b5d894ff242521dc8fda7f4d879de83dac51c65645a37224f7e8def0d8d2f1e564b0531bb

diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-5.0.0.ebuild 
b/dev-ml/llvm-ocaml/llvm-ocaml-5.0.0.ebuild
new file mode 100644
index 00000000000..d602e6ea65f
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-5.0.0.ebuild
@@ -0,0 +1,133 @@
+# Copyright 1999-2017 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/_/}
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="https://llvm.org/";
+SRC_URI="https://releases.llvm.org/${PV/_//}/${MY_P/_/}.src.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="~amd64 ~arm ~x86"
+IUSE="debug test ${ALL_LLVM_TARGETS[*]}"
+
+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
+               $(python_gen_any_dep 
"~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
+       !!<dev-python/configparser-3.3.0.2
+       ${PYTHON_DEPS}"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}
+       || ( ${ALL_LLVM_TARGETS[*]} )"
+
+S=${WORKDIR}/${MY_P/_/}.src
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+       ! use test \
+               || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+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
+
+       # User patches
+       eapply_user
+}
+
+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+=(
+               -DLIT_COMMAND="${EPREFIX}/usr/bin/lit"
+       )
+
+       # 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 || 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