sys-libs/libxcrypt: Fix installation with USE="split-usr system".
authorArfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Sat, 8 Feb 2020 00:17:34 +0000 (00:17 +0000)
committerPatrick McLean <chutzpah@gentoo.org>
Sat, 8 Feb 2020 00:50:31 +0000 (16:50 -0800)
Do not install 3 unnecessary copies of full library (regular file) for each non-native ABI:
  /usr/$(get_libdir)/libcrypt.so
  /usr/$(get_libdir)/libowcrypt.so
  /usr/$(get_libdir)/libxcrypt.so

Do not install unnecessary symlinks for each ABI:
  /usr/$(get_libdir)/libcrypt.so.2
  /usr/$(get_libdir)/libowcrypt.so.2
  /usr/$(get_libdir)/libxcrypt.so.2

Do not use gen_usr_ldscript().

No changes for other combinations of USE flags.

Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
sys-libs/libxcrypt/libxcrypt-4.4.12-r3.ebuild [moved from sys-libs/libxcrypt/libxcrypt-4.4.12-r2.ebuild with 84% similarity]

similarity index 84%
rename from sys-libs/libxcrypt/libxcrypt-4.4.12-r2.ebuild
rename to sys-libs/libxcrypt/libxcrypt-4.4.12-r3.ebuild
index eb95be5ae561be431eac889317ffa8b69e6bf356..166f638a5790b4ef26ffdba9029e05dfbd9f1ea1 100644 (file)
@@ -1,9 +1,9 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 2004-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=7
 PYTHON_COMPAT=( python3_{6,7,8} )
-inherit autotools multibuild python-any-r1 usr-ldscript multilib-minimal
+inherit autotools multibuild python-any-r1 multilib-minimal
 
 DESCRIPTION="Extended crypt library for descrypt, md5crypt, bcrypt, and others "
 SRC_URI="https://github.com/besser82/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
@@ -105,7 +105,7 @@ src_install() {
        (
                shopt -s failglob || die "failglob failed"
 
-               # make sure out man pages don't collide with glibc or man-pages
+               # Make sure our man pages do not collide with glibc or man-pages.
                for manpage in "${ED}"/usr/share/man/man3/crypt{,_r}.?*; do
                        mv -n "${manpage}" "$(dirname "${manpage}")/xcrypt_$(basename "${manpage}")" \
                                || die "mv failed"
@@ -143,20 +143,17 @@ multilib_src_install() {
                                        fi
 
                                        if use system; then
-                                               # now try to find libraries and make sure to generate
-                                               # ldscripts for them
+                                               # Move versionless .so symlinks from /$(get_libdir) to /usr/$(get_libdir)
+                                               # to allow linker to correctly find shared libraries.
                                                shopt -s failglob || die "failglob failed"
 
                                                for lib_file in "${ED}"$(get_xclibdir)/*$(get_libname); do
-                                                       libname="$(basename "${lib_file}")"
-
-                                                       cp -L "${lib_file}" \
-                                                               "${ED}/usr/$(get_xclibdir)/${libname}" \
-                                                               || die "copying ${libname} failed"
-
-                                                       gen_usr_ldscript ${libname}
-                                                       dosym ${libname} /usr/$(get_xclibdir)/${libname}.2
+                                                       lib_file_basename="$(basename "${lib_file}")"
+                                                       lib_file_target="$(basename "$(readlink -f "${lib_file}")")"
+                                                       dosym "../../$(get_libdir)/${lib_file_target}" "/usr/$(get_xclibdir)/${lib_file_basename}"
                                                done
+
+                                               rm "${ED}"$(get_xclibdir)/*$(get_libname) || die "removing symlinks in incorrect location failed"
                                        fi
                                )
                        fi