From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-923069-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id 55E9B139085
	for <garchives@archives.gentoo.org>; Sat, 14 Jan 2017 18:14:39 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E3162234041;
	Sat, 14 Jan 2017 18:14:37 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C23D3234041
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2017 18:14:37 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 7CA7934119A
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2017 18:14:36 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id B246C270B
	for <gentoo-commits@lists.gentoo.org>; Sat, 14 Jan 2017 18:14:34 +0000 (UTC)
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" <mgorny@gentoo.org>
Message-ID: <1484417550.eb353cbfc1c15d198710cd7f27f63298e3b13e27.mgorny@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-devel/clang/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-devel/clang/clang-9999.ebuild
X-VCS-Directories: sys-devel/clang/
X-VCS-Committer: mgorny
X-VCS-Committer-Name: Michał Górny
X-VCS-Revision: eb353cbfc1c15d198710cd7f27f63298e3b13e27
X-VCS-Branch: master
Date: Sat, 14 Jan 2017 18:14:34 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Archives-Salt: e1025102-db4f-4c0f-b16e-ae59c35c1074
X-Archives-Hash: c60cdbafefb1a2b15727a4e817010179

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