summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss_3.36.1.bb
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/nss/nss_3.36.1.bb')
-rw-r--r--meta/recipes-support/nss/nss_3.36.1.bb253
1 files changed, 253 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss_3.36.1.bb b/meta/recipes-support/nss/nss_3.36.1.bb
new file mode 100644
index 0000000000..f8555389ff
--- /dev/null
+++ b/meta/recipes-support/nss/nss_3.36.1.bb
@@ -0,0 +1,253 @@
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
11LICENSE = "MPL-2.0 | (MPL-2.0 & GPL-2.0+) | (MPL-2.0 & LGPL-2.1+)"
12
13LIC_FILES_CHKSUM = "file://nss/COPYING;md5=3b1e88e1b9c0b5a4b2881d46cce06a18 \
14 file://nss/lib/freebl/mpi/doc/LICENSE;md5=491f158d09d948466afce85d6f1fe18f \
15 file://nss/lib/freebl/mpi/doc/LICENSE-MPL;md5=5d425c8f3157dbf212db2ec53d9e5132"
16
17VERSION_DIR = "${@d.getVar('BP').upper().replace('-', '_').replace('.', '_') + '_RTM'}"
18
19SRC_URI = "http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/${VERSION_DIR}/src/${BP}.tar.gz \
20 file://nss.pc.in \
21 file://signlibs.sh \
22 file://0001-nss-fix-support-cross-compiling.patch \
23 file://nss-no-rpath-for-cross-compiling.patch \
24 file://nss-fix-incorrect-shebang-of-perl.patch \
25 file://nss-fix-nsinstall-build.patch \
26 file://disable-Wvarargs-with-clang.patch \
27 file://pqg.c-ULL_addend.patch \
28 file://Fix-compilation-for-X32.patch \
29 "
30
31SRC_URI[md5sum] = "814d8fe3ec89006cf62078e2a56cf2f9"
32SRC_URI[sha256sum] = "6025441d528ff6a7f1a4b673b6ee7d3540731ada3f78d5acd5c3b3736b222bff"
33
34UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
35UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
36
37inherit siteinfo
38
39DEPENDS = "sqlite3 nspr zlib nss-native"
40DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
41RDEPENDS_${PN}-smime = "perl"
42
43TD = "${S}/tentative-dist"
44TDS = "${S}/tentative-dist-staging"
45
46TARGET_CC_ARCH += "${LDFLAGS}"
47
48do_configure_prepend_libc-musl () {
49 sed -i -e '/-DHAVE_SYS_CDEFS_H/d' ${S}/nss/lib/dbm/config/config.mk
50}
51
52do_compile_prepend_class-native() {
53 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
54 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
55 export NSS_ENABLE_WERROR=0
56}
57
58do_compile_prepend_class-nativesdk() {
59 export LDFLAGS=""
60}
61
62do_compile_prepend_class-native() {
63 # Need to set RPATH so that chrpath will do its job correctly
64 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}"
65}
66
67do_compile() {
68 export CROSS_COMPILE=1
69 export NATIVE_CC="${BUILD_CC}"
70 export NATIVE_FLAGS="${BUILD_CFLAGS}"
71 export BUILD_OPT=1
72
73 export FREEBL_NO_DEPEND=1
74 export FREEBL_LOWHASH=1
75
76 export LIBDIR=${libdir}
77 export MOZILLA_CLIENT=1
78 export NS_USE_GCC=1
79 export NSS_USE_SYSTEM_SQLITE=1
80 export NSS_ENABLE_ECC=1
81
82 export OS_RELEASE=3.4
83 export OS_TARGET=Linux
84 export OS_ARCH=Linux
85
86 if [ "${TARGET_ARCH}" = "powerpc" ]; then
87 OS_TEST=ppc
88 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
89 OS_TEST=ppc64
90 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
91 OS_TEST=mips
92 else
93 OS_TEST="${TARGET_ARCH}"
94 fi
95
96 if [ "${SITEINFO_BITS}" = "64" ]; then
97 export USE_64=1
98 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
99 export USE_X32=1
100 fi
101
102 export NSS_DISABLE_GTESTS=1
103
104 # We can modify CC in the environment, but if we set it via an
105 # argument to make, nsinstall, a host program, will also build with it!
106 #
107 # nss pretty much does its own thing with CFLAGS, so we put them into CC.
108 # Optimization will get clobbered, but most of the stuff will survive.
109 # The motivation for this is to point to the correct place for debug
110 # source files and CFLAGS does that. Nothing uses CCC.
111 #
112 export CC="${CC} ${CFLAGS}"
113 make -C ./nss CCC="${CXX} -g" \
114 OS_TEST=${OS_TEST} \
115 RPATH="${RPATH}"
116}
117do_compile[vardepsexclude] += "SITEINFO_BITS"
118
119
120do_install_prepend_class-nativesdk() {
121 export LDFLAGS=""
122}
123
124do_install() {
125 export CROSS_COMPILE=1
126 export NATIVE_CC="${BUILD_CC}"
127 export BUILD_OPT=1
128
129 export FREEBL_NO_DEPEND=1
130
131 export LIBDIR=${libdir}
132 export MOZILLA_CLIENT=1
133 export NS_USE_GCC=1
134 export NSS_USE_SYSTEM_SQLITE=1
135 export NSS_ENABLE_ECC=1
136
137 export OS_RELEASE=3.4
138 export OS_TARGET=Linux
139 export OS_ARCH=Linux
140
141 if [ "${TARGET_ARCH}" = "powerpc" ]; then
142 OS_TEST=ppc
143 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
144 OS_TEST=ppc64
145 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
146 OS_TEST=mips
147 else
148 OS_TEST="${TARGET_ARCH}"
149 fi
150 if [ "${SITEINFO_BITS}" = "64" ]; then
151 export USE_64=1
152 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
153 export USE_X32=1
154 fi
155
156 export NSS_DISABLE_GTESTS=1
157
158 make -C ./nss \
159 CCC="${CXX}" \
160 OS_TEST=${OS_TEST} \
161 SOURCE_LIB_DIR="${TD}/${libdir}" \
162 SOURCE_BIN_DIR="${TD}/${bindir}" \
163 install
164
165 install -d ${D}/${libdir}/
166 for file in ${S}/dist/*.OBJ/lib/*.so; do
167 echo "Installing `basename $file`..."
168 cp $file ${D}/${libdir}/
169 done
170
171 for shared_lib in ${TD}/${libdir}/*.so.*; do
172 if [ -f $shared_lib ]; then
173 cp $shared_lib ${D}/${libdir}
174 ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
175 fi
176 done
177 for shared_lib in ${TD}/${libdir}/*.so; do
178 if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
179 cp $shared_lib ${D}/${libdir}
180 fi
181 done
182
183 install -d ${D}/${includedir}/nss3
184 install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
185
186 install -d ${D}/${bindir}
187 for binary in ${TD}/${bindir}/*; do
188 install -m 755 -t ${D}/${bindir} $binary
189 done
190}
191do_install[vardepsexclude] += "SITEINFO_BITS"
192
193do_install_append() {
194 # Create empty .chk files for the NSS libraries at build time. They could
195 # be regenerated at target's boot time.
196 for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
197 touch ${D}/${libdir}/$file
198 chmod 755 ${D}/${libdir}/$file
199 done
200 install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
201
202 install -d ${D}${libdir}/pkgconfig/
203 sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
204 sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
205 sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
206 sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
207 sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
208}
209
210do_install_append_class-target() {
211 # Create a blank certificate
212 mkdir -p ${D}${sysconfdir}/pki/nssdb/
213 touch ./empty_password
214 certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
215 chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
216 rm ./empty_password
217}
218
219PACKAGE_WRITE_DEPS += "nss-native"
220pkg_postinst_${PN} () {
221 if [ -n "$D" ]; then
222 for I in $D${libdir}/lib*.chk; do
223 DN=`dirname $I`
224 BN=`basename $I .chk`
225 FN=$DN/$BN.so
226 shlibsign -i $FN
227 if [ $? -ne 0 ]; then
228 exit 1
229 fi
230 done
231 else
232 signlibs.sh
233 fi
234}
235
236PACKAGES =+ "${PN}-smime"
237FILES_${PN}-smime = "\
238 ${bindir}/smime \
239"
240FILES_${PN} = "\
241 ${sysconfdir} \
242 ${bindir} \
243 ${libdir}/lib*.chk \
244 ${libdir}/lib*.so \
245 "
246FILES_${PN}-dev = "\
247 ${libdir}/nss \
248 ${libdir}/pkgconfig/* \
249 ${includedir}/* \
250 "
251
252BBCLASSEXTEND = "native nativesdk"
253