commit:     d6535cc0b605b03af4e35cff1bf8ba9f0691dfaf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 16 22:09:32 2021 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Sat Jul 17 17:11:04 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6535cc0

sys-libs/glibc: add preserve-libs for libcrypt

Bug: https://bugs.gentoo.org/802207
Signed-off-by: Sam James <sam <AT> gentoo.org>
Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

 .../{glibc-9999.ebuild => glibc-2.33-r3.ebuild}     | 21 +++++++++++++++++----
 sys-libs/glibc/glibc-9999.ebuild                    | 16 +++++++++++++++-
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/sys-libs/glibc/glibc-9999.ebuild 
b/sys-libs/glibc/glibc-2.33-r3.ebuild
similarity index 98%
copy from sys-libs/glibc/glibc-9999.ebuild
copy to sys-libs/glibc/glibc-2.33-r3.ebuild
index e2bc0dad866..73e8908484d 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-2.33-r3.ebuild
@@ -6,7 +6,7 @@ EAPI=7
 PYTHON_COMPAT=( python3_{7,8,9,10} )
 TMPFILES_OPTIONAL=1
 
-inherit python-any-r1 prefix toolchain-funcs flag-o-matic gnuconfig \
+inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic 
gnuconfig \
        multilib systemd multiprocessing tmpfiles
 
 DESCRIPTION="GNU libc C library"
@@ -17,14 +17,13 @@ SLOT="2.2"
 EMULTILIB_PKG="true"
 
 # Gentoo patchset (ignored for live ebuilds)
-PATCH_VER=16
-PATCH_DEV=slyfox
+PATCH_VER=4
+PATCH_DEV=dilfridge
 
 if [[ ${PV} == 9999* ]]; then
        inherit git-r3
 else
        #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc 
~ppc64 ~riscv ~s390 ~sparc ~x86"
-       KEYWORDS=""
        SRC_URI="mirror://gnu/glibc/${P}.tar.xz"
        SRC_URI+=" 
https://dev.gentoo.org/~${PATCH_DEV}/distfiles/${P}-patches-${PATCH_VER}.tar.xz";
 fi
@@ -1489,6 +1488,16 @@ pkg_preinst() {
                # https://bugs.gentoo.org/753740
                rm "${EROOT}"/usr/lib/locale || die
        fi
+
+       # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
+       # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
+       # bug #802207
+       if has_version "${CATEGORY}/${PN}[crypt]"; then
+               PRESERVED_OLD_LIBCRYPT=1
+               preserve_old_lib /$(get_libdir)/libcrypt$(get_libname 1)
+       else
+               PRESERVED_OLD_LIBCRYPT=0
+       fi
 }
 
 pkg_postinst() {
@@ -1518,4 +1527,8 @@ pkg_postinst() {
                        fi
                done
        fi
+
+       if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
+               preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
+       fi
 }

diff --git a/sys-libs/glibc/glibc-9999.ebuild b/sys-libs/glibc/glibc-9999.ebuild
index e2bc0dad866..b3fc7c71c7b 100644
--- a/sys-libs/glibc/glibc-9999.ebuild
+++ b/sys-libs/glibc/glibc-9999.ebuild
@@ -6,7 +6,7 @@ EAPI=7
 PYTHON_COMPAT=( python3_{7,8,9,10} )
 TMPFILES_OPTIONAL=1
 
-inherit python-any-r1 prefix toolchain-funcs flag-o-matic gnuconfig \
+inherit python-any-r1 prefix preserve-libs toolchain-funcs flag-o-matic 
gnuconfig \
        multilib systemd multiprocessing tmpfiles
 
 DESCRIPTION="GNU libc C library"
@@ -1489,6 +1489,16 @@ pkg_preinst() {
                # https://bugs.gentoo.org/753740
                rm "${EROOT}"/usr/lib/locale || die
        fi
+
+       # Keep around libcrypt so that Perl doesn't break when merging libxcrypt
+       # (libxcrypt is the new provider for now of libcrypt.so.{1,2}).
+       # bug #802207
+       if has_version "${CATEGORY}/${PN}[crypt]"; then
+               PRESERVED_OLD_LIBCRYPT=1
+               preserve_old_lib /$(get_libdir)/libcrypt$(get_libname 1)
+       else
+               PRESERVED_OLD_LIBCRYPT=0
+       fi
 }
 
 pkg_postinst() {
@@ -1518,4 +1528,8 @@ pkg_postinst() {
                        fi
                done
        fi
+
+       if [[ ${PRESERVED_OLD_LIBCRYPT} -eq 1 ]] ; then
+               preserve_old_lib_notify /$(get_libdir)/libcrypt$(get_libname 1)
+       fi
 }

Reply via email to