From 0653b35c94d4c071bd0fbc9760e44f1b53b62a7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Micha=C5=82=20G=C3=B3rny?= Date: Fri, 30 Jun 2017 17:08:50 +0200 Subject: [PATCH] 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). --- eclass/llvm.eclass | 13 ++++++------- 1 file 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 -- 2.26.2