1 |
commit: de0581259cb5ca594e63a28031bcbc0978739f32 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Sep 17 20:17:37 2021 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Sep 17 20:17:37 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de058125 |
7 |
|
8 |
sys-libs/libxcrypt: add 4.4.26 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
sys-libs/libxcrypt/Manifest | 1 + |
13 |
sys-libs/libxcrypt/libxcrypt-4.4.26.ebuild | 211 +++++++++++++++++++++++++++++ |
14 |
2 files changed, 212 insertions(+) |
15 |
|
16 |
diff --git a/sys-libs/libxcrypt/Manifest b/sys-libs/libxcrypt/Manifest |
17 |
index fe7f2fe9688..17af4f1fb10 100644 |
18 |
--- a/sys-libs/libxcrypt/Manifest |
19 |
+++ b/sys-libs/libxcrypt/Manifest |
20 |
@@ -1,2 +1,3 @@ |
21 |
DIST libxcrypt-4.4.20-autotools.tar.xz 628688 BLAKE2B 4c23af2a765495758e52c8e95d53d1c1d911fea011375160c4f10e468939734fcc7198cc327fafa4d5c90afa6d4c56dfe6d1b56c2c17bbc015b44cffcd7bcc8b SHA512 5b7504e9d83df12af7d11864e88d1034ed9ce0a837ef061044c5c7fe603d7f3e5613ddf20b30613a7943735120cd058f2117401d59879afcba34ce0e48ae62ee |
22 |
DIST libxcrypt-4.4.25-autotools.tar.xz 614652 BLAKE2B f0f4fbf92585fdd8d328aaa68811ea15bdf75778363ea4bc46a75fb76bb065f044708446d655356ebbf2834f8b14bac40fbe700b510b09ce101f750667a04298 SHA512 30f38a54c8e5cbd31c463223913079f9869d38ed38a2f64c57778ac4cf1b6f557caa527073df54ca8396bb7220807b84afcae2f9790f6604af1561a4b277874e |
23 |
+DIST libxcrypt-4.4.26-autotools.tar.xz 617808 BLAKE2B 9fb8e31b22a085c0d0d5ab2ee3fb69fbebaccee2281e9be7d745218b5b92d949ffd3aa9c385671d58c93a654e16b943a33284b0b4737d52d26e43e2f7840fe74 SHA512 22c72cacd87c5751c4160413738fdf52c8fee300dcad01b289a6eaf892439883b9478103f791f5f53c8e5e2f2dd81057e5fda45e7cf7fdfd3ba93dd811bc01e3 |
24 |
|
25 |
diff --git a/sys-libs/libxcrypt/libxcrypt-4.4.26.ebuild b/sys-libs/libxcrypt/libxcrypt-4.4.26.ebuild |
26 |
new file mode 100644 |
27 |
index 00000000000..0124869d552 |
28 |
--- /dev/null |
29 |
+++ b/sys-libs/libxcrypt/libxcrypt-4.4.26.ebuild |
30 |
@@ -0,0 +1,211 @@ |
31 |
+# Copyright 2004-2021 Gentoo Authors |
32 |
+# Distributed under the terms of the GNU General Public License v2 |
33 |
+ |
34 |
+EAPI=7 |
35 |
+ |
36 |
+PYTHON_COMPAT=( python3_{8..10} ) |
37 |
+# NEED_BOOTSTRAP is for developers to quickly generate a tarball |
38 |
+# for publishing to the tree. |
39 |
+NEED_BOOTSTRAP="no" |
40 |
+inherit multibuild multilib python-any-r1 multilib-minimal |
41 |
+ |
42 |
+DESCRIPTION="Extended crypt library for descrypt, md5crypt, bcrypt, and others" |
43 |
+HOMEPAGE="https://github.com/besser82/libxcrypt" |
44 |
+if [[ ${NEED_BOOTSTRAP} == "yes" ]] ; then |
45 |
+ inherit autotools |
46 |
+ SRC_URI="https://github.com/besser82/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz" |
47 |
+else |
48 |
+ SRC_URI="https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-autotools.tar.xz" |
49 |
+fi |
50 |
+ |
51 |
+LICENSE="LGPL-2.1+ public-domain BSD BSD-2" |
52 |
+SLOT="0/1" |
53 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" |
54 |
+IUSE="+compat split-usr +static-libs system test" |
55 |
+REQUIRED_USE="split-usr? ( system )" |
56 |
+RESTRICT="!test? ( test )" |
57 |
+ |
58 |
+DEPEND="system? ( |
59 |
+ elibc_glibc? ( |
60 |
+ sys-libs/glibc[-crypt(+)] |
61 |
+ !sys-libs/glibc[crypt(+)] |
62 |
+ ) |
63 |
+ !sys-libs/musl |
64 |
+ ) |
65 |
+" |
66 |
+RDEPEND="${DEPEND}" |
67 |
+BDEPEND="dev-lang/perl |
68 |
+ sys-apps/findutils |
69 |
+ test? ( $(python_gen_any_dep 'dev-python/passlib[${PYTHON_USEDEP}]') )" |
70 |
+ |
71 |
+python_check_deps() { |
72 |
+ has_version -b "dev-python/passlib[${PYTHON_USEDEP}]" |
73 |
+} |
74 |
+ |
75 |
+pkg_setup() { |
76 |
+ MULTIBUILD_VARIANTS=( |
77 |
+ $(usex compat 'xcrypt_compat' '') |
78 |
+ xcrypt_nocompat |
79 |
+ ) |
80 |
+ |
81 |
+ use test && python-any-r1_pkg_setup |
82 |
+} |
83 |
+ |
84 |
+src_prepare() { |
85 |
+ default |
86 |
+ |
87 |
+ # WARNING: Please read on bumping or applying patches! |
88 |
+ # |
89 |
+ # There are two circular dependencies to be aware of: |
90 |
+ # 1) |
91 |
+ # if we're bootstrapping configure and makefiles: |
92 |
+ # libxcrypt -> automake -> perl -> libxcrypt |
93 |
+ # |
94 |
+ # mitigation: |
95 |
+ # toolchain@ manually runs `make dist` after running autoconf + `./configure` |
96 |
+ # and the ebuild uses that. |
97 |
+ # (Don't include the pre-generated Perl artefacts.) |
98 |
+ # |
99 |
+ # solution for future: |
100 |
+ # Upstream are working on producing `make dist` tarballs. |
101 |
+ # https://github.com/besser82/libxcrypt/issues/134#issuecomment-871833573 |
102 |
+ # |
103 |
+ # 2) |
104 |
+ # configure *unconditionally* needs Perl at build time to generate |
105 |
+ # a list of enabled algorithms based on the set passed to `configure`: |
106 |
+ # libxcrypt -> perl -> libxcrypt |
107 |
+ # |
108 |
+ # mitigation: |
109 |
+ # None at the moment. |
110 |
+ # |
111 |
+ # solution for future: |
112 |
+ # Not possible right now. Upstream intend on depending on Perl for further |
113 |
+ # configuration options. |
114 |
+ # https://github.com/besser82/libxcrypt/issues/134#issuecomment-871833573 |
115 |
+ # |
116 |
+ # Therefore, on changes (inc. bumps): |
117 |
+ # * You must check whether upstream have started providing tarballs with bootstrapped |
118 |
+ # auto{conf,make}; |
119 |
+ # |
120 |
+ # * diff the build system changes! |
121 |
+ # |
122 |
+ if [[ ${NEED_BOOTSTRAP} == "yes" ]] ; then |
123 |
+ # Facilitate our split variant build for compat + non-compat |
124 |
+ eapply "${FILESDIR}"/${PN}-4.4.19-multibuild.patch |
125 |
+ eautoreconf |
126 |
+ fi |
127 |
+} |
128 |
+ |
129 |
+src_configure() { |
130 |
+ multibuild_foreach_variant multilib-minimal_src_configure |
131 |
+} |
132 |
+ |
133 |
+get_xclibdir() { |
134 |
+ printf -- "%s/%s/%s\n" \ |
135 |
+ "$(usex split-usr '' '/usr')" \ |
136 |
+ "$(get_libdir)" \ |
137 |
+ "$(usex system '' 'xcrypt')" |
138 |
+} |
139 |
+ |
140 |
+multilib_src_configure() { |
141 |
+ local -a myconf=( |
142 |
+ --disable-werror |
143 |
+ --libdir="${EPREFIX}"$(get_xclibdir) |
144 |
+ --with-pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig" |
145 |
+ --includedir="${EPREFIX}/usr/include/$(usex system '' 'xcrypt')" |
146 |
+ ) |
147 |
+ |
148 |
+ case "${MULTIBUILD_ID}" in |
149 |
+ xcrypt_compat-*) |
150 |
+ myconf+=( |
151 |
+ --disable-static |
152 |
+ --disable-xcrypt-compat-files |
153 |
+ --enable-obsolete-api=yes |
154 |
+ ) |
155 |
+ ;; |
156 |
+ xcrypt_nocompat-*) |
157 |
+ myconf+=( |
158 |
+ --enable-obsolete-api=no |
159 |
+ $(use_enable static-libs static) |
160 |
+ ) |
161 |
+ ;; |
162 |
+ *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";; |
163 |
+ esac |
164 |
+ |
165 |
+ ECONF_SOURCE="${S}" econf "${myconf[@]}" |
166 |
+} |
167 |
+ |
168 |
+src_compile() { |
169 |
+ multibuild_foreach_variant multilib-minimal_src_compile |
170 |
+} |
171 |
+ |
172 |
+multilib_src_test() { |
173 |
+ emake check |
174 |
+} |
175 |
+ |
176 |
+src_test() { |
177 |
+ multibuild_foreach_variant multilib-minimal_src_test |
178 |
+} |
179 |
+ |
180 |
+src_install() { |
181 |
+ multibuild_foreach_variant multilib-minimal_src_install |
182 |
+ |
183 |
+ ( |
184 |
+ shopt -s failglob || die "failglob failed" |
185 |
+ |
186 |
+ # Make sure our man pages do not collide with glibc or man-pages. |
187 |
+ for manpage in "${ED}"/usr/share/man/man3/crypt{,_r}.?*; do |
188 |
+ mv -n "${manpage}" "$(dirname "${manpage}")/xcrypt_$(basename "${manpage}")" \ |
189 |
+ || die "mv failed" |
190 |
+ done |
191 |
+ ) || die "failglob error" |
192 |
+ |
193 |
+ # Remove useless stuff from installation |
194 |
+ find "${ED}"/usr/share/doc/${PF} -type l -delete || die |
195 |
+ find "${ED}" -name '*.la' -delete || die |
196 |
+} |
197 |
+ |
198 |
+multilib_src_install() { |
199 |
+ emake DESTDIR="${D}" install |
200 |
+ |
201 |
+ # Don't install the libcrypt.so symlink for the "compat" version |
202 |
+ case "${MULTIBUILD_ID}" in |
203 |
+ xcrypt_compat-*) |
204 |
+ rm "${ED}"$(get_xclibdir)/libcrypt$(get_libname) \ |
205 |
+ || die "failed to remove extra compat libraries" |
206 |
+ ;; |
207 |
+ xcrypt_nocompat-*) |
208 |
+ if use split-usr; then |
209 |
+ ( |
210 |
+ if use static-libs; then |
211 |
+ # .a files are installed to /$(get_libdir) by default |
212 |
+ # Move static libraries to /usr prefix or portage will abort |
213 |
+ shopt -s nullglob || die "failglob failed" |
214 |
+ static_libs=( "${ED}"/$(get_xclibdir)/*.a ) |
215 |
+ |
216 |
+ if [[ -n ${static_libs[*]} ]]; then |
217 |
+ dodir "/usr/$(get_xclibdir)" |
218 |
+ mv "${static_libs[@]}" "${ED}/usr/$(get_xclibdir)" \ |
219 |
+ || die "Moving static libs failed" |
220 |
+ fi |
221 |
+ fi |
222 |
+ |
223 |
+ if use system; then |
224 |
+ # Move versionless .so symlinks from /$(get_libdir) to /usr/$(get_libdir) |
225 |
+ # to allow linker to correctly find shared libraries. |
226 |
+ shopt -s failglob || die "failglob failed" |
227 |
+ |
228 |
+ for lib_file in "${ED}"$(get_xclibdir)/*$(get_libname); do |
229 |
+ lib_file_basename="$(basename "${lib_file}")" |
230 |
+ lib_file_target="$(basename "$(readlink -f "${lib_file}")")" |
231 |
+ dosym "../../$(get_libdir)/${lib_file_target}" "/usr/$(get_xclibdir)/${lib_file_basename}" |
232 |
+ done |
233 |
+ |
234 |
+ rm "${ED}"$(get_xclibdir)/*$(get_libname) || die "Removing symlinks in incorrect location failed" |
235 |
+ fi |
236 |
+ ) |
237 |
+ fi |
238 |
+ ;; |
239 |
+ *) die "Unexpected MULTIBUILD_ID: ${MULTIBUILD_ID}";; |
240 |
+ esac |
241 |
+} |