[12546] | 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} |
---|
[12551] | 26 | Version: 78.8.0 |
---|
[12546] | 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 | BuildRequires: make |
---|
| 60 | BuildRequires: autoconf213 |
---|
| 61 | BuildRequires: cargo |
---|
| 62 | BuildRequires: clang-devel |
---|
| 63 | BuildRequires: gcc |
---|
| 64 | BuildRequires: gcc-c++ |
---|
| 65 | BuildRequires: nasm |
---|
| 66 | BuildRequires: llvm |
---|
| 67 | BuildRequires: llvm-devel |
---|
| 68 | BuildRequires: rust |
---|
| 69 | BuildRequires: perl |
---|
| 70 | BuildRequires: pkgconfig(libffi) |
---|
| 71 | BuildRequires: pkgconfig(zlib) |
---|
| 72 | BuildRequires: python3-devel |
---|
| 73 | BuildRequires: python3-setuptools |
---|
| 74 | BuildRequires: python3-six |
---|
| 75 | BuildRequires: readline-devel |
---|
| 76 | BuildRequires: zip |
---|
| 77 | |
---|
| 78 | %if 0%{?big_endian} |
---|
| 79 | BuildRequires: icu |
---|
| 80 | %endif |
---|
| 81 | |
---|
| 82 | %if 0%{?system_libatomic} |
---|
| 83 | BuildRequires: libatomic |
---|
| 84 | %endif |
---|
| 85 | |
---|
| 86 | %description |
---|
| 87 | SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of |
---|
| 88 | JavaScript. It is intended to be embedded in other applications |
---|
| 89 | that provide host environments for JavaScript. |
---|
| 90 | |
---|
| 91 | |
---|
| 92 | %package devel |
---|
| 93 | Summary: Development files for %{name} |
---|
| 94 | Group: programming |
---|
| 95 | Requires: %{name}%{?_isa} = %{version}-%{release} |
---|
| 96 | |
---|
| 97 | %description devel |
---|
| 98 | The %{name}-devel package contains libraries and header files for |
---|
| 99 | developing applications that use %{name}. |
---|
| 100 | |
---|
| 101 | |
---|
| 102 | %debug_package |
---|
| 103 | |
---|
| 104 | |
---|
| 105 | %prep |
---|
| 106 | %setup -q -n firefox-%{version}/js/src |
---|
| 107 | |
---|
| 108 | pushd ../.. |
---|
| 109 | %patch01 -p1 |
---|
| 110 | %patch02 -p1 |
---|
| 111 | %patch03 -p1 |
---|
| 112 | %patch09 -p1 |
---|
| 113 | %patch10 -p1 |
---|
| 114 | |
---|
| 115 | %patch12 -p1 |
---|
| 116 | |
---|
| 117 | %patch14 -p1 |
---|
| 118 | %patch15 -p1 |
---|
| 119 | |
---|
| 120 | %ifarch armv7hl |
---|
| 121 | # Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail |
---|
| 122 | # https://bugzilla.mozilla.org/show_bug.cgi?id=1526653 |
---|
| 123 | %patch17 -p1 |
---|
| 124 | %endif |
---|
| 125 | |
---|
| 126 | %ifarch s390x |
---|
| 127 | %patch18 -p1 |
---|
| 128 | %endif |
---|
| 129 | |
---|
| 130 | # Fixes for ppc64 and s390x, there is no need to keep it in ifarch here since mozilla tests support ifarch conditions |
---|
| 131 | %patch19 -p1 |
---|
| 132 | |
---|
| 133 | # Copy out the LICENSE file |
---|
| 134 | cp LICENSE js/src/ |
---|
| 135 | popd |
---|
| 136 | |
---|
| 137 | # Remove zlib directory (to be sure using system version) |
---|
| 138 | rm -rf ../../modules/zlib |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | %build |
---|
| 142 | # Prefer GCC for now |
---|
| 143 | export CC=gcc |
---|
| 144 | export CXX=g++ |
---|
| 145 | |
---|
| 146 | # Workaround |
---|
| 147 | # error: options `-C embed-bitcode=no` and `-C lto` are incompatible |
---|
| 148 | # error: could not compile `jsrust`. |
---|
| 149 | # https://github.com/japaric/cargo-call-stack/issues/25 |
---|
| 150 | export RUSTFLAGS="-C embed-bitcode" |
---|
| 151 | |
---|
| 152 | %if 0%{?build_with_lto} |
---|
| 153 | # https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd |
---|
| 154 | export CARGO_PROFILE_RELEASE_LTO=true |
---|
| 155 | %endif |
---|
| 156 | |
---|
| 157 | export CFLAGS="%{optflags}" |
---|
| 158 | export CXXFLAGS="$CFLAGS" |
---|
| 159 | export LINKFLAGS="%{?__global_ldflags}" |
---|
| 160 | export PYTHON="%{__python3}" |
---|
| 161 | |
---|
| 162 | autoconf-2.13 |
---|
| 163 | %configure \ |
---|
| 164 | --without-system-icu \ |
---|
| 165 | --with-system-zlib \ |
---|
| 166 | --disable-tests \ |
---|
| 167 | --disable-strip \ |
---|
| 168 | --with-intl-api \ |
---|
| 169 | --enable-readline \ |
---|
| 170 | --enable-shared-js \ |
---|
| 171 | --enable-optimize \ |
---|
| 172 | --disable-debug \ |
---|
| 173 | --enable-pie \ |
---|
| 174 | --disable-jemalloc |
---|
| 175 | |
---|
| 176 | %if 0%{?big_endian} |
---|
| 177 | echo "Generate big endian version of config/external/icu/data/icud67l.dat" |
---|
| 178 | pushd ../.. |
---|
| 179 | icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat |
---|
| 180 | rm -f config/external/icu/data/icudt*l.dat |
---|
| 181 | popd |
---|
| 182 | %endif |
---|
| 183 | |
---|
| 184 | %make_build |
---|
| 185 | |
---|
| 186 | |
---|
| 187 | %install |
---|
| 188 | %make_install |
---|
| 189 | |
---|
| 190 | # Fix permissions |
---|
| 191 | chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc |
---|
| 192 | |
---|
| 193 | # Avoid multilib conflicts |
---|
| 194 | case `uname -i` in |
---|
| 195 | i386 | ppc | s390 | sparc ) |
---|
| 196 | wordsize="32" |
---|
| 197 | ;; |
---|
| 198 | x86_64 | ppc64 | s390x | sparc64 ) |
---|
| 199 | wordsize="64" |
---|
| 200 | ;; |
---|
| 201 | *) |
---|
| 202 | wordsize="" |
---|
| 203 | ;; |
---|
| 204 | esac |
---|
| 205 | |
---|
| 206 | if test -n "$wordsize" |
---|
| 207 | then |
---|
| 208 | mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \ |
---|
| 209 | %{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h |
---|
| 210 | |
---|
| 211 | cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF |
---|
| 212 | #ifndef JS_CONFIG_H_MULTILIB |
---|
| 213 | #define JS_CONFIG_H_MULTILIB |
---|
| 214 | |
---|
| 215 | #include <bits/wordsize.h> |
---|
| 216 | |
---|
| 217 | #if __WORDSIZE == 32 |
---|
| 218 | # include "js-config-32.h" |
---|
| 219 | #elif __WORDSIZE == 64 |
---|
| 220 | # include "js-config-64.h" |
---|
| 221 | #else |
---|
| 222 | # error "unexpected value for __WORDSIZE macro" |
---|
| 223 | #endif |
---|
| 224 | |
---|
| 225 | #endif |
---|
| 226 | EOF |
---|
| 227 | |
---|
| 228 | fi |
---|
| 229 | |
---|
| 230 | # Remove unneeded files |
---|
| 231 | rm %{buildroot}%{_bindir}/js%{major}-config |
---|
| 232 | rm %{buildroot}%{_libdir}/libjs_static.ajs |
---|
| 233 | |
---|
| 234 | # Rename library and create symlinks, following fix-soname.patch |
---|
| 235 | mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \ |
---|
| 236 | %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0 |
---|
| 237 | ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0 |
---|
| 238 | ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so |
---|
| 239 | |
---|
| 240 | |
---|
| 241 | %check |
---|
| 242 | # Run SpiderMonkey tests |
---|
| 243 | %if 0%{?require_tests} |
---|
| 244 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} |
---|
| 245 | %else |
---|
| 246 | PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || : |
---|
| 247 | %endif |
---|
| 248 | |
---|
| 249 | # Run basic JIT tests |
---|
| 250 | %if 0%{?require_tests} |
---|
| 251 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic |
---|
| 252 | %else |
---|
| 253 | PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || : |
---|
| 254 | %endif |
---|
| 255 | |
---|
| 256 | |
---|
| 257 | %ldconfig_scriptlets |
---|
| 258 | |
---|
| 259 | |
---|
| 260 | %files |
---|
| 261 | %doc README.html |
---|
| 262 | %license LICENSE |
---|
| 263 | %{_libdir}/libmozjs-%{major}.so.0* |
---|
| 264 | |
---|
| 265 | %files devel |
---|
| 266 | %{_bindir}/js%{major} |
---|
| 267 | %{_libdir}/libmozjs-%{major}.so |
---|
| 268 | %{_libdir}/pkgconfig/*.pc |
---|
| 269 | %{_includedir}/mozjs-%{major}/ |
---|
| 270 | |
---|
| 271 | |
---|
| 272 | %changelog |
---|
[12551] | 273 | * Fri Feb 26 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.8.0-1 |
---|
| 274 | - new upstream release. |
---|
| 275 | - dropped Patch1000: fixed in upstream. |
---|
| 276 | |
---|
[12546] | 277 | * Wed Feb 24 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 78.7.0-1 |
---|
| 278 | - switched to mozjs-78. |
---|
[12551] | 279 | - added Patch1000 to build with rust-1.50. |
---|
[12546] | 280 | |
---|
| 281 | * Tue Aug 04 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 68.11.0-1 |
---|
| 282 | - initial build for Vine Linux. |
---|
| 283 | - new upstream release. |
---|
| 284 | |
---|
| 285 | * Tue Jun 30 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.10.0-1 |
---|
| 286 | - Update to 68.10.0 |
---|
| 287 | |
---|
| 288 | * Tue Jun 02 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.9.0-1 |
---|
| 289 | - Update to 68.9.0 |
---|
| 290 | - Drop llvm and rust deps |
---|
| 291 | |
---|
| 292 | * Wed May 06 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.8.0-1 |
---|
| 293 | - Update to 68.8.0 |
---|
| 294 | |
---|
| 295 | * Tue Apr 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.7.0-1 |
---|
| 296 | - Update to 68.7.0 |
---|
| 297 | |
---|
| 298 | * Tue Mar 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.6.0-2 |
---|
| 299 | - Rebuild with GCC 10 |
---|
| 300 | - Nuke check_spidermonkey_style.py on s390x |
---|
| 301 | |
---|
| 302 | * Wed Mar 11 2020 Kalev Lember <klember@redhat.com> - 68.6.0-1 |
---|
| 303 | - Update to 68.6.0 |
---|
| 304 | |
---|
| 305 | * Mon Feb 10 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.5.0-1 |
---|
| 306 | - Update to 68.5.0 |
---|
| 307 | |
---|
| 308 | * Mon Feb 03 2020 Kalev Lember <klember@redhat.com> - 68.4.2-3 |
---|
| 309 | - Build with --enable-unaligned-private-values |
---|
| 310 | |
---|
| 311 | * Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 68.4.2-2 |
---|
| 312 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild |
---|
| 313 | |
---|
| 314 | * Wed Jan 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.2-1 |
---|
| 315 | - Update to 68.4.2 |
---|
| 316 | |
---|
| 317 | * Tue Jan 07 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.4.0-1 |
---|
| 318 | - Update to 68.4.0 |
---|
| 319 | |
---|
| 320 | * Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1 |
---|
| 321 | - Update to 68.3.0 |
---|
| 322 | |
---|
| 323 | * Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5 |
---|
| 324 | - Don't enforce tests to pass on s390 and s390x again |
---|
| 325 | |
---|
| 326 | * Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4 |
---|
| 327 | - Enable LTO |
---|
| 328 | - Enforce SpiderMonkey tests in check section on all architectures |
---|
| 329 | |
---|
| 330 | * Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3 |
---|
| 331 | - Fix armv7 build |
---|
| 332 | |
---|
| 333 | * Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2 |
---|
| 334 | - Fix s390x build |
---|
| 335 | - Exclude armv7 for now, see comment up in the spec |
---|
| 336 | |
---|
| 337 | * Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1 |
---|
| 338 | - Initial mozjs68 package based on mozjs60 |
---|