1 |
commit: 38368fa1b651054b97a272104ab7350a6e73b819 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Feb 2 21:02:05 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Feb 15 12:47:22 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=38368fa1 |
7 |
|
8 |
dev-ml/llvm-ocaml: Fix install against slotted LLVM |
9 |
|
10 |
dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild | 22 ++++++++++++++++++---- |
11 |
dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild | 22 ++++++++++++++++++---- |
12 |
2 files changed, 36 insertions(+), 8 deletions(-) |
13 |
|
14 |
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 |
15 |
index e984d57140..3b21af3a47 100644 |
16 |
--- a/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild |
17 |
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-4.0.0_rc1.ebuild |
18 |
@@ -9,7 +9,7 @@ EAPI=6 |
19 |
CMAKE_MIN_VERSION=3.7.0-r1 |
20 |
PYTHON_COMPAT=( python2_7 ) |
21 |
|
22 |
-inherit cmake-utils python-any-r1 |
23 |
+inherit cmake-utils llvm python-any-r1 |
24 |
|
25 |
MY_P=llvm-${PV/_/} |
26 |
DESCRIPTION="OCaml bindings for LLVM" |
27 |
@@ -54,6 +54,11 @@ python_check_deps() { |
28 |
|| has_version "dev-python/lit[${PYTHON_USEDEP}]" |
29 |
} |
30 |
|
31 |
+pkg_setup() { |
32 |
+ LLVM_MAX_SLOT=${PV%%.*} llvm_pkg_setup |
33 |
+ python-any-r1_pkg_setup |
34 |
+} |
35 |
+ |
36 |
src_prepare() { |
37 |
# Python is needed to run tests using lit |
38 |
python_setup |
39 |
@@ -94,6 +99,18 @@ src_configure() { |
40 |
) |
41 |
|
42 |
cmake-utils_src_configure |
43 |
+ |
44 |
+ local llvm_libdir=$(llvm-config --libdir) |
45 |
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml... |
46 |
+ cd "${BUILD_DIR}/${libdir}" || die |
47 |
+ ln -s "${llvm_libdir}"/*.so . || die |
48 |
+ |
49 |
+ if use test; then |
50 |
+ local llvm_bindir=$(llvm-config --bindir) |
51 |
+ # Force using system-installed tools. |
52 |
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \ |
53 |
+ "${BUILD_DIR}"/test/lit.site.cfg || die |
54 |
+ fi |
55 |
} |
56 |
|
57 |
src_compile() { |
58 |
@@ -103,9 +120,6 @@ src_compile() { |
59 |
src_test() { |
60 |
# respect TMPDIR! |
61 |
local -x LIT_PRESERVES_TMP=1 |
62 |
- # Force using system-installed tools. |
63 |
- sed -i -e "/llvm_tools_dir/s@\".*\"@\"${EPREFIX}/usr/bin\"@" \ |
64 |
- "${BUILD_DIR}"/test/lit.site.cfg || die |
65 |
cmake-utils_src_make check-llvm-bindings-ocaml |
66 |
} |
67 |
|
68 |
|
69 |
diff --git a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild |
70 |
index 49f090910a..472e5dbe27 100644 |
71 |
--- a/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild |
72 |
+++ b/dev-ml/llvm-ocaml/llvm-ocaml-9999.ebuild |
73 |
@@ -9,7 +9,7 @@ EAPI=6 |
74 |
CMAKE_MIN_VERSION=3.7.0-r1 |
75 |
PYTHON_COMPAT=( python2_7 ) |
76 |
|
77 |
-inherit cmake-utils git-r3 python-any-r1 |
78 |
+inherit cmake-utils git-r3 llvm python-any-r1 |
79 |
|
80 |
DESCRIPTION="OCaml bindings for LLVM" |
81 |
HOMEPAGE="http://llvm.org/" |
82 |
@@ -53,6 +53,11 @@ python_check_deps() { |
83 |
|| has_version "dev-python/lit[${PYTHON_USEDEP}]" |
84 |
} |
85 |
|
86 |
+pkg_setup() { |
87 |
+ llvm_pkg_setup |
88 |
+ python-any-r1_pkg_setup |
89 |
+} |
90 |
+ |
91 |
src_prepare() { |
92 |
# Python is needed to run tests using lit |
93 |
python_setup |
94 |
@@ -93,6 +98,18 @@ src_configure() { |
95 |
) |
96 |
|
97 |
cmake-utils_src_configure |
98 |
+ |
99 |
+ local llvm_libdir=$(llvm-config --libdir) |
100 |
+ # an ugly hack; TODO: figure out a way to pass -L to ocaml... |
101 |
+ cd "${BUILD_DIR}/${libdir}" || die |
102 |
+ ln -s "${llvm_libdir}"/*.so . || die |
103 |
+ |
104 |
+ if use test; then |
105 |
+ local llvm_bindir=$(llvm-config --bindir) |
106 |
+ # Force using system-installed tools. |
107 |
+ sed -i -e "/llvm_tools_dir/s@\".*\"@\"${llvm_bindir}\"@" \ |
108 |
+ "${BUILD_DIR}"/test/lit.site.cfg || die |
109 |
+ fi |
110 |
} |
111 |
|
112 |
src_compile() { |
113 |
@@ -102,9 +119,6 @@ src_compile() { |
114 |
src_test() { |
115 |
# respect TMPDIR! |
116 |
local -x LIT_PRESERVES_TMP=1 |
117 |
- # Force using system-installed tools. |
118 |
- sed -i -e "/llvm_tools_dir/s@\".*\"@\"${EPREFIX}/usr/bin\"@" \ |
119 |
- "${BUILD_DIR}"/test/lit.site.cfg || die |
120 |
cmake-utils_src_make check-llvm-bindings-ocaml |
121 |
} |