commit:     eb353cbfc1c15d198710cd7f27f63298e3b13e27
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 14 14:43:27 2017 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sat Jan 14 18:12:30 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eb353cbf

sys-devel/clang: Obtain version from llvm-config

Obtain the clang version that is used for paths and executable names
from llvm-config, instead of hardcoding it in ebuild. This matches
the method used in upstream code (obtaining it from CMake files),
and works both for release and live ebuilds.

 sys-devel/clang/clang-9999.ebuild | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys-devel/clang/clang-9999.ebuild 
b/sys-devel/clang/clang-9999.ebuild
index 9baefac..9e4abc9 100644
--- a/sys-devel/clang/clang-9999.ebuild
+++ b/sys-devel/clang/clang-9999.ebuild
@@ -131,8 +131,8 @@ src_prepare() {
 }
 
 multilib_src_configure() {
-       # TODO: read it?
-       local clang_version=4.0.0
+       local llvm_version=$(llvm-config --version) || die
+       local clang_version=$(get_version_component_range 1-3 "${llvm_version}")
        local libdir=$(get_libdir)
        local mycmakeargs=(
                -DLLVM_LIBDIR_SUFFIX=${libdir#lib}
@@ -222,7 +222,9 @@ src_install() {
        mv "${ED}usr/include/clangrt" "${ED}usr/lib/clang" || die
 
        # Apply CHOST and version suffix to clang tools
-       local clang_version=4.0
+       # note: we use two version components here (vs 3 in runtime path)
+       local llvm_version=$(llvm-config --version) || die
+       local clang_version=$(get_version_component_range 1-2 "${llvm_version}")
        local clang_tools=( clang clang++ clang-cl clang-cpp )
        local abi i
 

Reply via email to