1 | %global major 68 |
---|
2 | |
---|
3 | # LTO - Enable in Release builds, but consider disabling for development as it increases compile time |
---|
4 | %global build_with_lto 1 |
---|
5 | |
---|
6 | # Require tests to pass? |
---|
7 | %global require_tests 0 |
---|
8 | |
---|
9 | # typedarray-arg-set-values-same-buffer-other-type.js is failing on s390x |
---|
10 | %ifarch s390x s390 |
---|
11 | %global require_tests 0 |
---|
12 | %endif |
---|
13 | |
---|
14 | %if 0%{?build_with_lto} |
---|
15 | %global optflags %{optflags} -flto |
---|
16 | %global build_ldflags %{build_ldflags} -flto |
---|
17 | %endif |
---|
18 | |
---|
19 | # Require libatomic for ppc |
---|
20 | %ifarch ppc |
---|
21 | %global system_libatomic 1 |
---|
22 | %endif |
---|
23 | |
---|
24 | # Big endian platforms |
---|
25 | %ifarch ppc ppc64 s390 s390x |
---|
26 | %global big_endian 1 |
---|
27 | %endif |
---|
28 | |
---|
29 | Name: mozjs%{major} |
---|
30 | Version: 68.11.0 |
---|
31 | Release: 1%{?_dist_release} |
---|
32 | Summary: SpiderMonkey JavaScript library |
---|
33 | Vendor: Project Vine |
---|
34 | Distribution: Vine Linux |
---|
35 | |
---|
36 | License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0 |
---|
37 | URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey |
---|
38 | Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz |
---|
39 | |
---|
40 | # Patches from Debian mozjs60, rebased for mozjs68: |
---|
41 | Patch01: fix-soname.patch |
---|
42 | Patch02: copy-headers.patch |
---|
43 | Patch03: tests-increase-timeout.patch |
---|
44 | Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch |
---|
45 | Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch |
---|
46 | |
---|
47 | # Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873 |
---|
48 | Patch12: emitter.patch |
---|
49 | Patch13: emitter_test.patch |
---|
50 | |
---|
51 | # Build fixes |
---|
52 | Patch14: init_patch.patch |
---|
53 | # TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed |
---|
54 | Patch15: spidermonkey_checks_disable.patch |
---|
55 | Patch16: Remove-unused-LLVM-and-Rust-build-dependencies.patch |
---|
56 | |
---|
57 | # armv7 fixes |
---|
58 | Patch17: armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch |
---|
59 | |
---|
60 | # s390x fixes, TODO: file bug report upstream? |
---|
61 | Patch18: spidermonkey_style_check_disable_s390x.patch |
---|
62 | Patch19: Don-t-run-non262-extensions-clone-errors.js-on-s390x.patch |
---|
63 | |
---|
64 | # Patches from Fedora firefox package: |
---|
65 | Patch26: build-icu-big-endian.patch |
---|
66 | |
---|
67 | # Support Python 3 in js tests |
---|
68 | Patch30: jstests_python-3.patch |
---|
69 | |
---|
70 | BuildRequires: autoconf213 |
---|
71 | BuildRequires: cargo |
---|
72 | BuildRequires: clang-devel |
---|
73 | BuildRequires: gcc |
---|
74 | BuildRequires: gcc-c++ |
---|
75 | BuildRequires: perl |
---|
76 | BuildRequires: pkgconfig(libffi) |
---|
77 | BuildRequires: pkgconfig(zlib) |
---|
78 | # Build requires Python 2, tests are patched to run with Python 3 |
---|
79 | BuildRequires: python-devel |
---|
80 | BuildRequires: python3-devel |
---|
81 | BuildRequires: python3-rpm-macros |
---|
82 | BuildRequires: python3-six |
---|
83 | BuildRequires: readline-devel |
---|
84 | BuildRequires: zip |
---|
85 | %if 0%{?system_libatomic} |
---|
86 | BuildRequires: libatomic |
---|
87 | %endif |
---|
88 | |
---|
89 | %description |
---|
90 | SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of |
---|
91 | JavaScript. It is intended to be embedded in other applications |
---|
92 | that provide host environments for JavaScript. |
---|
93 | |
---|
94 | |
---|
95 | %package devel |
---|
96 | Summary: Development files for %{name} |
---|
97 | Requires: %{name}%{?_isa} = %{version}-%{release} |
---|
98 | |
---|
99 | %description devel |
---|
100 | The %{name}-devel package contains libraries and header files for |
---|
101 | developing applications that use %{name}. |
---|
102 | |
---|
103 | |
---|
104 | %debug_package |
---|
105 | |
---|
106 | |
---|
107 | %prep |
---|
108 | %setup -q -n firefox-%{version}/js/src |
---|
109 | |
---|
110 | pushd ../.. |
---|
111 | %patch01 -p1 |
---|
112 | %patch02 -p1 |
---|
113 | %patch03 -p1 |
---|
114 | %patch09 -p1 |
---|
115 | %patch10 -p1 |
---|
116 | |
---|
117 | %patch12 -p1 |
---|
118 | %patch13 -p1 |
---|
119 | %patch14 -p1 |
---|
120 | %patch15 -p1 |
---|
121 | %patch16 -p1 |
---|
122 | |
---|
123 | %ifarch armv7hl |
---|
124 | # Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail |
---|
125 | # https://bugzilla.mozilla.org/show_bug.cgi?id=1526653 |
---|
126 | %patch17 -p1 |
---|
127 | %endif |
---|
128 | |
---|
129 | %ifarch s390x |
---|
130 | %patch18 -p1 |
---|
131 | %patch19 -p1 |
---|
132 | %endif |
---|
133 | |
---|
134 | # Patch for big endian platforms only |
---|
135 | %if 0%{?big_endian} |
---|
136 | %patch26 -p1 -b .icu |
---|
137 | %endif |
---|
138 | |
---|
139 | # Execute tests with Python 3 |
---|
140 | %patch30 -p1 |
---|
141 | |
---|
142 | # make sure we don't ever accidentally link against bundled security libs |
---|
143 | rm -rf security/ |
---|
144 | popd |
---|
145 | |
---|
146 | # Remove zlib directory (to be sure using system version) |
---|
147 | rm -rf ../../modules/zlib |
---|
148 | |
---|
149 | |
---|
150 | %build |
---|
151 | export LANG=ja_JP.UTF-8 |
---|
152 | # Prefer GCC, because clang doesn't support -fstack-clash-protection yet |
---|
153 | export CC=gcc |
---|
154 | export CXX=g++ |
---|
155 | |
---|
156 | %if 0%{?build_with_lto} |
---|
157 | export AR=%{_bindir}/gcc-ar |
---|
158 | export RANLIB=%{_bindir}/gcc-ranlib |
---|
159 | export NM=%{_bindir}/gcc-nm |
---|
160 | %endif |
---|
161 | |
---|
162 | export CFLAGS="%{optflags}" |
---|
163 | export CXXFLAGS="$CFLAGS" |
---|
164 | export LINKFLAGS="%{?__global_ldflags}" |
---|
165 | export PYTHON="%{__python}" |
---|
166 | |
---|
167 | autoconf-2.13 |
---|
168 | %configure \ |
---|
169 | --without-system-icu \ |
---|
170 | --enable-posix-nspr-emulation \ |
---|
171 | --with-system-zlib \ |
---|
172 | --disable-tests \ |
---|
173 | --disable-strip \ |
---|
174 | --with-intl-api \ |
---|
175 | --enable-readline \ |
---|
176 | --enable-shared-js \ |
---|
177 | --disable-optimize \ |
---|
178 | --enable-pie \ |
---|
179 | --disable-jemalloc \ |
---|
180 | --enable-unaligned-private-values |
---|
181 | |
---|
182 | %if 0%{?big_endian} |
---|
183 | echo "Generate big endian version of config/external/icu/data/icud58l.dat" |
---|
184 | pushd ../.. |
---|
185 | ./mach python intl/icu_sources_data.py . |
---|
186 | ls -l config/external/icu/data |
---|
187 | rm -f config/external/icu/data/icudt*l.dat |
---|
188 | popd |
---|
189 | %endif |
---|
190 | |
---|
191 | %make_build |
---|
192 | |
---|
193 | |
---|
194 | %install |
---|
195 | export LANG=ja_JP.UTF-8 |
---|
196 | rm -rf %{buildroot} |
---|
197 | %make_install |
---|
198 | |
---|
199 | # Fix permissions |
---|
200 | chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc |
---|
201 | |
---|
202 | # Avoid multilib conflicts |
---|
203 | case `uname -i` in |
---|
204 | i386 | ppc | s390 | sparc ) |
---|
205 | wordsize="32" |
---|
206 | ;; |
---|
207 | x86_64 | ppc64 | s390x | sparc64 ) |
---|
208 | wordsize="64" |
---|
209 | ;; |
---|
210 | *) |
---|
211 | wordsize="" |
---|
212 | ;; |
---|
213 | esac |
---|
214 | |
---|
215 | if test -n "$wordsize" |
---|
216 | then |
---|
217 | mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \ |
---|
218 | %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h |
---|
219 | |
---|
220 | cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF |
---|
221 | #ifndef JS_CONFIG_H_MULTILIB |
---|
222 | #define JS_CONFIG_H_MULTILIB |
---|
223 | |
---|
224 | #include <bits/wordsize.h> |
---|
225 | |
---|
226 | #if __WORDSIZE == 32 |
---|
227 | # include "js-config-32.h" |
---|
228 | #elif __WORDSIZE == 64 |
---|
229 | # include "js-config-64.h" |
---|
230 | #else |
---|
231 | # error "unexpected value for __WORDSIZE macro" |
---|
232 | #endif |
---|
233 | |
---|
234 | #endif |
---|
235 | EOF |
---|
236 | |
---|
237 | fi |
---|
238 | |
---|
239 | # Remove unneeded files |
---|
240 | rm %{buildroot}%{_bindir}/js%{major}-config |
---|
241 | rm %{buildroot}%{_libdir}/libjs_static.ajs |
---|
242 | |
---|
243 | # Rename library and create symlinks, following fix-soname.patch |
---|
244 | mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \ |
---|
245 | %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0 |
---|
246 | ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0 |
---|
247 | ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so |
---|
248 | |
---|
249 | |
---|
250 | %check |
---|
251 | export LANG=ja_JP.UTF-8 |
---|
252 | # Run SpiderMonkey tests |
---|
253 | %if 0%{?require_tests} |
---|
254 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} |
---|
255 | %else |
---|
256 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || : |
---|
257 | %endif |
---|
258 | |
---|
259 | # Run basic JIT tests |
---|
260 | %if 0%{?require_tests} |
---|
261 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic |
---|
262 | %else |
---|
263 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || : |
---|
264 | %endif |
---|
265 | |
---|
266 | |
---|
267 | %post -p /sbin/ldconfig |
---|
268 | %postun -p /sbin/ldconfig |
---|
269 | |
---|
270 | |
---|
271 | %files |
---|
272 | %doc README.html |
---|
273 | %{_libdir}/libmozjs-%{major}.so.0* |
---|
274 | |
---|
275 | %files devel |
---|
276 | %{_bindir}/js%{major} |
---|
277 | %{_libdir}/libmozjs-%{major}.so |
---|
278 | %{_libdir}/pkgconfig/*.pc |
---|
279 | %{_includedir}/mozjs-%{major}/ |
---|
280 | |
---|
281 | |
---|
282 | %changelog |
---|
283 | * Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 68.11.0-1 |
---|
284 | - initial build for Vine Linux. |
---|
285 | - new upstream release. |
---|
286 | |
---|
287 | * Tue Jun 30 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.10.0-1 |
---|
288 | - Update to 68.10.0 |
---|
289 | |
---|
290 | * Tue Jun 02 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.9.0-1 |
---|
291 | - Update to 68.9.0 |
---|
292 | - Drop llvm and rust deps |
---|
293 | |
---|
294 | * Wed May 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.8.0-1 |
---|
295 | - Update to 68.8.0 |
---|
296 | |
---|
297 | * Tue Apr 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.7.0-1 |
---|
298 | - Update to 68.7.0 |
---|
299 | |
---|
300 | * Tue Mar 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.6.0-2 |
---|
301 | - Rebuild with GCC 10 |
---|
302 | - Nuke check_spidermonkey_style.py on s390x |
---|
303 | |
---|
304 | * Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 68.6.0-1 |
---|
305 | - Update to 68.6.0 |
---|
306 | |
---|
307 | * Mon Feb 10 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.5.0-1 |
---|
308 | - Update to 68.5.0 |
---|
309 | |
---|
310 | * Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 68.4.2-3 |
---|
311 | - Build with --enable-unaligned-private-values |
---|
312 | |
---|
313 | * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 68.4.2-2 |
---|
314 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild |
---|
315 | |
---|
316 | * Wed Jan 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.2-1 |
---|
317 | - Update to 68.4.2 |
---|
318 | |
---|
319 | * Tue Jan 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.0-1 |
---|
320 | - Update to 68.4.0 |
---|
321 | |
---|
322 | * Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1 |
---|
323 | - Update to 68.3.0 |
---|
324 | |
---|
325 | * Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5 |
---|
326 | - Don't enforce tests to pass on s390 and s390x again |
---|
327 | |
---|
328 | * Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4 |
---|
329 | - Enable LTO |
---|
330 | - Enforce SpiderMonkey tests in check section on all architectures |
---|
331 | |
---|
332 | * Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3 |
---|
333 | - Fix armv7 build |
---|
334 | |
---|
335 | * Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2 |
---|
336 | - Fix s390x build |
---|
337 | - Exclude armv7 for now, see comment up in the spec |
---|
338 | |
---|
339 | * Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1 |
---|
340 | - Initial mozjs68 package based on mozjs60 |
---|