1 |
commit: 0653b35c94d4c071bd0fbc9760e44f1b53b62a7b |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jun 30 15:08:50 2017 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Aug 12 21:21:28 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0653b35c |
7 |
|
8 |
llvm.eclass: Check for installed package rather than executable |
9 |
|
10 |
Ensure that a specific LLVM slot is installed via using has_version on |
11 |
"sys-devel/llvm:${SLOT}" rather than checking whether llvm-config is |
12 |
installed in expected location. While it is a bit slower, this is closer |
13 |
to a canonical way of testing it and will be useful when we allow |
14 |
testing for more specific dependency strings. Right now, it could be |
15 |
helpful if one has broken LLVM installation (i.e. stray files). |
16 |
|
17 |
eclass/llvm.eclass | 13 ++++++------- |
18 |
1 file changed, 6 insertions(+), 7 deletions(-) |
19 |
|
20 |
diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass |
21 |
index 1128615cd35..4df3825e6e3 100644 |
22 |
--- a/eclass/llvm.eclass |
23 |
+++ b/eclass/llvm.eclass |
24 |
@@ -91,9 +91,9 @@ get_llvm_prefix() { |
25 |
fi |
26 |
fi |
27 |
|
28 |
- local p=${EPREFIX}/usr/lib/llvm/${slot} |
29 |
- if [[ -x ${p}/bin/llvm-config ]]; then |
30 |
- echo "${p}" |
31 |
+ # check if LLVM package is installed |
32 |
+ if has_version "sys-devel/llvm:${slot}"; then |
33 |
+ echo "${EPREFIX}/usr/lib/llvm/${slot}" |
34 |
return |
35 |
fi |
36 |
done |
37 |
@@ -105,13 +105,12 @@ get_llvm_prefix() { |
38 |
|
39 |
# fallback to :0 |
40 |
# assume it's always <= 4 (the lower max_slot allowed) |
41 |
- p=${EPREFIX}/usr |
42 |
- if [[ -x ${p}/bin/llvm-config ]]; then |
43 |
- echo "${p}" |
44 |
+ if has_version "sys-devel/llvm:0"; then |
45 |
+ echo "${EPREFIX}/usr" |
46 |
return |
47 |
fi |
48 |
|
49 |
- die "No LLVM slot${1:+ <= ${1}} found in PATH!" |
50 |
+ die "No LLVM slot${1:+ <= ${1}} found installed!" |
51 |
} |
52 |
|
53 |
# @FUNCTION: llvm_pkg_setup |