Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libxcrypt/
Date: Fri, 18 Jun 2021 10:23:33
Message-Id: 1624011807.6d8701f162c8a12c6c2bc1e5e4b25a3229a077a4.slyfox@gentoo
1 commit: 6d8701f162c8a12c6c2bc1e5e4b25a3229a077a4
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 18 10:23:02 2021 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 18 10:23:27 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d8701f1
7
8 sys-libs/libxcrypt: bump up to 4.4.22
9
10 Package-Manager: Portage-3.0.20, Repoman-3.0.3
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 sys-libs/libxcrypt/Manifest | 1 +
14 sys-libs/libxcrypt/libxcrypt-4.4.22.ebuild | 163 +++++++++++++++++++++++++++++
15 2 files changed, 164 insertions(+)
16
17 diff --git a/sys-libs/libxcrypt/Manifest b/sys-libs/libxcrypt/Manifest
18 index 39a2976e174..bf74d48569e 100644
19 --- a/sys-libs/libxcrypt/Manifest
20 +++ b/sys-libs/libxcrypt/Manifest
21 @@ -1,2 +1,3 @@
22 DIST libxcrypt-4.4.17.tar.gz 519096 BLAKE2B 12cbe3d1f235baddd8d2ec8159f2a7514e75c2f91cf0db18ef909ec11c38ac19efebecec647a90cafb27c7ebc7e940da448ca8f3edd1c49e5cb9cc4407d5198c SHA512 94aaba6ccf9b6d1a32f9a571ee32261cecd393d5b8d8c6f18d740dc7bb29ac0fbd381124e7f0d84882559bb634208c08151b3dc05c9138fa0a229c4ba20fb6f7
23 DIST libxcrypt-4.4.20.tar.gz 534367 BLAKE2B 9174bd342dc13db8fd724a13e3fbd222a0f5e2d058be2d7f511816e137fa61bd73d4b9482c85d81f27404d0e650be59c45f25d70ec3c506730d2422da4e97417 SHA512 66b1966003427728f96d5a83f75930a4b82d31133392bede3975cf9a1e1423d0312e73da598e40d0e3507f26fac5222cc92d7a5593f2b737d8557a5d4bf2461e
24 +DIST libxcrypt-4.4.22.tar.gz 535698 BLAKE2B 7f5e7cb19c8306edd6042834f039d2937cb606aa4f1c122591b56a705e45af72d776fd81e619dd4b10158aaef180354734bc32aea5db481ce7fa45d65f384dcb SHA512 360c5df9a8a239c8e63b5edeea4c99f451fe67c0ef3084f7659c9ad4c976486bb09328fa1e731238538d7ea05133078d4f890d11c030aaee7734ea6f4ae28b1c
25
26 diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.22.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.22.ebuild
27 new file mode 100644
28 index 00000000000..6284f32749c
29 --- /dev/null
30 +++ b/sys-libs/libxcrypt/libxcrypt-4.4.22.ebuild
31 @@ -0,0 +1,163 @@
32 +# Copyright 2004-2021 Gentoo Authors
33 +# Distributed under the terms of the GNU General Public License v2
34 +
35 +EAPI=7
36 +PYTHON_COMPAT=( python3_{7..9} )
37 +inherit autotools multibuild python-any-r1 multilib-minimal
38 +
39 +DESCRIPTION="Extended crypt library for descrypt, md5crypt, bcrypt, and others"
40 +SRC_URI="https://github.com/besser82/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
41 +HOMEPAGE="https://github.com/besser82/libxcrypt"
42 +
43 +LICENSE="LGPL-2.1+ public-domain BSD BSD-2"
44 +SLOT="0/1"
45 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
46 +IUSE="+compat split-usr +static-libs system test"
47 +
48 +DEPEND="system? (
49 + elibc_glibc? ( sys-libs/glibc[-crypt(+)] )
50 + !sys-libs/musl
51 + )"
52 +RDEPEND="${DEPEND}"
53 +BDEPEND="sys-apps/findutils
54 + test? ( $(python_gen_any_dep 'dev-python/passlib[${PYTHON_USEDEP}]') )"
55 +
56 +RESTRICT="!test? ( test )"
57 +
58 +REQUIRED_USE="split-usr? ( system )"
59 +
60 +PATCHES=(
61 + "${FILESDIR}/libxcrypt-4.4.19-multibuild.patch"
62 +)
63 +
64 +python_check_deps() {
65 + has_version -b "dev-python/passlib[${PYTHON_USEDEP}]"
66 +}
67 +
68 +pkg_setup() {
69 + MULTIBUILD_VARIANTS=(
70 + $(usex compat 'xcrypt_compat' '')
71 + xcrypt_nocompat
72 + )
73 +
74 + use test && python-any-r1_pkg_setup
75 +}
76 +
77 +src_prepare() {
78 + default
79 + eautoreconf
80 +}
81 +
82 +src_configure() {
83 + multibuild_foreach_variant multilib-minimal_src_configure
84 +}
85 +
86 +get_xclibdir() {
87 + printf -- "%s/%s/%s\n" \
88 + "$(usex split-usr '' '/usr')" \
89 + "$(get_libdir)" \
90 + "$(usex system '' 'xcrypt')"
91 +}
92 +
93 +multilib_src_configure() {
94 + local -a myconf=(
95 + --disable-werror
96 + --libdir=$(get_xclibdir)
97 + --with-pkgconfigdir=/usr/$(get_libdir)/pkgconfig
98 + --includedir="${EPREFIX}/usr/include/$(usex system '' 'xcrypt')"
99 + )
100 +
101 + case "${MULTIBUILD_ID}" in
102 + xcrypt_compat-*)
103 + myconf+=(
104 + --disable-static
105 + --disable-xcrypt-compat-files
106 + --enable-obsolete-api=yes
107 + )
108 + ;;
109 + xcrypt_nocompat-*)
110 + myconf+=(
111 + --enable-obsolete-api=no
112 + $(use_enable static-libs static)
113 + )
114 + ;;
115 + *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
116 + esac
117 +
118 + ECONF_SOURCE="${S}" econf "${myconf[@]}"
119 +}
120 +
121 +src_compile() {
122 + multibuild_foreach_variant multilib-minimal_src_compile
123 +}
124 +
125 +multilib_src_test() {
126 + emake check
127 +}
128 +
129 +src_test() {
130 + multibuild_foreach_variant multilib-minimal_src_test
131 +}
132 +
133 +src_install() {
134 + multibuild_foreach_variant multilib-minimal_src_install
135 +
136 + (
137 + shopt -s failglob || die "failglob failed"
138 +
139 + # Make sure our man pages do not collide with glibc or man-pages.
140 + for manpage in "${ED}"/usr/share/man/man3/crypt{,_r}.?*; do
141 + mv -n "${manpage}" "$(dirname "${manpage}")/xcrypt_$(basename "${manpage}")" \
142 + || die "mv failed"
143 + done
144 + ) || die "failglob error"
145 +
146 + # remove useless stuff from installation
147 + find "${D}"/usr/share/doc/${PF} -type l -delete || die
148 + find "${D}" -name '*.la' -delete || die
149 +}
150 +
151 +multilib_src_install() {
152 + emake DESTDIR="${D}" install
153 +
154 + # don't install the libcrypt.so symlink for the "compat" version
155 + case "${MULTIBUILD_ID}" in
156 + xcrypt_compat-*)
157 + rm "${D}"$(get_xclibdir)/libcrypt$(get_libname) \
158 + || die "failed to remove extra compat libraries"
159 + ;;
160 + xcrypt_nocompat-*)
161 + if use split-usr; then
162 + (
163 + if use static-libs; then
164 + # .a files are installed to /$(get_libdir) by default
165 + # move static libraries to /usr prefix or portage will abort
166 + shopt -s nullglob || die "failglob failed"
167 + static_libs=( "${ED}"/$(get_xclibdir)/*.a )
168 +
169 + if [[ -n ${static_libs[*]} ]]; then
170 + dodir "/usr/$(get_xclibdir)"
171 + mv "${static_libs[@]}" "${D}/usr/$(get_xclibdir)" \
172 + || die "moving static libs failed"
173 + fi
174 + fi
175 +
176 + if use system; then
177 + # Move versionless .so symlinks from /$(get_libdir) to /usr/$(get_libdir)
178 + # to allow linker to correctly find shared libraries.
179 + shopt -s failglob || die "failglob failed"
180 +
181 + for lib_file in "${ED}"$(get_xclibdir)/*$(get_libname); do
182 + lib_file_basename="$(basename "${lib_file}")"
183 + lib_file_target="$(basename "$(readlink -f "${lib_file}")")"
184 + dosym "../../$(get_libdir)/${lib_file_target}" "/usr/$(get_xclibdir)/${lib_file_basename}"
185 + done
186 +
187 + rm "${ED}"$(get_xclibdir)/*$(get_libname) || die "removing symlinks in incorrect location failed"
188 + fi
189 + )
190 + fi
191 + ;;
192 + *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";;
193 + esac
194 +}