From a9b1dd3546c9849e5e342d246bdddea95c00dd2a Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Wed, 20 May 2020 17:06:40 -0500 Subject: [PATCH] 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 Signed-off-by: Jory Pratt --- 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 7948e4dbf5b3..453281e19f28 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 e33c6c809136..6aab4a0a5ecd 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 50beaf64e1aa..dc422c9426b1 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 -- 2.26.2