diff options
author | Michał Górny <mgorny@gentoo.org> | 2017-06-30 17:08:50 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2017-08-12 23:21:28 +0200 |
commit | 0653b35c94d4c071bd0fbc9760e44f1b53b62a7b (patch) | |
tree | 4865cd5d674534d933fef3a753b564460607ed3c /eclass/llvm.eclass | |
parent | sci-libs/adolc: remove unnecessary blank lines from live ebuild (diff) | |
download | gentoo-0653b35c94d4c071bd0fbc9760e44f1b53b62a7b.tar.gz gentoo-0653b35c94d4c071bd0fbc9760e44f1b53b62a7b.tar.bz2 gentoo-0653b35c94d4c071bd0fbc9760e44f1b53b62a7b.zip |
llvm.eclass: Check for installed package rather than executable
Ensure that a specific LLVM slot is installed via using has_version on
"sys-devel/llvm:${SLOT}" rather than checking whether llvm-config is
installed in expected location. While it is a bit slower, this is closer
to a canonical way of testing it and will be useful when we allow
testing for more specific dependency strings. Right now, it could be
helpful if one has broken LLVM installation (i.e. stray files).
Diffstat (limited to 'eclass/llvm.eclass')
-rw-r--r-- | eclass/llvm.eclass | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/eclass/llvm.eclass b/eclass/llvm.eclass index 1128615cd35a..4df3825e6e31 100644 --- a/eclass/llvm.eclass +++ b/eclass/llvm.eclass @@ -91,9 +91,9 @@ get_llvm_prefix() { fi fi - local p=${EPREFIX}/usr/lib/llvm/${slot} - if [[ -x ${p}/bin/llvm-config ]]; then - echo "${p}" + # check if LLVM package is installed + if has_version "sys-devel/llvm:${slot}"; then + echo "${EPREFIX}/usr/lib/llvm/${slot}" return fi done @@ -105,13 +105,12 @@ get_llvm_prefix() { # fallback to :0 # assume it's always <= 4 (the lower max_slot allowed) - p=${EPREFIX}/usr - if [[ -x ${p}/bin/llvm-config ]]; then - echo "${p}" + if has_version "sys-devel/llvm:0"; then + echo "${EPREFIX}/usr" return fi - die "No LLVM slot${1:+ <= ${1}} found in PATH!" + die "No LLVM slot${1:+ <= ${1}} found installed!" } # @FUNCTION: llvm_pkg_setup |