From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1173077-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 3520D1382C5
	for <garchives@archives.gentoo.org>; Wed, 20 May 2020 22:12:21 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 29E17E0899;
	Wed, 20 May 2020 22:12:20 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id ECBC9E0899
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 May 2020 22:12:19 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id BA81C34F2C4
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 May 2020 22:12:17 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 27FD1250
	for <gentoo-commits@lists.gentoo.org>; Wed, 20 May 2020 22:12:16 +0000 (UTC)
From: "Jory Pratt" <anarchy@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, "Jory Pratt" <anarchy@gentoo.org>
Message-ID: <1590012723.a9b1dd3546c9849e5e342d246bdddea95c00dd2a.anarchy@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/musl/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-libs/musl/musl-1.1.24.ebuild sys-libs/musl/musl-1.2.0.ebuild sys-libs/musl/musl-9999.ebuild
X-VCS-Directories: sys-libs/musl/
X-VCS-Committer: anarchy
X-VCS-Committer-Name: Jory Pratt
X-VCS-Revision: a9b1dd3546c9849e5e342d246bdddea95c00dd2a
X-VCS-Branch: master
Date: Wed, 20 May 2020 22:12:16 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 800d7005-a8e8-431f-8ed9-17bad02c60fb
X-Archives-Hash: c10dc277e3d15263debe73da9d55220c

commit:     a9b1dd3546c9849e5e342d246bdddea95c00dd2a
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Wed May 20 22:06:40 2020 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Wed May 20 22:12:03 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a9b1dd35

sys-libs/musl: extract $(ARCH)$(SUBARCH) from config.mak

Closes: https://bugs.gentoo.org/642612
Closes: https://bugs.gentoo.org/645626

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 sys-libs/musl/musl-1.1.24.ebuild | 6 +++++-
 sys-libs/musl/musl-1.2.0.ebuild  | 6 +++++-
 sys-libs/musl/musl-9999.ebuild   | 6 +++++-
 3 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/sys-libs/musl/musl-1.1.24.ebuild b/sys-libs/musl/musl-1.1.24.ebuild
index 7948e4dbf5b..453281e19f2 100644
--- a/sys-libs/musl/musl-1.1.24.ebuild
+++ b/sys-libs/musl/musl-1.1.24.ebuild
@@ -98,7 +98,11 @@ src_install() {
 	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
 
 	if [[ ${CATEGORY} != cross-* ]] ; then
-		local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+		# Fish out of config:
+		#   ARCH = ...
+		#   SUBARCH = ...
+		# and print $(ARCH)$(SUBARCH).
+		local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
 		[[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
 		cp "${FILESDIR}"/ldconfig.in "${T}" || die
 		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die

diff --git a/sys-libs/musl/musl-1.2.0.ebuild b/sys-libs/musl/musl-1.2.0.ebuild
index e33c6c80913..6aab4a0a5ec 100644
--- a/sys-libs/musl/musl-1.2.0.ebuild
+++ b/sys-libs/musl/musl-1.2.0.ebuild
@@ -98,7 +98,11 @@ src_install() {
 	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
 
 	if [[ ${CATEGORY} != cross-* ]] ; then
-		local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+		# Fish out of config:
+		#   ARCH = ...
+		#   SUBARCH = ...
+		# and print $(ARCH)$(SUBARCH).
+		local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
 		[[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
 		cp "${FILESDIR}"/ldconfig.in "${T}" || die
 		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die

diff --git a/sys-libs/musl/musl-9999.ebuild b/sys-libs/musl/musl-9999.ebuild
index 50beaf64e1a..dc422c9426b 100644
--- a/sys-libs/musl/musl-9999.ebuild
+++ b/sys-libs/musl/musl-9999.ebuild
@@ -98,7 +98,11 @@ src_install() {
 	dosym ${sysroot}/lib/${ldso} ${sysroot}/usr/bin/ldd
 
 	if [[ ${CATEGORY} != cross-* ]] ; then
-		local arch=$("${D}"usr/lib/libc.so 2>&1 | sed -n '1s/^musl libc (\(.*\))$/\1/p')
+		# Fish out of config:
+		#   ARCH = ...
+		#   SUBARCH = ...
+		# and print $(ARCH)$(SUBARCH).
+		local arch=$(awk '{ k[$1] = $3 } END { printf("%s%s", k["ARCH"], k["SUBARCH"]); }' config.mak)
 		[[ -e "${D}"/lib/ld-musl-${arch}.so.1 ]] || die
 		cp "${FILESDIR}"/ldconfig.in "${T}" || die
 		sed -e "s|@@ARCH@@|${arch}|" "${T}"/ldconfig.in > "${T}"/ldconfig || die