summaryrefslogtreecommitdiff
path: root/dev-ml/llvm-ocaml
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2017-02-02 22:02:05 +0100
committerMichał Górny <mgorny@gentoo.org>2017-02-15 13:47:22 +0100
commit38368fa1b651054b97a272104ab7350a6e73b819 (patch)
treea6439737ef42aee9e5761ef08ebdf72edd806739 /dev-ml/llvm-ocaml
parentb20e6ef1303c6b04aeb70d281c13a6d3acaed780 (diff)
downloadgentoo-38368fa1b651054b97a272104ab7350a6e73b819.tar.gz
gentoo-38368fa1b651054b97a272104ab7350a6e73b819.tar.xz
dev-ml/llvm-ocaml: Fix install against slotted LLVM
Diffstat (limited to 'dev-ml/llvm-ocaml')
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild22
-rw-r--r--dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild22
2 files changed, 36 insertions, 8 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
index e984d571402..3b21af3a478 100644
--- a/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild
@@ -9,7 +9,7 @@ EAPI=6
CMAKE_MIN_VERSION=3.7.0-r1
PYTHON_COMPAT=( python2_7 )
-inherit cmake-utils python-any-r1
+inherit cmake-utils llvm python-any-r1
MY_P=llvm-${PV/_/}
DESCRIPTION="OCaml bindings for LLVM"
@@ -54,6 +54,11 @@ python_check_deps() {
|| 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
@@ -94,6 +99,18 @@ src_configure() {
)
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() {
@@ -103,9 +120,6 @@ src_compile() {
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
}
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
index 49f090910a2..472e5dbe271 100644
--- a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild
@@ -9,7 +9,7 @@ EAPI=6
CMAKE_MIN_VERSION=3.7.0-r1
PYTHON_COMPAT=( python2_7 )
-inherit cmake-utils git-r3 python-any-r1
+inherit cmake-utils git-r3 llvm python-any-r1
DESCRIPTION="OCaml bindings for LLVM"
HOMEPAGE="http://llvm.org/"
@@ -53,6 +53,11 @@ python_check_deps() {
|| has_version "dev-python/lit[${PYTHON_USEDEP}]"
}
+pkg_setup() {
+ llvm_pkg_setup
+ python-any-r1_pkg_setup
+}
+
src_prepare() {
# Python is needed to run tests using lit
python_setup
@@ -93,6 +98,18 @@ src_configure() {
)
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() {
@@ -102,9 +119,6 @@ src_compile() {
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
}