--- /dev/null
+diff --git a/Makefile.am b/Makefile.am
+index 26db1c1..597c3f4 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -84,11 +84,7 @@ noinst_HEADERS = \
+ test/des-cases.h \
+ test/ka-table.inc
+
+-if ENABLE_XCRYPT_COMPAT_FILES
+ nodist_include_HEADERS += xcrypt.h
+-else
+-nodist_noinst_HEADERS += xcrypt.h
+-endif
+
+ noinst_PROGRAMS = \
+ lib/gen-des-tables
+@@ -137,7 +133,7 @@ uninstall_hook_targets = \
+ uninstall-hook-pkgconfig
+ install-data-hook-pkgconfig:
+ cd $(DESTDIR)$(pkgconfigdir) && \
+- $(LN_S) libxcrypt.pc libcrypt.pc
++ $(LN_S) -f libxcrypt.pc libcrypt.pc
+ uninstall-hook-pkgconfig:
+ -rm -f $(DESTDIR)$(pkgconfigdir)/libcrypt.pc
+
--- /dev/null
+diff --git a/configure.ac b/configure.ac
+index 1e74bb1..4249fb5 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -241,11 +241,7 @@ ENABLE_KA_TABLE_GEN="no"
+ # This way we just need one call to AC_PATH_PROGS to likely get a
+ # suitable version of Python. The version check afterwards is for
+ # the case just a generic 'python3' or 'python' executable was found.
+-PYTHON_CANDIDATE_VERSIONS="python3 python"
+-
+-for ver in `seq 6 1 10`; do
+- PYTHON_CANDIDATE_VERSIONS="python3.$ver $PYTHON_CANDIDATE_VERSIONS"
+-done
++PYTHON_CANDIDATE_VERSIONS="${EPYTHON}"
+
+ AC_PATH_PROGS([PYTHON], [$PYTHON_CANDIDATE_VERSIONS], [])
+
EAPI=7
PYTHON_COMPAT=( python3_{6,7,8} )
-inherit autotools multibuild python-any-r1 multilib-minimal
+inherit autotools usr-ldscript 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"
$(python_gen_any_dep 'dev-python/passlib[${PYTHON_USEDEP}]')
)"
-# Gentoo CI complained about not having this
RESTRICT="!test? ( test )"
PATCHES=(
- "${FILESDIR}/libxcrypt-4.4.10-pythonver.patch"
- "${FILESDIR}/libxcrypt-4.4.10-multibuild.patch"
+ "${FILESDIR}/libxcrypt-4.4.12-pythonver.patch"
+ "${FILESDIR}/libxcrypt-4.4.12-multibuild.patch"
)
pkg_setup() {
}
get_xclibdir() {
- printf -- "%s\n" "$(usex split-usr '' '/usr')/$(get_libdir)/$(usex system '' 'xcrypt')"
+ printf -- "%s/%s/%s\n" \
+ "$(usex split-usr '' '/usr')" \
+ "$(get_libdir)" \
+ "$(usex system '' 'xcrypt')"
}
multilib_src_configure() {
--enable-obsolete-api=no
$(use_enable static-libs static)
)
- ;;
+ ;;
*) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
esac
done
) || die "failglob error"
+ gen_usr_ldscript libxcrypt.so $(usex system 'libcrypt.so' '')
+
# remove useless stuff from installation
find "${D}"/usr/share/doc/${PF} -type l -delete || die
find "${D}" -name '*.la' -delete || die
}
-multilib_install() {
- local install_target
-
- case "${MULTIBUILD_ID}" in
- xcrypt_compat-*) install_target="install-libLTLIBRARIES";;
- xcrypt_nocompat-*)
- if is_final_abi; then
- install_target="install"
- else
- install_target="install-libLTLIBRARIES"
- fi
- ;;
- *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
- esac
-
- emake DESTDIR="${D}" ${install_target}
+multilib_src_install() {
+ emake DESTDIR="${D}" install
# don't install the libcrypt.so symlink for the "compat" version
case "${MULTIBUILD_ID}" in
xcrypt_compat-*)
rm "${D}"$(get_xclibdir)/libcrypt$(get_libname) \
- "${D}"/usr/include/$(usex system '' 'xcrypt/')xcrypt.h || die
+ || die "failed to remove extra compat libraries"
;;
xcrypt_nocompat-*)
if use split-usr; then
for so_file in "${D}"$(get_xclibdir)/*$(get_libname)*; do
so_file=$(basename "${so_file}") || die
- dosym ../../$(usex system '' '../')$(get_libdir)/$(usex system '' 'xcrypt')/${so_file} \
+ dosym ../../$(usex system '' '../')$(get_libdir)$(usex system '' '/xcrypt')/${so_file} \
/usr/$(get_libdir)/$(usex system '' 'xcrypt/')${so_file}
done
) || die "symlinking library failure"
fi
- ;;
+ ;;
+ *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
esac
+
+ # .a files are installed to /$(get_libdir) by default
+ if use static-libs; then
+ (
+ shopt -s nullglob || die "nullglob failed"
+ static_libs=( "${D}"/$(get_xclibdir)/*.a )
+
+ if [[ -n ${static_libs[*]} ]]; then
+ mv "${static_libs[@]}" "${D}/usr/$(get_xclibdir)" \
+ || die "moving static libs failed"
+ fi
+ )
+ fi
}