commit:     d9a5223420c777c1edde14239f812d788d8848e7
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Sep  5 02:22:36 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Sep  5 02:22:36 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d9a52234

sys-libs/pam: workaround build failures on musl w/ sys-libs/libxcrypt[compat]

Closes: https://bugs.gentoo.org/867991
Signed-off-by: Sam James <sam <AT> gentoo.org>

 sys-libs/pam/pam-1.5.2-r2.ebuild | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/sys-libs/pam/pam-1.5.2-r2.ebuild b/sys-libs/pam/pam-1.5.2-r2.ebuild
index 428087494c40..5a8c46443f0d 100644
--- a/sys-libs/pam/pam-1.5.2-r2.ebuild
+++ b/sys-libs/pam/pam-1.5.2-r2.ebuild
@@ -9,7 +9,7 @@ MY_P="Linux-${PN^^}-${PV}"
 # Can reconsider w/ EAPI 8 and IDEPEND, bug #810979
 TMPFILES_OPTIONAL=1
 
-inherit autotools db-use fcaps toolchain-funcs usr-ldscript multilib-minimal
+inherit autotools db-use fcaps flag-o-matic toolchain-funcs usr-ldscript 
multilib-minimal
 
 DESCRIPTION="Linux-PAM (Pluggable Authentication Modules)"
 HOMEPAGE="https://github.com/linux-pam/linux-pam";
@@ -59,6 +59,19 @@ multilib_src_configure() {
        # Do not let user's BROWSER setting mess us up. #549684
        unset BROWSER
 
+       # This whole weird has_version libxcrypt block can go once
+       # musl systems have libxcrypt[system] if we ever make
+       # that mandatory. See bug #867991.
+       if use elibc_musl && ! has_version sys-libs/libxcrypt[system] ; then
+               # Avoid picking up symbol-versioned compat symbol on musl 
systems
+               export ac_cv_search_crypt_gensalt_rn=no
+
+               # Need to avoid picking up the libxcrypt headers which define
+               # CRYPT_GENSALT_IMPLEMENTS_AUTO_ENTROPY.
+               cp "${ESYSROOT}"/usr/include/crypt.h "${T}"/crypt.h || die
+               append-cppflags -I"${T}"
+       fi
+
        local myconf=(
                CC_FOR_BUILD="$(tc-getBUILD_CC)"
                --with-db-uniquename=-$(db_findver sys-libs/db)

Reply via email to