summaryrefslogtreecommitdiff
path: root/dev-ml/llvm-ocaml
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-01-19 10:01:30 +0100
committerMichał Górny <mgorny@gentoo.org>2017-01-19 10:14:01 +0100
commitab9c958d5f150b80e8d9577afdb0435cb36e80d8 (patch)
tree7aae85fb39095f3594872c45b7716f65e508461b /dev-ml/llvm-ocaml
parentbc05fc1a2a68b8506d26abd37fccfbdc9910a120 (diff)
downloadgentoo-ab9c958d5f150b80e8d9577afdb0435cb36e80d8.tar.gz
gentoo-ab9c958d5f150b80e8d9577afdb0435cb36e80d8.tar.xz
dev-ml/llvm-ocaml: Bump to 4.0.0rc1
Diffstat (limited to 'dev-ml/llvm-ocaml')
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild121
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild2
2 files changed, 122 insertions, 1 deletions
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild
new file mode 100644
index 00000000000..44ebe0f2f3a
--- /dev/null
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild
@@ -0,0 +1,121 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+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 git-r3 python-any-r1
+
+DESCRIPTION="OCaml bindings for LLVM"
+HOMEPAGE="http://llvm.org/"
+SRC_URI=""
+EGIT_REPO_URI="http://llvm.org/git/llvm.git
+ https://github.com/llvm-mirror/llvm.git"
+EGIT_BRANCH="release_40"
+EGIT_COMMIT="c329efbc3c94928fb826ed146897aada0459c983"
+
+# Keep in sync with sys-devel/llvm
+ALL_LLVM_TARGETS=( AArch64 AMDGPU ARM BPF Hexagon Lanai Mips MSP430
+ NVPTX PowerPC RISCV 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="test ${ALL_LLVM_TARGETS[*]}"
+
+RDEPEND="
+ >=dev-lang/ocaml-4.00.0:0=
+ dev-ml/ocaml-ctypes:=
+ ~sys-devel/llvm-${PV}:=[${LLVM_TARGET_USEDEPS// /,}]
+ !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[*]} )"
+
+# least intrusive of all
+CMAKE_BUILD_TYPE=RelWithDebInfo
+
+python_check_deps() {
+ ! use test \
+ || has_version "dev-python/lit[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ # Python is needed to run tests using lit
+ python_setup
+
+ # Allow custom cmake build types (like 'Gentoo')
+ eapply "${FILESDIR}"/llvm-cmake-Remove-the-CMAKE_BUILD_TYPE-assertion.patch
+
+ # 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=OFF
+ -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"
+ )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile ocaml_all
+}
+
+src_test() {
+ # respect TMPDIR!
+ local -x LIT_PRESERVES_TMP=1
+ # Force using system-installed tools.
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${EPREFIX}/usr/bin\"@" \
+ "${BUILD_DIR}"/test/lit.site.cfg || die
+ 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
+}
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
index 31371ded6b6..41c9948de53 100644
--- a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
@@ -38,7 +38,7 @@ DEPEND="${RDEPEND}
dev-lang/perl
dev-ml/findlib
test? ( dev-ml/ounit
- $(python_gen_any_dep 'dev-python/lit[${PYTHON_USEDEP}]') )
+ $(python_gen_any_dep "~dev-python/lit-${PV}[\${PYTHON_USEDEP}]") )
!!<dev-python/configparser-3.3.0.2
${PYTHON_DEPS}"