sys-libs/musl: extract $(ARCH)$(SUBARCH) from config.mak
authorSergei Trofimovich <slyfox@gentoo.org>
Wed, 20 May 2020 22:06:40 +0000 (17:06 -0500)
committerJory Pratt <anarchy@gentoo.org>
Wed, 20 May 2020 22:12:03 +0000 (17:12 -0500)
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@gentoo.org>
Signed-off-by: Jory Pratt <anarchy@gentoo.org>
sys-libs/musl/musl-1.1.24.ebuild
sys-libs/musl/musl-1.2.0.ebuild
sys-libs/musl/musl-9999.ebuild

index 7948e4dbf5b3953cebc2f4b6c8c8c86083d7f004..453281e19f28e5009c214407e9b8a09fb7ed53e6 100644 (file)
@@ -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
index e33c6c809136e543d72302931c60974d448989db..6aab4a0a5ecd6b41f59b4d290f82a3d50a36a2d8 100644 (file)
@@ -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
index 50beaf64e1aa432251c773c0df3371656ec37ce2..dc422c9426b1c63bd3f2b059119e8d66acd4e007 100644 (file)
@@ -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