dev-libs/libclc: Fix possible llvm/clang slot mismatch, #615754
authorMichał Górny <mgorny@gentoo.org>
Mon, 26 Jun 2017 21:27:57 +0000 (23:27 +0200)
committerMichał Górny <mgorny@gentoo.org>
Mon, 26 Jun 2017 21:35:14 +0000 (23:35 +0200)
Ensure that the LLVM slot with matching clang version is always used.
Otherwise, if you have a newer LLVM slot without clang, and an older
slot with clang, libclc got paths from the newer llvm-config and was
unable to find clang. Now the ebuild finds clang first, and uses
the llvm-config installed alongside it.

dev-libs/libclc/libclc-0.2.0_pre20170118.ebuild

index 7243a9d9279eaaf6cd780bdc81cbc3fc54b1602b..c0ac06980cb486c781af3c3979116e8de834214a 100644 (file)
@@ -39,9 +39,13 @@ DEPEND="${RDEPEND}
        ${PYTHON_DEPS}"
 
 src_configure() {
+       # we need to find llvm with matching clang version, so look for
+       # clang first, and then use llvm-config from the same location
+       local clang_path=$(type -P clang) || die
+
        ./configure.py \
                --with-cxx-compiler="$(tc-getCXX)" \
-               --with-llvm-config="$(type -P llvm-config)" \
+               --with-llvm-config="${clang_path%/*}/llvm-config" \
                --prefix="${EPREFIX}/usr" || die
 }