blob: 1bf6811b76634331c5265b4e51a2f105963a5590 [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "Netscape Portable Runtime Library"
2HOMEPAGE = "http://www.mozilla.org/projects/nspr/"
3LICENSE = "GPL-2.0 | MPL-2.0 | LGPL-2.1"
4LIC_FILES_CHKSUM = "file://configure.in;beginline=3;endline=6;md5=90c2fdee38e45d6302abcfe475c8b5c5 \
5 file://Makefile.in;beginline=4;endline=38;md5=beda1dbb98a515f557d3e58ef06bca99"
6SECTION = "libs/network"
7
8SRC_URI = "http://ftp.mozilla.org/pub/nspr/releases/v${PV}/src/nspr-${PV}.tar.gz \
9 file://remove-rpath-from-tests.patch \
10 file://fix-build-on-x86_64.patch \
11 file://remove-srcdir-from-configure-in.patch \
12 file://0002-Add-nios2-support.patch \
13 file://0001-md-Fix-build-with-musl.patch \
14 file://Makefile.in-remove-_BUILD_STRING-and-_BUILD_TIME.patch \
15 file://nspr.pc.in \
16"
17
Patrick Williams213cb262021-08-07 19:21:33 -050018CACHED_CONFIGUREVARS:append:libc-musl = " CFLAGS='${CFLAGS} -D_PR_POLL_AVAILABLE \
Andrew Geissler82c905d2020-04-13 13:39:40 -050019 -D_PR_HAVE_OFF64_T -D_PR_INET6 -D_PR_HAVE_INET_NTOP \
20 -D_PR_HAVE_GETHOSTBYNAME2 -D_PR_HAVE_GETADDRINFO \
21 -D_PR_INET6_PROBE -DNO_DLOPEN_NULL'"
22
23UPSTREAM_CHECK_URI = "http://ftp.mozilla.org/pub/nspr/releases/"
24UPSTREAM_CHECK_REGEX = "v(?P<pver>\d+(\.\d+)+)/"
25
Andrew Geisslerbbbd5f42020-10-30 15:42:48 -050026SRC_URI[md5sum] = "a546926d3c8e887be02c668c1293da92"
27SRC_URI[sha256sum] = "22286bdb8059d74632cc7c2865c139e63953ecfb33bf4362ab58827e86e92582"
Andrew Geissler82c905d2020-04-13 13:39:40 -050028
29CVE_PRODUCT = "netscape_portable_runtime"
30
31S = "${WORKDIR}/nspr-${PV}/nspr"
32
Patrick Williams213cb262021-08-07 19:21:33 -050033RDEPENDS:${PN}-dev += "perl"
Andrew Geissler82c905d2020-04-13 13:39:40 -050034TARGET_CC_ARCH += "${LDFLAGS}"
35
36TESTS = " \
37 accept \
38 acceptread \
39 acceptreademu \
40 affinity \
41 alarm \
42 anonfm \
43 atomic \
44 attach \
45 bigfile \
46 cleanup \
47 cltsrv \
48 concur \
49 cvar \
50 cvar2 \
51 dlltest \
52 dtoa \
53 errcodes \
54 exit \
55 fdcach \
56 fileio \
57 foreign \
58 formattm \
59 fsync \
60 gethost \
61 getproto \
62 i2l \
63 initclk \
64 inrval \
65 instrumt \
66 intrio \
67 intrupt \
68 io_timeout \
69 ioconthr \
70 join \
71 joinkk \
72 joinku \
73 joinuk \
74 joinuu \
75 layer \
76 lazyinit \
77 libfilename \
78 lltest \
79 lock \
80 lockfile \
81 logfile \
82 logger \
83 many_cv \
84 multiwait \
85 nameshm1 \
86 nblayer \
87 nonblock \
88 ntioto \
89 ntoh \
90 op_2long \
91 op_excl \
92 op_filnf \
93 op_filok \
94 op_nofil \
95 parent \
96 parsetm \
97 peek \
98 perf \
99 pipeping \
100 pipeping2 \
101 pipeself \
102 poll_nm \
103 poll_to \
104 pollable \
105 prftest \
106 primblok \
107 provider \
108 prpollml \
109 ranfile \
110 randseed \
111 reinit \
112 rwlocktest \
113 sel_spd \
114 selct_er \
115 selct_nm \
116 selct_to \
117 selintr \
118 sema \
119 semaerr \
120 semaping \
121 sendzlf \
122 server_test \
123 servr_kk \
124 servr_uk \
125 servr_ku \
126 servr_uu \
127 short_thread \
128 sigpipe \
129 socket \
130 sockopt \
131 sockping \
132 sprintf \
133 stack \
134 stdio \
135 str2addr \
136 strod \
137 switch \
138 system \
139 testbit \
140 testfile \
141 threads \
142 timemac \
143 timetest \
144 tpd \
145 udpsrv \
146 vercheck \
147 version \
148 writev \
149 xnotify \
150 zerolen"
151
152inherit autotools multilib_script
153
154MULTILIB_SCRIPTS = "${PN}-dev:${bindir}/nspr-config"
155
156PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)}"
157PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
158
159# Do not install nspr in usr/include, but in usr/include/nspr, the
160# preferred path upstream.
161EXTRA_OECONF += "--includedir=${includedir}/nspr"
162
Patrick Williams213cb262021-08-07 19:21:33 -0500163do_compile:prepend() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500164 oe_runmake CROSS_COMPILE=1 CFLAGS="-DXP_UNIX ${BUILD_CFLAGS}" LDFLAGS="" CC="${BUILD_CC}" -C config export
165}
166
Patrick Williams213cb262021-08-07 19:21:33 -0500167do_compile:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500168 oe_runmake -C pr/tests
169}
170
Patrick Williams213cb262021-08-07 19:21:33 -0500171do_install:append() {
Andrew Geissler82c905d2020-04-13 13:39:40 -0500172 install -D ${WORKDIR}/nspr.pc.in ${D}${libdir}/pkgconfig/nspr.pc
173 sed -i \
174 -e 's:NSPRVERSION:${PV}:g' \
175 -e 's:OEPREFIX:${prefix}:g' \
176 -e 's:OELIBDIR:${libdir}:g' \
177 -e 's:OEINCDIR:${includedir}:g' \
178 -e 's:OEEXECPREFIX:${exec_prefix}:g' \
179 ${D}${libdir}/pkgconfig/nspr.pc
180
181 mkdir -p ${D}${libdir}/nspr/tests
182 install -m 0755 ${S}/pr/tests/runtests.pl ${D}${libdir}/nspr/tests
183 install -m 0755 ${S}/pr/tests/runtests.sh ${D}${libdir}/nspr/tests
184 cd ${B}/pr/tests
185 install -m 0755 ${TESTS} ${D}${libdir}/nspr/tests
186
187 # delete compile-et.pl and perr.properties from ${bindir} because these are
188 # only used to generate prerr.c and prerr.h files from prerr.et at compile
189 # time
190 rm ${D}${bindir}/compile-et.pl ${D}${bindir}/prerr.properties
191}
192
Patrick Williams213cb262021-08-07 19:21:33 -0500193FILES:${PN} = "${libdir}/lib*.so"
194FILES:${PN}-dev = "${bindir}/* ${libdir}/nspr/tests/* ${libdir}/pkgconfig \
Andrew Geissler82c905d2020-04-13 13:39:40 -0500195 ${includedir}/* ${datadir}/aclocal/* "
196
197BBCLASSEXTEND = "native nativesdk"