1 | %global major 78 |
---|
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 | %if 0%{?build_with_lto} |
---|
10 | # LTO is default since F33 and F32 package is backported as is, so no LTO there |
---|
11 | %else |
---|
12 | %define _lto_cflags %{nil} |
---|
13 | %endif |
---|
14 | |
---|
15 | # Require libatomic for ppc |
---|
16 | %ifarch ppc |
---|
17 | %global system_libatomic 1 |
---|
18 | %endif |
---|
19 | |
---|
20 | # Big endian platforms |
---|
21 | %ifarch ppc ppc64 s390 s390x |
---|
22 | %global big_endian 1 |
---|
23 | %endif |
---|
24 | |
---|
25 | Name: mozjs%{major} |
---|
26 | Version: 78.7.0 |
---|
27 | Release: 1%{?_dist_release} |
---|
28 | Summary: SpiderMonkey JavaScript library |
---|
29 | Group: system |
---|
30 | Vendor: Project Vine |
---|
31 | Distribution: Vine Linux |
---|
32 | |
---|
33 | License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0 |
---|
34 | URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey |
---|
35 | Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz |
---|
36 | |
---|
37 | # Patches from mozjs68, rebased for mozjs78: |
---|
38 | Patch01: fix-soname.patch |
---|
39 | Patch02: copy-headers.patch |
---|
40 | Patch03: tests-increase-timeout.patch |
---|
41 | Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch |
---|
42 | Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch |
---|
43 | |
---|
44 | # Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873 |
---|
45 | Patch12: emitter.patch |
---|
46 | |
---|
47 | # Build fixes |
---|
48 | Patch14: init_patch.patch |
---|
49 | # TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed |
---|
50 | Patch15: spidermonkey_checks_disable.patch |
---|
51 | |
---|
52 | # armv7 fixes |
---|
53 | Patch17: armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch |
---|
54 | |
---|
55 | # s390x/ppc64 fixes, TODO: file bug report upstream? |
---|
56 | Patch18: spidermonkey_style_check_disable_s390x.patch |
---|
57 | Patch19: 0001-Skip-failing-tests-on-ppc64-and-s390x.patch |
---|
58 | |
---|
59 | # fix error to build with rust-1.50 |
---|
60 | Patch1000: mozjs-rust1_50.patch |
---|
61 | |
---|
62 | BuildRequires: make |
---|
63 | BuildRequires: autoconf213 |
---|
64 | BuildRequires: cargo |
---|
65 | BuildRequires: clang-devel |
---|
66 | BuildRequires: gcc |
---|
67 | BuildRequires: gcc-c++ |
---|
68 | BuildRequires: nasm |
---|
69 | BuildRequires: llvm |
---|
70 | BuildRequires: llvm-devel |
---|
71 | BuildRequires: rust |
---|
72 | BuildRequires: perl |
---|
73 | BuildRequires: pkgconfig(libffi) |
---|
74 | BuildRequires: pkgconfig(zlib) |
---|
75 | BuildRequires: python3-devel |
---|
76 | BuildRequires: python3-setuptools |
---|
77 | BuildRequires: python3-six |
---|
78 | BuildRequires: readline-devel |
---|
79 | BuildRequires: zip |
---|
80 | |
---|
81 | %if 0%{?big_endian} |
---|
82 | BuildRequires: icu |
---|
83 | %endif |
---|
84 | |
---|
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 | Group: programming |
---|
98 | Requires: %{name}%{?_isa} = %{version}-%{release} |
---|
99 | |
---|
100 | %description devel |
---|
101 | The %{name}-devel package contains libraries and header files for |
---|
102 | developing applications that use %{name}. |
---|
103 | |
---|
104 | |
---|
105 | %debug_package |
---|
106 | |
---|
107 | |
---|
108 | %prep |
---|
109 | %setup -q -n firefox-%{version}/js/src |
---|
110 | |
---|
111 | pushd ../.. |
---|
112 | %patch01 -p1 |
---|
113 | %patch02 -p1 |
---|
114 | %patch03 -p1 |
---|
115 | %patch09 -p1 |
---|
116 | %patch10 -p1 |
---|
117 | |
---|
118 | %patch12 -p1 |
---|
119 | |
---|
120 | %patch14 -p1 |
---|
121 | %patch15 -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 | %endif |
---|
132 | |
---|
133 | # Fixes for ppc64 and s390x, there is no need to keep it in ifarch here since mozilla tests support ifarch conditions |
---|
134 | %patch19 -p1 |
---|
135 | |
---|
136 | # for rust-1.50.0 |
---|
137 | %patch1000 -p1 |
---|
138 | |
---|
139 | # Copy out the LICENSE file |
---|
140 | cp LICENSE js/src/ |
---|
141 | popd |
---|
142 | |
---|
143 | # Remove zlib directory (to be sure using system version) |
---|
144 | rm -rf ../../modules/zlib |
---|
145 | |
---|
146 | |
---|
147 | %build |
---|
148 | # Prefer GCC for now |
---|
149 | export CC=gcc |
---|
150 | export CXX=g++ |
---|
151 | |
---|
152 | # Workaround |
---|
153 | # error: options `-C embed-bitcode=no` and `-C lto` are incompatible |
---|
154 | # error: could not compile `jsrust`. |
---|
155 | # https://github.com/japaric/cargo-call-stack/issues/25 |
---|
156 | export RUSTFLAGS="-C embed-bitcode" |
---|
157 | |
---|
158 | %if 0%{?build_with_lto} |
---|
159 | # https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd |
---|
160 | export CARGO_PROFILE_RELEASE_LTO=true |
---|
161 | %endif |
---|
162 | |
---|
163 | export CFLAGS="%{optflags}" |
---|
164 | export CXXFLAGS="$CFLAGS" |
---|
165 | export LINKFLAGS="%{?__global_ldflags}" |
---|
166 | export PYTHON="%{__python3}" |
---|
167 | |
---|
168 | autoconf-2.13 |
---|
169 | %configure \ |
---|
170 | --without-system-icu \ |
---|
171 | --with-system-zlib \ |
---|
172 | --disable-tests \ |
---|
173 | --disable-strip \ |
---|
174 | --with-intl-api \ |
---|
175 | --enable-readline \ |
---|
176 | --enable-shared-js \ |
---|
177 | --enable-optimize \ |
---|
178 | --disable-debug \ |
---|
179 | --enable-pie \ |
---|
180 | --disable-jemalloc |
---|
181 | |
---|
182 | %if 0%{?big_endian} |
---|
183 | echo "Generate big endian version of config/external/icu/data/icud67l.dat" |
---|
184 | pushd ../.. |
---|
185 | icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat |
---|
186 | rm -f config/external/icu/data/icudt*l.dat |
---|
187 | popd |
---|
188 | %endif |
---|
189 | |
---|
190 | %make_build |
---|
191 | |
---|
192 | |
---|
193 | %install |
---|
194 | %make_install |
---|
195 | |
---|
196 | # Fix permissions |
---|
197 | chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc |
---|
198 | |
---|
199 | # Avoid multilib conflicts |
---|
200 | case `uname -i` in |
---|
201 | i386 | ppc | s390 | sparc ) |
---|
202 | wordsize="32" |
---|
203 | ;; |
---|
204 | x86_64 | ppc64 | s390x | sparc64 ) |
---|
205 | wordsize="64" |
---|
206 | ;; |
---|
207 | *) |
---|
208 | wordsize="" |
---|
209 | ;; |
---|
210 | esac |
---|
211 | |
---|
212 | if test -n "$wordsize" |
---|
213 | then |
---|
214 | mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \ |
---|
215 | %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h |
---|
216 | |
---|
217 | cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF |
---|
218 | #ifndef JS_CONFIG_H_MULTILIB |
---|
219 | #define JS_CONFIG_H_MULTILIB |
---|
220 | |
---|
221 | #include <bits/wordsize.h> |
---|
222 | |
---|
223 | #if __WORDSIZE == 32 |
---|
224 | # include "js-config-32.h" |
---|
225 | #elif __WORDSIZE == 64 |
---|
226 | # include "js-config-64.h" |
---|
227 | #else |
---|
228 | # error "unexpected value for __WORDSIZE macro" |
---|
229 | #endif |
---|
230 | |
---|
231 | #endif |
---|
232 | EOF |
---|
233 | |
---|
234 | fi |
---|
235 | |
---|
236 | # Remove unneeded files |
---|
237 | rm %{buildroot}%{_bindir}/js%{major}-config |
---|
238 | rm %{buildroot}%{_libdir}/libjs_static.ajs |
---|
239 | |
---|
240 | # Rename library and create symlinks, following fix-soname.patch |
---|
241 | mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \ |
---|
242 | %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0 |
---|
243 | ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0 |
---|
244 | ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so |
---|
245 | |
---|
246 | |
---|
247 | %check |
---|
248 | # Run SpiderMonkey tests |
---|
249 | %if 0%{?require_tests} |
---|
250 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} |
---|
251 | %else |
---|
252 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || : |
---|
253 | %endif |
---|
254 | |
---|
255 | # Run basic JIT tests |
---|
256 | %if 0%{?require_tests} |
---|
257 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic |
---|
258 | %else |
---|
259 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || : |
---|
260 | %endif |
---|
261 | |
---|
262 | |
---|
263 | %ldconfig_scriptlets |
---|
264 | |
---|
265 | |
---|
266 | %files |
---|
267 | %doc README.html |
---|
268 | %license LICENSE |
---|
269 | %{_libdir}/libmozjs-%{major}.so.0* |
---|
270 | |
---|
271 | %files devel |
---|
272 | %{_bindir}/js%{major} |
---|
273 | %{_libdir}/libmozjs-%{major}.so |
---|
274 | %{_libdir}/pkgconfig/*.pc |
---|
275 | %{_includedir}/mozjs-%{major}/ |
---|
276 | |
---|
277 | |
---|
278 | %changelog |
---|
279 | * Wed Feb 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.7.0-1 |
---|
280 | - switched to mozjs-78. |
---|
281 | |
---|
282 | * Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 68.11.0-1 |
---|
283 | - initial build for Vine Linux. |
---|
284 | - new upstream release. |
---|
285 | |
---|
286 | * Tue Jun 30 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.10.0-1 |
---|
287 | - Update to 68.10.0 |
---|
288 | |
---|
289 | * Tue Jun 02 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.9.0-1 |
---|
290 | - Update to 68.9.0 |
---|
291 | - Drop llvm and rust deps |
---|
292 | |
---|
293 | * Wed May 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.8.0-1 |
---|
294 | - Update to 68.8.0 |
---|
295 | |
---|
296 | * Tue Apr 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.7.0-1 |
---|
297 | - Update to 68.7.0 |
---|
298 | |
---|
299 | * Tue Mar 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.6.0-2 |
---|
300 | - Rebuild with GCC 10 |
---|
301 | - Nuke check_spidermonkey_style.py on s390x |
---|
302 | |
---|
303 | * Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 68.6.0-1 |
---|
304 | - Update to 68.6.0 |
---|
305 | |
---|
306 | * Mon Feb 10 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.5.0-1 |
---|
307 | - Update to 68.5.0 |
---|
308 | |
---|
309 | * Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 68.4.2-3 |
---|
310 | - Build with --enable-unaligned-private-values |
---|
311 | |
---|
312 | * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 68.4.2-2 |
---|
313 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild |
---|
314 | |
---|
315 | * Wed Jan 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.2-1 |
---|
316 | - Update to 68.4.2 |
---|
317 | |
---|
318 | * Tue Jan 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.0-1 |
---|
319 | - Update to 68.4.0 |
---|
320 | |
---|
321 | * Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1 |
---|
322 | - Update to 68.3.0 |
---|
323 | |
---|
324 | * Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5 |
---|
325 | - Don't enforce tests to pass on s390 and s390x again |
---|
326 | |
---|
327 | * Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4 |
---|
328 | - Enable LTO |
---|
329 | - Enforce SpiderMonkey tests in check section on all architectures |
---|
330 | |
---|
331 | * Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3 |
---|
332 | - Fix armv7 build |
---|
333 | |
---|
334 | * Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2 |
---|
335 | - Fix s390x build |
---|
336 | - Exclude armv7 for now, see comment up in the spec |
---|
337 | |
---|
338 | * Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1 |
---|
339 | - Initial mozjs68 package based on mozjs60 |
---|