|
|
95774b8 |
%global major 91
|
|
|
95774b8 |
|
|
|
95774b8 |
# LTO - Enable in Release builds, but consider disabling for development as it increases compile time
|
|
|
95774b8 |
%global build_with_lto 1
|
|
|
95774b8 |
|
|
|
95774b8 |
# Require tests to pass?
|
|
|
95774b8 |
%global require_tests 1
|
|
|
95774b8 |
|
|
|
95774b8 |
%if 0%{?build_with_lto}
|
|
|
0a4dac7 |
# LTO is the default
|
|
|
95774b8 |
%else
|
|
|
95774b8 |
%define _lto_cflags %{nil}
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
eed5afd |
# Disable LTO on aarch64 (borked since GCC14)
|
|
|
eed5afd |
# https://bugzilla.redhat.com/show_bug.cgi?id=2260867
|
|
|
eed5afd |
%ifarch aarch64
|
|
|
eed5afd |
%define _lto_cflags %{nil}
|
|
|
eed5afd |
%endif
|
|
|
eed5afd |
|
|
|
95774b8 |
# Big endian platforms
|
|
|
95774b8 |
%ifarch ppc ppc64 s390 s390x
|
|
|
95774b8 |
%global big_endian 1
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
95774b8 |
Name: mozjs%{major}
|
|
|
cdfc515 |
Version: 91.13.0
|
|
|
eed5afd |
Release: 8%{?dist}
|
|
|
95774b8 |
Summary: SpiderMonkey JavaScript library
|
|
|
95774b8 |
|
|
|
95774b8 |
License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
|
|
|
95774b8 |
URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
|
|
|
95774b8 |
Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
|
|
|
95774b8 |
|
|
|
78fd9c4 |
# Known failures with system libicu
|
|
|
78fd9c4 |
Source1: known_failures.txt
|
|
|
78fd9c4 |
|
|
|
95774b8 |
# Patches from mozjs68, rebased for mozjs78:
|
|
|
95774b8 |
Patch01: fix-soname.patch
|
|
|
95774b8 |
Patch02: copy-headers.patch
|
|
|
95774b8 |
Patch03: tests-increase-timeout.patch
|
|
|
95774b8 |
Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
|
|
|
95774b8 |
Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch
|
|
|
95774b8 |
|
|
|
95774b8 |
# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
|
|
|
95774b8 |
Patch12: emitter.patch
|
|
|
95774b8 |
Patch13: tests-Use-native-TemporaryDirectory.patch
|
|
|
95774b8 |
|
|
|
95774b8 |
# Build fixes
|
|
|
95774b8 |
Patch14: init_patch.patch
|
|
|
95774b8 |
Patch15: remove-sloppy-m4-detection-from-bundled-autoconf.patch
|
|
|
e372916 |
Patch16: 0001-Python-Build-Use-r-instead-of-rU-file-read-modes.patch
|
|
|
95774b8 |
|
|
|
95774b8 |
# TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed
|
|
|
e372916 |
Patch17: spidermonkey_checks_disable.patch
|
|
|
95774b8 |
|
|
|
8a18628 |
# Fix tests to work with bundled six
|
|
|
8a18628 |
Patch18: six-is-always-PY3-don-t-ask-for-it.patch
|
|
|
8a18628 |
|
|
|
95774b8 |
# s390x/ppc64 fixes
|
|
|
8a18628 |
Patch20: 0001-Skip-failing-tests-on-ppc64-and-s390x.patch
|
|
|
95774b8 |
|
|
|
95774b8 |
BuildRequires: cargo
|
|
|
95774b8 |
BuildRequires: clang-devel
|
|
|
95774b8 |
BuildRequires: gcc
|
|
|
95774b8 |
BuildRequires: gcc-c++
|
|
|
95774b8 |
BuildRequires: m4
|
|
|
95774b8 |
BuildRequires: make
|
|
|
95774b8 |
%if !0%{?rhel}
|
|
|
95774b8 |
BuildRequires: nasm
|
|
|
95774b8 |
%endif
|
|
|
78fd9c4 |
BuildRequires: libicu-devel
|
|
|
95774b8 |
BuildRequires: llvm
|
|
|
95774b8 |
BuildRequires: rust
|
|
|
95774b8 |
BuildRequires: perl-devel
|
|
|
95774b8 |
BuildRequires: pkgconfig(libffi)
|
|
|
95774b8 |
BuildRequires: pkgconfig(zlib)
|
|
|
8a18628 |
# I tried really hard to make Py 3.12 work, but it's a mess to get it working...
|
|
|
8a18628 |
BuildRequires: python3.11-devel
|
|
|
95774b8 |
BuildRequires: readline-devel
|
|
|
95774b8 |
BuildRequires: zip
|
|
|
95774b8 |
|
|
|
95774b8 |
%description
|
|
|
95774b8 |
SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
|
|
|
95774b8 |
JavaScript. It is intended to be embedded in other applications
|
|
|
95774b8 |
that provide host environments for JavaScript.
|
|
|
95774b8 |
|
|
|
95774b8 |
%package devel
|
|
|
95774b8 |
Summary: Development files for %{name}
|
|
|
95774b8 |
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
95774b8 |
|
|
|
95774b8 |
%description devel
|
|
|
95774b8 |
The %{name}-devel package contains libraries and header files for
|
|
|
95774b8 |
developing applications that use %{name}.
|
|
|
95774b8 |
|
|
|
95774b8 |
%prep
|
|
|
95774b8 |
%setup -q -n firefox-%{version}/js/src
|
|
|
95774b8 |
|
|
|
95774b8 |
pushd ../..
|
|
|
eed5afd |
%patch 01 -p1
|
|
|
eed5afd |
%patch 02 -p1
|
|
|
eed5afd |
%patch 03 -p1
|
|
|
eed5afd |
%patch 09 -p1
|
|
|
eed5afd |
%patch 10 -p1
|
|
|
eed5afd |
|
|
|
eed5afd |
%patch 12 -p1
|
|
|
eed5afd |
%patch 13 -p1
|
|
|
eed5afd |
%patch 14 -p1
|
|
|
eed5afd |
%patch 15 -p1
|
|
|
eed5afd |
%patch 16 -p1
|
|
|
eed5afd |
%patch 17 -p1
|
|
|
eed5afd |
%patch 18 -p1
|
|
|
95774b8 |
|
|
|
95774b8 |
# Fixes for ppc64 and s390x, there is no need to keep it in ifarch here since mozilla tests support ifarch conditions
|
|
|
eed5afd |
%patch 20 -p1
|
|
|
95774b8 |
|
|
|
95774b8 |
# Copy out the LICENSE file
|
|
|
95774b8 |
cp LICENSE js/src/
|
|
|
78fd9c4 |
|
|
|
78fd9c4 |
# Copy out file containing known test failures with system libicu
|
|
|
78fd9c4 |
cp %{SOURCE1} js/src/
|
|
|
95774b8 |
popd
|
|
|
95774b8 |
|
|
|
95774b8 |
# Remove zlib directory (to be sure using system version)
|
|
|
95774b8 |
rm -rf ../../modules/zlib
|
|
|
95774b8 |
|
|
|
95774b8 |
%build
|
|
|
95774b8 |
# Prefer GCC for now
|
|
|
95774b8 |
export CC=gcc
|
|
|
95774b8 |
export CXX=g++
|
|
|
95774b8 |
|
|
|
95774b8 |
# Workaround
|
|
|
95774b8 |
# error: options `-C embed-bitcode=no` and `-C lto` are incompatible
|
|
|
95774b8 |
# error: could not compile `jsrust`.
|
|
|
95774b8 |
# https://github.com/japaric/cargo-call-stack/issues/25
|
|
|
95774b8 |
export RUSTFLAGS="-C embed-bitcode"
|
|
|
95774b8 |
|
|
|
95774b8 |
%if 0%{?build_with_lto}
|
|
|
95774b8 |
# https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd
|
|
|
95774b8 |
export CARGO_PROFILE_RELEASE_LTO=true
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
95774b8 |
export CFLAGS="%{optflags}"
|
|
|
95774b8 |
export CXXFLAGS="$CFLAGS"
|
|
|
95774b8 |
export LINKFLAGS="%{?build_ldflags}"
|
|
|
8a18628 |
export PYTHON3="/usr/bin/python3.11"
|
|
|
95774b8 |
|
|
|
95774b8 |
# Use bundled autoconf
|
|
|
95774b8 |
export M4=m4
|
|
|
95774b8 |
export AWK=awk
|
|
|
95774b8 |
export AC_MACRODIR=/builddir/build/BUILD/firefox-%{version}/build/autoconf/
|
|
|
95774b8 |
|
|
|
95774b8 |
sh ../../build/autoconf/autoconf.sh --localdir=/builddir/build/BUILD/firefox-%{version}/js/src configure.in > configure
|
|
|
95774b8 |
chmod +x configure
|
|
|
95774b8 |
|
|
|
95774b8 |
%configure \
|
|
|
78fd9c4 |
--with-system-icu \
|
|
|
95774b8 |
--with-system-zlib \
|
|
|
95774b8 |
--disable-tests \
|
|
|
95774b8 |
--disable-strip \
|
|
|
95774b8 |
--with-intl-api \
|
|
|
95774b8 |
--enable-readline \
|
|
|
95774b8 |
--enable-shared-js \
|
|
|
95774b8 |
--enable-optimize \
|
|
|
95774b8 |
--disable-debug \
|
|
|
95774b8 |
--enable-pie \
|
|
|
95774b8 |
--disable-jemalloc
|
|
|
95774b8 |
|
|
|
95774b8 |
%make_build
|
|
|
95774b8 |
|
|
|
95774b8 |
%install
|
|
|
95774b8 |
%make_install
|
|
|
95774b8 |
|
|
|
95774b8 |
# Fix permissions
|
|
|
95774b8 |
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
|
|
|
95774b8 |
|
|
|
95774b8 |
# Avoid multilib conflicts
|
|
|
95774b8 |
case `uname -i` in
|
|
|
95774b8 |
i386 | ppc | s390 | sparc )
|
|
|
95774b8 |
wordsize="32"
|
|
|
95774b8 |
;;
|
|
|
95774b8 |
x86_64 | ppc64 | s390x | sparc64 )
|
|
|
95774b8 |
wordsize="64"
|
|
|
95774b8 |
;;
|
|
|
95774b8 |
*)
|
|
|
95774b8 |
wordsize=""
|
|
|
95774b8 |
;;
|
|
|
95774b8 |
esac
|
|
|
95774b8 |
|
|
|
95774b8 |
if test -n "$wordsize"
|
|
|
95774b8 |
then
|
|
|
95774b8 |
mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \
|
|
|
95774b8 |
%{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h
|
|
|
95774b8 |
|
|
|
95774b8 |
cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <
|
|
|
95774b8 |
#ifndef JS_CONFIG_H_MULTILIB
|
|
|
95774b8 |
#define JS_CONFIG_H_MULTILIB
|
|
|
95774b8 |
|
|
|
95774b8 |
#include <bits/wordsize.h>
|
|
|
95774b8 |
|
|
|
95774b8 |
#if __WORDSIZE == 32
|
|
|
95774b8 |
# include "js-config-32.h"
|
|
|
95774b8 |
#elif __WORDSIZE == 64
|
|
|
95774b8 |
# include "js-config-64.h"
|
|
|
95774b8 |
#else
|
|
|
95774b8 |
# error "unexpected value for __WORDSIZE macro"
|
|
|
95774b8 |
#endif
|
|
|
95774b8 |
|
|
|
95774b8 |
#endif
|
|
|
95774b8 |
EOF
|
|
|
95774b8 |
|
|
|
95774b8 |
fi
|
|
|
95774b8 |
|
|
|
95774b8 |
# Remove unneeded files
|
|
|
95774b8 |
rm %{buildroot}%{_bindir}/js%{major}-config
|
|
|
95774b8 |
rm %{buildroot}%{_libdir}/libjs_static.ajs
|
|
|
95774b8 |
|
|
|
95774b8 |
# Rename library and create symlinks, following fix-soname.patch
|
|
|
95774b8 |
mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
|
|
|
95774b8 |
%{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
|
|
|
95774b8 |
ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
|
|
|
95774b8 |
ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
|
|
|
95774b8 |
|
|
|
95774b8 |
%check
|
|
|
8a18628 |
# Use bundled py3 modules since we're using non-default Python (3.11)
|
|
|
8a18628 |
export PYTHONPATH="${PYTHONPATH}:../../third_party/python/"
|
|
|
8a18628 |
|
|
|
95774b8 |
# Run SpiderMonkey tests
|
|
|
95774b8 |
%if 0%{?require_tests}
|
|
|
8a18628 |
/usr/bin/python3.11 tests/jstests.py -d -s -t 2400 --exclude-file=known_failures.txt --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major}
|
|
|
95774b8 |
%else
|
|
|
8a18628 |
/usr/bin/python3.11 tests/jstests.py -d -s -t 2400 --exclude-file=known_failures.txt --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || :
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
95774b8 |
# Run basic JIT tests
|
|
|
95774b8 |
%if 0%{?require_tests}
|
|
|
95774b8 |
|
|
|
95774b8 |
# large-arraybuffers/basic.js fails on s390x
|
|
|
95774b8 |
%ifarch s390 s390x
|
|
|
8a18628 |
/usr/bin/python3.11 jit-test/jit_test.py -s -t 2400 --no-progress -x large-arraybuffers/basic.js ../../js/src/dist/bin/js%{major} basic
|
|
|
95774b8 |
%else
|
|
|
8a18628 |
/usr/bin/python3.11 jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js%{major} basic
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
95774b8 |
%else
|
|
|
8a18628 |
/usr/bin/python3.11 jit-test/jit_test.py -s -t 2400 --no-progress ../../js/src/dist/bin/js%{major} basic || :
|
|
|
95774b8 |
%endif
|
|
|
95774b8 |
|
|
|
95774b8 |
%files
|
|
|
95774b8 |
%doc README.html
|
|
|
95774b8 |
%license LICENSE
|
|
|
95774b8 |
%{_libdir}/libmozjs-%{major}.so.0*
|
|
|
95774b8 |
|
|
|
95774b8 |
%files devel
|
|
|
95774b8 |
%{_bindir}/js%{major}
|
|
|
95774b8 |
%{_libdir}/libmozjs-%{major}.so
|
|
|
95774b8 |
%{_libdir}/pkgconfig/*.pc
|
|
|
95774b8 |
%{_includedir}/mozjs-%{major}/
|
|
|
95774b8 |
|
|
|
95774b8 |
%changelog
|
|
|
eed5afd |
* Mon Feb 05 2024 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.13.0-8
|
|
|
eed5afd |
- Add ICU 74.2 expected failures (Fixes RHBZ#2261392)
|
|
|
eed5afd |
- Disable LTO on aarch64
|
|
|
eed5afd |
|
|
|
f880be9 |
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 91.13.0-7
|
|
|
f880be9 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
f880be9 |
|
|
|
9990c5f |
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 91.13.0-6
|
|
|
9990c5f |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
|
|
9990c5f |
|
|
|
5ca42ab |
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 91.13.0-5
|
|
|
5ca42ab |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
|
|
5ca42ab |
|
|
|
e9f0eed |
* Sun Jul 16 2023 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.13.0-4
|
|
|
e9f0eed |
- Switch from Python 3.12 to 3.11 (porting/fixing 3.12 is almost impossible)
|
|
|
e9f0eed |
- Add ICU 73.2 expected failures
|
|
|
e9f0eed |
|
|
|
ea25a60 |
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 91.13.0-3
|
|
|
ea25a60 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
|
|
ea25a60 |
|
|
|
07e7dbf |
* Sat Dec 31 2022 Pete Walter <pwalter@fedoraproject.org> - 91.13.0-2
|
|
|
07e7dbf |
- Rebuild for ICU 72
|
|
|
07e7dbf |
|
|
|
cdfc515 |
* Mon Aug 22 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.13.0-1
|
|
|
cdfc515 |
- mozjs91-91.13.0
|
|
|
cdfc515 |
|
|
|
5c3a4d7 |
* Mon Aug 01 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.12.0-2
|
|
|
5c3a4d7 |
- Rebuilt for ICU 71.1
|
|
|
5c3a4d7 |
|
|
|
a576c22 |
* Wed Jul 27 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.12.0-1
|
|
|
a576c22 |
- mozjs91-91.12.0
|
|
|
a576c22 |
|
|
|
740ab33 |
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 91.11.0-3
|
|
|
740ab33 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
|
|
740ab33 |
|
|
|
e372916 |
* Mon Jun 27 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.11.0-2
|
|
|
e372916 |
- Fixup Python 3.11 build
|
|
|
e372916 |
|
|
|
0a15bbb |
* Mon Jun 27 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.11.0-1
|
|
|
0a15bbb |
- mozjs91-91.11.0
|
|
|
0a15bbb |
|
|
|
8b7ae67 |
* Tue Jun 14 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.10.0-1
|
|
|
8b7ae67 |
- mozjs91-91.10.0
|
|
|
8b7ae67 |
|
|
|
bb2c9dc |
* Sun May 08 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.9.0-1
|
|
|
bb2c9dc |
- mozjs91-91.9.0
|
|
|
bb2c9dc |
|
|
|
d0074a6 |
* Sat Apr 09 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.8.0-1
|
|
|
d0074a6 |
- mozjs91-91.8.0
|
|
|
d0074a6 |
|
|
|
deea748 |
* Tue Mar 08 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.7.0-1
|
|
|
deea748 |
- mozjs91-91.7.0
|
|
|
deea748 |
|
|
|
78fd9c4 |
* Sun Feb 20 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.6.0-1
|
|
|
78fd9c4 |
- mozjs91-91.6.0
|
|
|
78fd9c4 |
- switch to system libicu
|
|
|
78fd9c4 |
|
|
|
2647937 |
* Thu Jan 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 91.5.0-2
|
|
|
2647937 |
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
|
|
2647937 |
|
|
|
9ac1d37 |
* Tue Jan 11 2022 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.5.0-1
|
|
|
9ac1d37 |
- mozjs91-91.5.0
|
|
|
9ac1d37 |
|
|
|
74d6db9 |
* Mon Dec 06 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.4.0-1
|
|
|
74d6db9 |
- mozjs91-91.4.0
|
|
|
74d6db9 |
|
|
|
0a4dac7 |
* Wed Nov 03 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.3.0-1
|
|
|
0a4dac7 |
- mozjs91-91.3.0
|
|
|
0a4dac7 |
|
|
|
65899ef |
* Mon Oct 04 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.2.0-1
|
|
|
65899ef |
- mozjs91-91.2.0
|
|
|
65899ef |
|
|
|
0b01ee3 |
* Mon Sep 20 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.1.0-1
|
|
|
0b01ee3 |
- mozjs91-91.1.0
|
|
|
0b01ee3 |
|
|
|
95774b8 |
* Mon Aug 09 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 91.0-1
|
|
|
95774b8 |
- Initial mozjs91 package based on mozjs78
|