1 |
commit: 7e632979a0b254e614aa01535860907eee6902cb |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 16 11:23:32 2021 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 16 11:34:02 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7e632979 |
7 |
|
8 |
dev-libs/nss: bump to v3.64 |
9 |
|
10 |
Package-Manager: Portage-3.0.18, Repoman-3.0.3 |
11 |
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> |
12 |
|
13 |
dev-libs/nss/Manifest | 1 + |
14 |
dev-libs/nss/nss-3.64.ebuild | 357 +++++++++++++++++++++++++++++++++++++++++++ |
15 |
2 files changed, 358 insertions(+) |
16 |
|
17 |
diff --git a/dev-libs/nss/Manifest b/dev-libs/nss/Manifest |
18 |
index 6d44c3bca5b..eb9a177cd00 100644 |
19 |
--- a/dev-libs/nss/Manifest |
20 |
+++ b/dev-libs/nss/Manifest |
21 |
@@ -1,2 +1,3 @@ |
22 |
DIST nss-3.63.1.tar.gz 82166899 BLAKE2B a3c1939d16dcb083fae819659c0a61ff1d4dab70c8a7fc4b176a391bf7cd22eae1c93c85533b6af15e1c1cd9fb6b007380741e0b1670f3891f298ffa1b309284 SHA512 62d1bc161fc8eea6be191dc23ec42042a2626e119b7329f6449cf78729775776fd8e9faebd0457c2413684c15be6e10722ee4a7087c7c3e103fe993f3acec730 |
23 |
+DIST nss-3.64.tar.gz 82173054 BLAKE2B 4786a1ff6f4e47dbb6bfef6a2bc47ffeac51aa37f12168872d23799b8d6ca440578acf512e9ec7563ef64331d3fd84c387f17e41afa2ee30d8623c6f66207631 SHA512 0a85e1f64f97670f70596d8a479693939ca454025a4b3bbd557a54ed683ffed625c670fef6a6e3440365af9aa472384f84464942381b1c093659f6a6a222ba04 |
24 |
DIST nss-cacert-class1-class3-r1.patch 22503 BLAKE2B d2ba6b5c3675484dab5b6709478101a9dadc0baded3dbf891dcd04e5eb912079b87cdd17f893a0f539a2a53fb05357c6dd309fb624facac3b021c82c7424a91f SHA512 68906d2442986ad13ebf9cd97c26fac34af3efd5cfaacb3d7824adad966349ad796c9cec8dec44c46d5c571df88ce83aea02ce82e71da337aa4e1aeef58eda66 |
25 |
|
26 |
diff --git a/dev-libs/nss/nss-3.64.ebuild b/dev-libs/nss/nss-3.64.ebuild |
27 |
new file mode 100644 |
28 |
index 00000000000..f05b462f30d |
29 |
--- /dev/null |
30 |
+++ b/dev-libs/nss/nss-3.64.ebuild |
31 |
@@ -0,0 +1,357 @@ |
32 |
+# Copyright 1999-2021 Gentoo Authors |
33 |
+# Distributed under the terms of the GNU General Public License v2 |
34 |
+ |
35 |
+EAPI=7 |
36 |
+ |
37 |
+inherit flag-o-matic multilib toolchain-funcs multilib-minimal |
38 |
+ |
39 |
+NSPR_VER="4.29" |
40 |
+RTM_NAME="NSS_${PV//./_}_RTM" |
41 |
+ |
42 |
+DESCRIPTION="Mozilla's Network Security Services library that implements PKI support" |
43 |
+HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS" |
44 |
+SRC_URI="https://archive.mozilla.org/pub/security/nss/releases/${RTM_NAME}/src/${P}.tar.gz |
45 |
+ cacert? ( https://dev.gentoo.org/~whissi/dist/ca-certificates/nss-cacert-class1-class3-r1.patch )" |
46 |
+ |
47 |
+LICENSE="|| ( MPL-2.0 GPL-2 LGPL-2.1 )" |
48 |
+SLOT="0" |
49 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~x64-solaris ~x86-solaris" |
50 |
+IUSE="cacert utils" |
51 |
+# pkg-config called by nss-config -> virtual/pkgconfig in RDEPEND |
52 |
+RDEPEND=" |
53 |
+ >=dev-libs/nspr-${NSPR_VER}[${MULTILIB_USEDEP}] |
54 |
+ >=dev-db/sqlite-3.8.2[${MULTILIB_USEDEP}] |
55 |
+ >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] |
56 |
+ virtual/pkgconfig |
57 |
+" |
58 |
+DEPEND="${RDEPEND}" |
59 |
+ |
60 |
+RESTRICT="test" |
61 |
+ |
62 |
+S="${WORKDIR}/${P}/${PN}" |
63 |
+ |
64 |
+MULTILIB_CHOST_TOOLS=( |
65 |
+ /usr/bin/nss-config |
66 |
+) |
67 |
+ |
68 |
+PATCHES=( |
69 |
+ # Custom changes for gentoo |
70 |
+ "${FILESDIR}/${PN}-3.53-gentoo-fixups.patch" |
71 |
+ "${FILESDIR}/${PN}-3.21-gentoo-fixup-warnings.patch" |
72 |
+ "${FILESDIR}/${PN}-3.23-hppa-byte_order.patch" |
73 |
+) |
74 |
+ |
75 |
+src_prepare() { |
76 |
+ default |
77 |
+ |
78 |
+ if use cacert ; then |
79 |
+ eapply -p2 "${DISTDIR}"/nss-cacert-class1-class3-r1.patch |
80 |
+ fi |
81 |
+ |
82 |
+ pushd coreconf >/dev/null || die |
83 |
+ # hack nspr paths |
84 |
+ echo 'INCLUDES += -I$(DIST)/include/dbm' \ |
85 |
+ >> headers.mk || die "failed to append include" |
86 |
+ |
87 |
+ # modify install path |
88 |
+ sed -e '/CORE_DEPTH/s:SOURCE_PREFIX.*$:SOURCE_PREFIX = $(CORE_DEPTH)/dist:' \ |
89 |
+ -i source.mk || die |
90 |
+ |
91 |
+ # Respect LDFLAGS |
92 |
+ sed -i -e 's/\$(MKSHLIB) -o/\$(MKSHLIB) \$(LDFLAGS) -o/g' rules.mk |
93 |
+ popd >/dev/null || die |
94 |
+ |
95 |
+ # Fix pkgconfig file for Prefix |
96 |
+ sed -i -e "/^PREFIX =/s:= /usr:= ${EPREFIX}/usr:" \ |
97 |
+ config/Makefile || die |
98 |
+ |
99 |
+ # use host shlibsign if need be #436216 |
100 |
+ if tc-is-cross-compiler ; then |
101 |
+ sed -i \ |
102 |
+ -e 's:"${2}"/shlibsign:shlibsign:' \ |
103 |
+ cmd/shlibsign/sign.sh || die |
104 |
+ fi |
105 |
+ |
106 |
+ # dirty hack |
107 |
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \ |
108 |
+ lib/ssl/config.mk || die |
109 |
+ sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../../lib/freebl/\$(OBJDIR):" \ |
110 |
+ cmd/platlibs.mk || die |
111 |
+ |
112 |
+ multilib_copy_sources |
113 |
+ |
114 |
+ strip-flags |
115 |
+} |
116 |
+ |
117 |
+multilib_src_configure() { |
118 |
+ # Ensure we stay multilib aware |
119 |
+ sed -i -e "/@libdir@/ s:lib64:$(get_libdir):" config/Makefile || die |
120 |
+} |
121 |
+ |
122 |
+nssarch() { |
123 |
+ # Most of the arches are the same as $ARCH |
124 |
+ local t=${1:-${CHOST}} |
125 |
+ case ${t} in |
126 |
+ *86*-pc-solaris2*) echo "i86pc" ;; |
127 |
+ aarch64*) echo "aarch64" ;; |
128 |
+ hppa*) echo "parisc" ;; |
129 |
+ i?86*) echo "i686" ;; |
130 |
+ x86_64*) echo "x86_64" ;; |
131 |
+ *) tc-arch ${t} ;; |
132 |
+ esac |
133 |
+} |
134 |
+ |
135 |
+nssbits() { |
136 |
+ local cc cppflags="${1}CPPFLAGS" cflags="${1}CFLAGS" |
137 |
+ if [[ ${1} == BUILD_ ]]; then |
138 |
+ cc=$(tc-getBUILD_CC) |
139 |
+ else |
140 |
+ cc=$(tc-getCC) |
141 |
+ fi |
142 |
+ echo > "${T}"/test.c || die |
143 |
+ ${cc} ${!cppflags} ${!cflags} -c "${T}"/test.c -o "${T}/${1}test.o" || die |
144 |
+ case $(file "${T}/${1}test.o") in |
145 |
+ *32-bit*x86-64*) echo USE_X32=1;; |
146 |
+ *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;; |
147 |
+ *32-bit*|*ppc*|*i386*) ;; |
148 |
+ *) die "Failed to detect whether ${cc} builds 64bits or 32bits, disable distcc if you're using it, please";; |
149 |
+ esac |
150 |
+} |
151 |
+ |
152 |
+multilib_src_compile() { |
153 |
+ # use ABI to determine bit'ness, or fallback if unset |
154 |
+ local buildbits mybits |
155 |
+ case "${ABI}" in |
156 |
+ n32) mybits="USE_N32=1";; |
157 |
+ x32) mybits="USE_X32=1";; |
158 |
+ s390x|*64) mybits="USE_64=1";; |
159 |
+ ${DEFAULT_ABI}) |
160 |
+ einfo "Running compilation test to determine bit'ness" |
161 |
+ mybits=$(nssbits) |
162 |
+ ;; |
163 |
+ esac |
164 |
+ # bitness of host may differ from target |
165 |
+ if tc-is-cross-compiler; then |
166 |
+ buildbits=$(nssbits BUILD_) |
167 |
+ fi |
168 |
+ |
169 |
+ local makeargs=( |
170 |
+ CC="$(tc-getCC)" |
171 |
+ CCC="$(tc-getCXX)" |
172 |
+ AR="$(tc-getAR) rc \$@" |
173 |
+ RANLIB="$(tc-getRANLIB)" |
174 |
+ OPTIMIZER= |
175 |
+ ${mybits} |
176 |
+ ) |
177 |
+ |
178 |
+ # Take care of nspr settings #436216 |
179 |
+ local myCPPFLAGS="${CPPFLAGS} $($(tc-getPKG_CONFIG) nspr --cflags)" |
180 |
+ unset NSPR_INCLUDE_DIR |
181 |
+ |
182 |
+ export NSS_ALLOW_SSLKEYLOGFILE=1 |
183 |
+ export NSS_ENABLE_WERROR=0 #567158 |
184 |
+ export BUILD_OPT=1 |
185 |
+ export NSS_USE_SYSTEM_SQLITE=1 |
186 |
+ export NSDISTMODE=copy |
187 |
+ export FREEBL_NO_DEPEND=1 |
188 |
+ export FREEBL_LOWHASH=1 |
189 |
+ export NSS_SEED_ONLY_DEV_URANDOM=1 |
190 |
+ export USE_SYSTEM_ZLIB=1 |
191 |
+ export ZLIB_LIBS=-lz |
192 |
+ export ASFLAGS="" |
193 |
+ # Fix build failure on arm64 |
194 |
+ export NS_USE_GCC=1 |
195 |
+ # Detect compiler type and set proper environment value |
196 |
+ if tc-is-gcc; then |
197 |
+ export CC_IS_GCC=1 |
198 |
+ elif tc-is-clang; then |
199 |
+ export CC_IS_CLANG=1 |
200 |
+ fi |
201 |
+ |
202 |
+ local d |
203 |
+ |
204 |
+ # Build the host tools first. |
205 |
+ LDFLAGS="${BUILD_LDFLAGS}" \ |
206 |
+ XCFLAGS="${BUILD_CFLAGS}" \ |
207 |
+ NSPR_LIB_DIR="${T}/fakedir" \ |
208 |
+ emake -j1 -C coreconf \ |
209 |
+ CC="$(tc-getBUILD_CC)" \ |
210 |
+ ${buildbits-${mybits}} |
211 |
+ makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" ) |
212 |
+ |
213 |
+ # Then build the target tools. |
214 |
+ for d in . lib/dbm ; do |
215 |
+ CPPFLAGS="${myCPPFLAGS}" \ |
216 |
+ XCFLAGS="${CFLAGS} ${CPPFLAGS}" \ |
217 |
+ NSPR_LIB_DIR="${T}/fakedir" \ |
218 |
+ emake -j1 "${makeargs[@]}" -C ${d} OS_TEST="$(nssarch)" |
219 |
+ done |
220 |
+} |
221 |
+ |
222 |
+# Altering these 3 libraries breaks the CHK verification. |
223 |
+# All of the following cause it to break: |
224 |
+# - stripping |
225 |
+# - prelink |
226 |
+# - ELF signing |
227 |
+# http://www.mozilla.org/projects/security/pki/nss/tech-notes/tn6.html |
228 |
+# Either we have to NOT strip them, or we have to forcibly resign after |
229 |
+# stripping. |
230 |
+#local_libdir="$(get_libdir)" |
231 |
+#export STRIP_MASK=" |
232 |
+# */${local_libdir}/libfreebl3.so* |
233 |
+# */${local_libdir}/libnssdbm3.so* |
234 |
+# */${local_libdir}/libsoftokn3.so*" |
235 |
+ |
236 |
+export NSS_CHK_SIGN_LIBS="freebl3 nssdbm3 softokn3" |
237 |
+ |
238 |
+generate_chk() { |
239 |
+ local shlibsign="$1" |
240 |
+ local libdir="$2" |
241 |
+ einfo "Resigning core NSS libraries for FIPS validation" |
242 |
+ shift 2 |
243 |
+ local i |
244 |
+ for i in ${NSS_CHK_SIGN_LIBS} ; do |
245 |
+ local libname=lib${i}.so |
246 |
+ local chkname=lib${i}.chk |
247 |
+ "${shlibsign}" \ |
248 |
+ -i "${libdir}"/${libname} \ |
249 |
+ -o "${libdir}"/${chkname}.tmp \ |
250 |
+ && mv -f \ |
251 |
+ "${libdir}"/${chkname}.tmp \ |
252 |
+ "${libdir}"/${chkname} \ |
253 |
+ || die "Failed to sign ${libname}" |
254 |
+ done |
255 |
+} |
256 |
+ |
257 |
+cleanup_chk() { |
258 |
+ local libdir="$1" |
259 |
+ shift 1 |
260 |
+ local i |
261 |
+ for i in ${NSS_CHK_SIGN_LIBS} ; do |
262 |
+ local libfname="${libdir}/lib${i}.so" |
263 |
+ # If the major version has changed, then we have old chk files. |
264 |
+ [ ! -f "${libfname}" -a -f "${libfname}.chk" ] \ |
265 |
+ && rm -f "${libfname}.chk" |
266 |
+ done |
267 |
+} |
268 |
+ |
269 |
+multilib_src_install() { |
270 |
+ pushd dist >/dev/null || die |
271 |
+ |
272 |
+ dodir /usr/$(get_libdir) |
273 |
+ cp -L */lib/*$(get_libname) "${ED}"/usr/$(get_libdir) || die "copying shared libs failed" |
274 |
+ local i |
275 |
+ for i in crmf freebl nssb nssckfw ; do |
276 |
+ cp -L */lib/lib${i}.a "${ED}"/usr/$(get_libdir) || die "copying libs failed" |
277 |
+ done |
278 |
+ |
279 |
+ # Install nss-config and pkgconfig file |
280 |
+ dodir /usr/bin |
281 |
+ cp -L */bin/nss-config "${ED}"/usr/bin || die |
282 |
+ dodir /usr/$(get_libdir)/pkgconfig |
283 |
+ cp -L */lib/pkgconfig/nss.pc "${ED}"/usr/$(get_libdir)/pkgconfig || die |
284 |
+ |
285 |
+ # create an nss-softokn.pc from nss.pc for libfreebl and some private headers |
286 |
+ # bug 517266 |
287 |
+ sed -e 's#Libs:#Libs: -lfreebl#' \ |
288 |
+ -e 's#Cflags:#Cflags: -I${includedir}/private#' \ |
289 |
+ */lib/pkgconfig/nss.pc >"${ED}"/usr/$(get_libdir)/pkgconfig/nss-softokn.pc \ |
290 |
+ || die "could not create nss-softokn.pc" |
291 |
+ |
292 |
+ # all the include files |
293 |
+ insinto /usr/include/nss |
294 |
+ doins public/nss/*.{h,api} |
295 |
+ insinto /usr/include/nss/private |
296 |
+ doins private/nss/{blapi,alghmac,cmac}.h |
297 |
+ |
298 |
+ popd >/dev/null || die |
299 |
+ |
300 |
+ local f nssutils |
301 |
+ # Always enabled because we need it for chk generation. |
302 |
+ nssutils=( shlibsign ) |
303 |
+ |
304 |
+ if multilib_is_native_abi ; then |
305 |
+ if use utils; then |
306 |
+ # The tests we do not need to install. |
307 |
+ #nssutils_test="bltest crmftest dbtest dertimetest |
308 |
+ #fipstest remtest sdrtest" |
309 |
+ # checkcert utils has been removed in nss-3.22: |
310 |
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1187545 |
311 |
+ # https://hg.mozilla.org/projects/nss/rev/df1729d37870 |
312 |
+ # certcgi has been removed in nss-3.36: |
313 |
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=1426602 |
314 |
+ nssutils+=( |
315 |
+ addbuiltin |
316 |
+ atob |
317 |
+ baddbdir |
318 |
+ btoa |
319 |
+ certutil |
320 |
+ cmsutil |
321 |
+ conflict |
322 |
+ crlutil |
323 |
+ derdump |
324 |
+ digest |
325 |
+ makepqg |
326 |
+ mangle |
327 |
+ modutil |
328 |
+ multinit |
329 |
+ nonspr10 |
330 |
+ ocspclnt |
331 |
+ oidcalc |
332 |
+ p7content |
333 |
+ p7env |
334 |
+ p7sign |
335 |
+ p7verify |
336 |
+ pk11mode |
337 |
+ pk12util |
338 |
+ pp |
339 |
+ rsaperf |
340 |
+ selfserv |
341 |
+ signtool |
342 |
+ signver |
343 |
+ ssltap |
344 |
+ strsclnt |
345 |
+ symkeyutil |
346 |
+ tstclnt |
347 |
+ vfychain |
348 |
+ vfyserv |
349 |
+ ) |
350 |
+ # install man-pages for utils (bug #516810) |
351 |
+ doman doc/nroff/*.1 |
352 |
+ fi |
353 |
+ pushd dist/*/bin >/dev/null || die |
354 |
+ for f in ${nssutils[@]}; do |
355 |
+ dobin ${f} |
356 |
+ done |
357 |
+ popd >/dev/null || die |
358 |
+ fi |
359 |
+ |
360 |
+ # Prelink breaks the CHK files. We don't have any reliable way to run |
361 |
+ # shlibsign after prelink. |
362 |
+ dodir /etc/prelink.conf.d |
363 |
+ printf -- "-b ${EPREFIX}/usr/$(get_libdir)/lib%s.so\n" ${NSS_CHK_SIGN_LIBS} \ |
364 |
+ > "${ED}"/etc/prelink.conf.d/nss.conf |
365 |
+} |
366 |
+ |
367 |
+pkg_postinst() { |
368 |
+ multilib_pkg_postinst() { |
369 |
+ # We must re-sign the libraries AFTER they are stripped. |
370 |
+ local shlibsign="${EROOT}/usr/bin/shlibsign" |
371 |
+ # See if we can execute it (cross-compiling & such). #436216 |
372 |
+ "${shlibsign}" -h >&/dev/null |
373 |
+ if [[ $? -gt 1 ]] ; then |
374 |
+ shlibsign="shlibsign" |
375 |
+ fi |
376 |
+ generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir) |
377 |
+ } |
378 |
+ |
379 |
+ multilib_foreach_abi multilib_pkg_postinst |
380 |
+} |
381 |
+ |
382 |
+pkg_postrm() { |
383 |
+ multilib_pkg_postrm() { |
384 |
+ cleanup_chk "${EROOT}"/usr/$(get_libdir) |
385 |
+ } |
386 |
+ |
387 |
+ multilib_foreach_abi multilib_pkg_postrm |
388 |
+} |