summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/nss/nss_3.21.bb
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2016-01-19 17:37:32 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-20 17:07:13 +0000
commit386064042d8980d03a38d24c49493942cfb51efb (patch)
tree231f6438bcfb67e3666603c2ec8a9514f3466866 /meta/recipes-support/nss/nss_3.21.bb
parentea39ad08ee995c2de3cfeaf5f453ed886ba15538 (diff)
downloadpoky-386064042d8980d03a38d24c49493942cfb51efb.tar.gz
nss: update to 3.21
Explicitly disable tests (they were previously implicitly disabled upstream), as they cause various architecture-specific build failures. Add 0001-Fix-build-failure-on-opensuse-13.1.patch that fixes compilation using gcc 4.8. (From OE-Core rev: 1cf3f0685b42ce494d7b2b327d54c9652a6de42d) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/nss/nss_3.21.bb')
-rw-r--r--meta/recipes-support/nss/nss_3.21.bb230
1 files changed, 230 insertions, 0 deletions
diff --git a/meta/recipes-support/nss/nss_3.21.bb b/meta/recipes-support/nss/nss_3.21.bb
new file mode 100644
index 0000000000..24892b46bc
--- /dev/null
+++ b/meta/recipes-support/nss/nss_3.21.bb
@@ -0,0 +1,230 @@
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
17SRC_URI = "\
18 http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_21_RTM/src/${BP}.tar.gz \
19 file://nss-fix-support-cross-compiling.patch \
20 file://nss-no-rpath-for-cross-compiling.patch \
21 file://nss-fix-incorrect-shebang-of-perl.patch \
22 file://nss-fix-nsinstall-build.patch \
23 file://0001-Fix-build-failure-on-opensuse-13.1.patch \
24 file://nss.pc.in \
25 file://signlibs.sh \
26"
27
28SRC_URI[md5sum] = "3c8b2ed880dd3a8d86c9e0151afe6eba"
29SRC_URI[sha256sum] = "3f7a5b027d7cdd5c0e4ff7544da33fdc6f56c2f8c27fff02938fd4a6fbe87239"
30
31UPSTREAM_CHECK_URI = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Releases"
32UPSTREAM_CHECK_REGEX = "NSS_(?P<pver>.+)_release_notes"
33
34inherit siteinfo
35
36DEPENDS = "sqlite3 nspr zlib nss-native"
37DEPENDS_class-native = "sqlite3-native nspr-native zlib-native"
38RDEPENDS_${PN}-smime = "perl"
39
40TD = "${S}/tentative-dist"
41TDS = "${S}/tentative-dist-staging"
42
43TARGET_CC_ARCH += "${LDFLAGS}"
44
45do_compile_prepend_class-native() {
46 export NSPR_INCLUDE_DIR=${STAGING_INCDIR_NATIVE}
47 export NSPR_LIB_DIR=${STAGING_LIBDIR_NATIVE}
48}
49
50do_compile_prepend_class-nativesdk() {
51 export LDFLAGS=""
52}
53
54do_compile() {
55 export CROSS_COMPILE=1
56 export NATIVE_CC="gcc"
57 export BUILD_OPT=1
58
59 export FREEBL_NO_DEPEND=1
60 export FREEBL_LOWHASH=1
61
62 export LIBDIR=${libdir}
63 export MOZILLA_CLIENT=1
64 export NS_USE_GCC=1
65 export NSS_USE_SYSTEM_SQLITE=1
66 export NSS_ENABLE_ECC=1
67
68 export OS_RELEASE=3.4
69 export OS_TARGET=Linux
70 export OS_ARCH=Linux
71
72 if [ "${TARGET_ARCH}" = "powerpc" ]; then
73 OS_TEST=ppc
74 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
75 OS_TEST=ppc64
76 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
77 OS_TEST=mips
78 else
79 OS_TEST="${TARGET_ARCH}"
80 fi
81
82 if [ "${SITEINFO_BITS}" = "64" ]; then
83 export USE_64=1
84 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
85 export USE_X32=1
86 fi
87
88 export NSS_DISABLE_GTESTS=1
89
90 # We can modify CC in the environment, but if we set it via an
91 # argument to make, nsinstall, a host program, will also build with it!
92 #
93 export CC="${CC} -g"
94 make -C ./nss CCC="${CXX} -g" \
95 OS_TEST=${OS_TEST}
96}
97
98
99do_install_prepend_class-nativesdk() {
100 export LDFLAGS=""
101}
102
103do_install() {
104 export CROSS_COMPILE=1
105 export NATIVE_CC="gcc"
106 export BUILD_OPT=1
107
108 export FREEBL_NO_DEPEND=1
109
110 export LIBDIR=${libdir}
111 export MOZILLA_CLIENT=1
112 export NS_USE_GCC=1
113 export NSS_USE_SYSTEM_SQLITE=1
114 export NSS_ENABLE_ECC=1
115
116 export OS_RELEASE=3.4
117 export OS_TARGET=Linux
118 export OS_ARCH=Linux
119
120 if [ "${TARGET_ARCH}" = "powerpc" ]; then
121 OS_TEST=ppc
122 elif [ "${TARGET_ARCH}" = "powerpc64" ]; then
123 OS_TEST=ppc64
124 elif [ "${TARGET_ARCH}" = "mips" -o "${TARGET_ARCH}" = "mipsel" -o "${TARGET_ARCH}" = "mips64" -o "${TARGET_ARCH}" = "mips64el" ]; then
125 OS_TEST=mips
126 else
127 OS_TEST="${TARGET_ARCH}"
128 fi
129 if [ "${SITEINFO_BITS}" = "64" ]; then
130 export USE_64=1
131 elif [ "${TARGET_ARCH}" = "x86_64" -a "${SITEINFO_BITS}" = "32" ]; then
132 export USE_X32=1
133 fi
134
135 export NSS_DISABLE_GTESTS=1
136
137 make -C ./nss \
138 CCC="${CXX}" \
139 OS_TEST=${OS_TEST} \
140 SOURCE_LIB_DIR="${TD}/${libdir}" \
141 SOURCE_BIN_DIR="${TD}/${bindir}" \
142 install
143
144 install -d ${D}/${libdir}/
145 for file in ${S}/dist/*.OBJ/lib/*.so; do
146 echo "Installing `basename $file`..."
147 cp $file ${D}/${libdir}/
148 done
149
150 for shared_lib in ${TD}/${libdir}/*.so.*; do
151 if [ -f $shared_lib ]; then
152 cp $shared_lib ${D}/${libdir}
153 ln -sf $(basename $shared_lib) ${D}/${libdir}/$(basename $shared_lib .1oe)
154 fi
155 done
156 for shared_lib in ${TD}/${libdir}/*.so; do
157 if [ -f $shared_lib -a ! -e ${D}/${libdir}/$shared_lib ]; then
158 cp $shared_lib ${D}/${libdir}
159 fi
160 done
161
162 install -d ${D}/${includedir}/nss3
163 install -m 644 -t ${D}/${includedir}/nss3 dist/public/nss/*
164
165 install -d ${D}/${bindir}
166 for binary in ${TD}/${bindir}/*; do
167 install -m 755 -t ${D}/${bindir} $binary
168 done
169}
170
171do_install_append() {
172 # Create empty .chk files for the NSS libraries at build time. They could
173 # be regenerated at target's boot time.
174 for file in libsoftokn3.chk libfreebl3.chk libnssdbm3.chk; do
175 touch ${D}/${libdir}/$file
176 chmod 755 ${D}/${libdir}/$file
177 done
178 install -D -m 755 ${WORKDIR}/signlibs.sh ${D}/${bindir}/signlibs.sh
179
180 install -d ${D}${libdir}/pkgconfig/
181 sed 's/%NSS_VERSION%/${PV}/' ${WORKDIR}/nss.pc.in | sed 's/%NSPR_VERSION%/4.9.2/' > ${D}${libdir}/pkgconfig/nss.pc
182 sed -i s:OEPREFIX:${prefix}:g ${D}${libdir}/pkgconfig/nss.pc
183 sed -i s:OEEXECPREFIX:${exec_prefix}:g ${D}${libdir}/pkgconfig/nss.pc
184 sed -i s:OELIBDIR:${libdir}:g ${D}${libdir}/pkgconfig/nss.pc
185 sed -i s:OEINCDIR:${includedir}/nss3:g ${D}${libdir}/pkgconfig/nss.pc
186}
187
188do_install_append_class-target() {
189 # Create a blank certificate
190 mkdir -p ${D}${sysconfdir}/pki/nssdb/
191 touch ./empty_password
192 certutil -N -d ${D}${sysconfdir}/pki/nssdb/ -f ./empty_password
193 chmod 644 ${D}${sysconfdir}/pki/nssdb/*.db
194 rm ./empty_password
195}
196
197pkg_postinst_${PN} () {
198 if [ -n "$D" ]; then
199 for I in $D/${libdir}/lib*.chk; do
200 DN=`dirname $I`
201 BN=`basename $I .chk`
202 FN=$DN/$BN.so
203 shlibsign -i $FN
204 if [ $? -ne 0 ]; then
205 exit 1
206 fi
207 done
208 exit 0
209 fi
210 signlibs.sh
211}
212
213PACKAGES =+ "${PN}-smime"
214FILES_${PN}-smime = "\
215 ${bindir}/smime \
216"
217FILES_${PN} = "\
218 ${sysconfdir} \
219 ${bindir} \
220 ${libdir}/lib*.chk \
221 ${libdir}/lib*.so \
222 "
223FILES_${PN}-dev = "\
224 ${libdir}/nss \
225 ${libdir}/pkgconfig/* \
226 ${includedir}/* \
227 "
228
229BBCLASSEXTEND = "native nativesdk"
230