summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss_3.49.1.bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2020-01-20 18:24:51 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-01-21 12:52:52 +0000
commit2de469f312fb503501a0315abc620c47d03ffa56 (patch)
tree18c49ecfcd39783617d6dd1c31e97bd84ec6b4ac /meta/recipes-support/nss/nss_3.49.1.bb
parent962e7e9bc4b9a57d2a53ce8129faba2a0825aad6 (diff)
downloadpoky-2de469f312fb503501a0315abc620c47d03ffa56.tar.gz
nss: update to 3.49.1
Drop a backport, and a patch that causes build errors with the new version. Add a patch to make ARM HW crypto optional; upstream for some reason does not allow disabling it. (From OE-Core rev: 73a1536a7e2fd5dad7d6855ac5e94f87890a1b95) Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/nss/nss_3.49.1.bb')
-rw-r--r--meta/recipes-support/nss/nss_3.49.1.bb271
1 files changed, 271 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss_3.49.1.bb b/meta/recipes-support/nss/nss_3.49.1.bb
new file mode 100644
index 0000000000..94f4b88fa5
--- /dev/null
+++ b/meta/recipes-support/nss/nss_3.49.1.bb
@@ -0,0 +1,271 @@
1SUMMARY = "Mozilla's SSL and TLS implementation"
2DESCRIPTION = "Network Security Services (NSS) is a set of libraries \
3designed to support cross-platform development of \
4security-enabled client and server applications. \
5Applications built with NSS can support SSL v2 and v3, \
6TLS, PKCS 5, PKCS 7, PKCS 11, PKCS 12, S/MIME, X.509 \
7v3 certificates, and other security standards."
8HOMEPAGE = "http://www.mozilla.org/projects/security/pki/nss/"
9SECTION = "libs"
10
11DEPENDS = "sqlite3 nspr zlib nss-native"
12DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
13
14LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
15
16LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
17 file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
18 file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
19
20VERSION_DIR = "${@d.getVar('BP').upper().replace('-', '_').replace('.', '_') + '_RTM'}"
21
22SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSION_DIR}/src/${BP}.tar.gz \
23 file://nss.pc.in \
24 file://signlibs.sh \
25 file://0001-nss-fix-support-cross-compiling.patch \
26 file://nss-no-rpath-for-cross-compiling.patch \
27 file://nss-fix-incorrect-shebang-of-perl.patch \
28 file://disable-Wvarargs-with-clang.patch \
29 file://pqg.c-ULL_addend.patch \
30 file://blank-cert9.db \
31 file://blank-key4.db \
32 file://system-pkcs11.txt \
33 file://nss-fix-nsinstall-build.patch \
34 file://0001-freebl-add-a-configure-option-to-disable-ARM-HW-cryp.patch \
35 "
36
37SRC_URI[md5sum] = "6b92ac02dcf9e9e44df5390f6814c157"
38SRC_URI[sha256sum] = "d9aa42e49e02bb0dc0a2f164604cfc718e11a2a06ddb266cd676376ac21b026e"
39
40UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
41UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
42
43inherit siteinfo
44
45TD = "${S}/tentative-dist"
46TDS = "${S}/tentative-dist-staging"
47
48TARGET_CC_ARCH += "${LDFLAGS}"
49
50do_configure_prepend_libc-musl () {
51 sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
52}
53
54do_compile_prepend_class-native() {
55 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
56 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
57 export NSS_ENABLE_WERROR=0
58}
59
60do_compile_prepend_class-nativesdk() {
61 export LDFLAGS=""
62}
63
64do_compile_prepend_class-native() {
65 # Need to set RPATH so that chrpath will do its job correctly
66 RPATH="-Wl,-rpath-link,${STAGING_LIBDIR_NATIVE} -Wl,-rpath-link,${STAGING_BASE_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_LIBDIR_NATIVE} -Wl,-rpath,${STAGING_BASE_LIBDIR_NATIVE}"
67}
68
69do_compile() {
70 export CROSS_COMPILE=1
71 export NATIVE_CC="${BUILD_CC}"
72 # Additional defines needed on Centos 7
73 export NATIVE_FLAGS="${BUILD_CFLAGS} -DLINUX -Dlinux"
74 export BUILD_OPT=1
75
76 export FREEBL_NO_DEPEND=1
77 export FREEBL_LOWHASH=1
78
79 export LIBDIR=${libdir}
80 export MOZILLA_CLIENT=1
81 export NS_USE_GCC=1
82 export NSS_USE_SYSTEM_SQLITE=1
83 export NSS_ENABLE_ECC=1
84
85 ${@bb.utils.contains("TUNE_FEATURES", "crypto", "export NSS_USE_ARM_HW_CRYPTO=1", "", d)}
86
87 export OS_RELEASE=3.4
88 export OS_TARGET=Linux
89 export OS_ARCH=Linux
90
91 if [ "${TARGET_ARCH}" = "powerpc" ]; then
92 OS_TEST=ppc
93 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
94 OS_TEST=ppc64
95 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
96 OS_TEST=mips
97 elif [ "${TARGET_ARCH}" = "aarch64_be" ]; then
98 OS_TEST="aarch64"
99 else
100 OS_TEST="${TARGET_ARCH}"
101 fi
102
103 if [ "${SITEINFO_BITS}" = "64" ]; then
104 export USE_64=1
105 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
106 export USE_X32=1
107 fi
108
109 export NSS_DISABLE_GTESTS=1
110
111 # We can modify CC in the environment, but if we set it via an
112 # argument to make, nsinstall, a host program, will also build with it!
113 #
114 # nss pretty much does its own thing with CFLAGS, so we put them into CC.
115 # Optimization will get clobbered, but most of the stuff will survive.
116 # The motivation for this is to point to the correct place for debug
117 # source files and CFLAGS does that. Nothing uses CCC.
118 #
119 export CC="${CC} ${CFLAGS}"
120 make -C ./nss CCC="${CXX} -g" \
121 OS_TEST=${OS_TEST} \
122 RPATH="${RPATH}"
123}
124
125do_compile[vardepsexclude] += "SITEINFO_BITS"
126
127do_install_prepend_class-nativesdk() {
128 export LDFLAGS=""
129}
130
131do_install() {
132 export CROSS_COMPILE=1
133 export NATIVE_CC="${BUILD_CC}"
134 export BUILD_OPT=1
135
136 export FREEBL_NO_DEPEND=1
137
138 export LIBDIR=${libdir}
139 export MOZILLA_CLIENT=1
140 export NS_USE_GCC=1
141 export NSS_USE_SYSTEM_SQLITE=1
142 export NSS_ENABLE_ECC=1
143
144 export OS_RELEASE=3.4
145 export OS_TARGET=Linux
146 export OS_ARCH=Linux
147
148 if [ "${TARGET_ARCH}" = "powerpc" ]; then
149 OS_TEST=ppc
150 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
151 OS_TEST=ppc64
152 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
153 OS_TEST=mips
154 elif [ "${TARGET_ARCH}" = "aarch64_be" ]; then
155 CPU_ARCH=aarch64
156 OS_TEST="aarch64"
157 else
158 OS_TEST="${TARGET_ARCH}"
159 fi
160 if [ "${SITEINFO_BITS}" = "64" ]; then
161 export USE_64=1
162 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
163 export USE_X32=1
164 fi
165
166 export NSS_DISABLE_GTESTS=1
167
168 make -C ./nss \
169 CCC="${CXX}" \
170 OS_TEST=${OS_TEST} \
171 SOURCE_LIB_DIR="${TD}/${libdir}" \
172 SOURCE_BIN_DIR="${TD}/${bindir}" \
173 install
174
175 install -d ${D}/${libdir}/
176 for file in ${S}/dist/*.OBJ/lib/*.so; do
177 echo "Installing `basename $file`..."
178 cp $file ${D}/${libdir}/
179 done
180
181 for shared_lib in ${TD}/${libdir}/*.so.*; do
182 if [ -f $shared_lib ]; then
183 cp $shared_lib ${D}/${libdir}
184 ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
185 fi
186 done
187 for shared_lib in ${TD}/${libdir}/*.so; do
188 if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
189 cp $shared_lib ${D}/${libdir}
190 fi
191 done
192
193 install -d ${D}/${includedir}/nss3
194 install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
195
196 install -d ${D}/${bindir}
197 for binary in ${TD}/${bindir}/*; do
198 install -m 755 -t ${D}/${bindir} $binary
199 done
200}
201
202do_install[vardepsexclude] += "SITEINFO_BITS"
203
204do_install_append() {
205 # Create empty .chk files for the NSS libraries at build time. They could
206 # be regenerated at target's boot time.
207 for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
208 touch ${D}/${libdir}/$file
209 chmod 755 ${D}/${libdir}/$file
210 done
211 install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
212
213 install -d ${D}${libdir}/pkgconfig/
214 sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
215 sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
216 sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
217 sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
218 sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
219}
220
221do_install_append_class-target() {
222 # It used to call certutil to create a blank certificate with empty password at
223 # build time, but the checksum of key4.db changes every time when certutil is called.
224 # It causes non-determinism issue, so provide databases with a blank certificate
225 # which are originally from output of nss in qemux86-64 build. You can get these
226 # databases by:
227 # certutil -N -d sql:/database/path/ --empty-password
228 install -d ${D}${sysconfdir}/pki/nssdb/
229 install -m 0644 ${WORKDIR}/blank-cert9.db ${D}${sysconfdir}/pki/nssdb/cert9.db
230 install -m 0644 ${WORKDIR}/blank-key4.db ${D}${sysconfdir}/pki/nssdb/key4.db
231 install -m 0644 ${WORKDIR}/system-pkcs11.txt ${D}${sysconfdir}/pki/nssdb/pkcs11.txt
232}
233
234PACKAGE_WRITE_DEPS += "nss-native"
235pkg_postinst_${PN} () {
236 if [ -n "$D" ]; then
237 for I in $D${libdir}/lib*.chk; do
238 DN=`dirname $I`
239 BN=`basename $I .chk`
240 FN=$DN/$BN.so
241 shlibsign -i $FN
242 if [ $? -ne 0 ]; then
243 exit 1
244 fi
245 done
246 else
247 signlibs.sh
248 fi
249}
250
251PACKAGES =+ "${PN}-smime"
252FILES_${PN}-smime = "\
253 ${bindir}/smime \
254"
255
256FILES_${PN} = "\
257 ${sysconfdir} \
258 ${bindir} \
259 ${libdir}/lib*.chk \
260 ${libdir}/lib*.so \
261 "
262
263FILES_${PN}-dev = "\
264 ${libdir}/nss \
265 ${libdir}/pkgconfig/* \
266 ${includedir}/* \
267 "
268
269RDEPENDS_${PN}-smime = "perl"
270
271BBCLASSEXTEND = "native nativesdk"