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