2020-08-03 15:36:59 +00:00
|
|
|
%global major 78
|
|
|
|
|
|
|
|
# LTO - Enable in Release builds, but consider disabling for development as it increases compile time
|
|
|
|
%global build_with_lto 1
|
|
|
|
|
|
|
|
# Require tests to pass?
|
|
|
|
%global require_tests 1
|
|
|
|
|
|
|
|
%if 0%{?build_with_lto}
|
2020-08-17 18:05:04 +00:00
|
|
|
# LTO is default since F33 and F32 package is backported as is, so no LTO there
|
2020-08-03 15:36:59 +00:00
|
|
|
%else
|
|
|
|
%define _lto_cflags %{nil}
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Require libatomic for ppc
|
|
|
|
%ifarch ppc
|
|
|
|
%global system_libatomic 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Big endian platforms
|
|
|
|
%ifarch ppc ppc64 s390 s390x
|
|
|
|
%global big_endian 1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
Name: mozjs%{major}
|
2021-03-25 08:36:57 +00:00
|
|
|
Version: 78.9.0
|
2021-04-12 16:15:35 +00:00
|
|
|
Release: 3%{?dist}
|
2020-08-03 15:36:59 +00:00
|
|
|
Summary: SpiderMonkey JavaScript library
|
|
|
|
|
|
|
|
License: MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
|
|
|
|
URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
|
|
|
|
Source0: https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
|
|
|
|
|
|
|
|
# Patches from mozjs68, rebased for mozjs78:
|
|
|
|
Patch01: fix-soname.patch
|
|
|
|
Patch02: copy-headers.patch
|
|
|
|
Patch03: tests-increase-timeout.patch
|
|
|
|
Patch09: icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
|
|
|
|
Patch10: icu_sources_data-Write-command-output-to-our-stderr.patch
|
|
|
|
|
|
|
|
# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
|
|
|
|
Patch12: emitter.patch
|
|
|
|
|
|
|
|
# Build fixes
|
|
|
|
Patch14: init_patch.patch
|
|
|
|
# TODO: Check with mozilla for cause of these fails and re-enable spidermonkey compile time checks if needed
|
|
|
|
Patch15: spidermonkey_checks_disable.patch
|
|
|
|
|
|
|
|
# armv7 fixes
|
2021-03-25 08:36:57 +00:00
|
|
|
Patch17: definitions_for_user_vfp.patch
|
2020-08-03 15:36:59 +00:00
|
|
|
|
|
|
|
# s390x/ppc64 fixes, TODO: file bug report upstream?
|
|
|
|
Patch18: spidermonkey_style_check_disable_s390x.patch
|
|
|
|
Patch19: 0001-Skip-failing-tests-on-ppc64-and-s390x.patch
|
|
|
|
|
2021-02-23 08:13:33 +00:00
|
|
|
# Fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1644600 ( SharedArrayRawBufferRefs is not exported )
|
|
|
|
# https://github.com/0ad/0ad/blob/83e81362d850cc6f2b3b598255b873b6d04d5809/libraries/source/spidermonkey/FixSharedArray.diff
|
|
|
|
Patch30: FixSharedArray.diff
|
2021-04-12 16:15:35 +00:00
|
|
|
Patch31: 0002-D89554-autoconf1.diff
|
|
|
|
Patch32: 0003-D94538-autoconf2.diff
|
2021-02-23 08:13:33 +00:00
|
|
|
|
|
|
|
BuildRequires: make
|
2020-08-03 15:36:59 +00:00
|
|
|
BuildRequires: cargo
|
|
|
|
BuildRequires: clang-devel
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
2021-02-23 11:47:26 +00:00
|
|
|
%if !0%{?rhel}
|
2020-08-03 15:36:59 +00:00
|
|
|
BuildRequires: nasm
|
2021-02-23 11:47:26 +00:00
|
|
|
%endif
|
2020-08-03 15:36:59 +00:00
|
|
|
BuildRequires: llvm
|
|
|
|
BuildRequires: llvm-devel
|
|
|
|
BuildRequires: rust
|
|
|
|
BuildRequires: perl-devel
|
|
|
|
BuildRequires: pkgconfig(libffi)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
|
|
|
BuildRequires: python3-devel
|
2020-08-17 18:05:04 +00:00
|
|
|
BuildRequires: python3-setuptools
|
2020-08-03 15:36:59 +00:00
|
|
|
BuildRequires: python3-six
|
|
|
|
BuildRequires: readline-devel
|
|
|
|
BuildRequires: zip
|
2020-11-17 19:25:36 +00:00
|
|
|
|
|
|
|
%if 0%{?big_endian}
|
|
|
|
BuildRequires: icu
|
|
|
|
%endif
|
|
|
|
|
2020-08-03 15:36:59 +00:00
|
|
|
%if 0%{?system_libatomic}
|
|
|
|
BuildRequires: libatomic
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%description
|
|
|
|
SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
|
|
|
|
JavaScript. It is intended to be embedded in other applications
|
|
|
|
that provide host environments for JavaScript.
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for %{name}
|
|
|
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
The %{name}-devel package contains libraries and header files for
|
|
|
|
developing applications that use %{name}.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n firefox-%{version}/js/src
|
|
|
|
|
|
|
|
pushd ../..
|
|
|
|
%patch01 -p1
|
|
|
|
%patch02 -p1
|
|
|
|
%patch03 -p1
|
|
|
|
%patch09 -p1
|
|
|
|
%patch10 -p1
|
|
|
|
|
|
|
|
%patch12 -p1
|
|
|
|
|
|
|
|
%patch14 -p1
|
|
|
|
%patch15 -p1
|
|
|
|
|
|
|
|
%ifarch armv7hl
|
2021-03-25 08:36:57 +00:00
|
|
|
# Include definitions for user vfp on armv7 as it causes the compilation to fail without them
|
2020-08-03 15:36:59 +00:00
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1526653
|
|
|
|
%patch17 -p1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ifarch s390x
|
|
|
|
%patch18 -p1
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Fixes for ppc64 and s390x, there is no need to keep it in ifarch here since mozilla tests support ifarch conditions
|
|
|
|
%patch19 -p1
|
|
|
|
|
2021-02-23 08:13:33 +00:00
|
|
|
# Export SharedArrayRawBufferRefs
|
|
|
|
%patch30 -p1
|
2021-04-12 16:15:35 +00:00
|
|
|
%patch31 -p1 -b .autoconf213
|
|
|
|
%patch32 -p1 -b .autoconf213-2
|
2021-02-23 08:13:33 +00:00
|
|
|
|
2020-08-03 15:36:59 +00:00
|
|
|
# Copy out the LICENSE file
|
|
|
|
cp LICENSE js/src/
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Remove zlib directory (to be sure using system version)
|
|
|
|
rm -rf ../../modules/zlib
|
|
|
|
|
|
|
|
%build
|
2020-08-17 18:05:04 +00:00
|
|
|
# Prefer GCC for now
|
2020-08-03 15:36:59 +00:00
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
|
|
|
|
|
|
|
# Workaround
|
|
|
|
# error: options `-C embed-bitcode=no` and `-C lto` are incompatible
|
|
|
|
# error: could not compile `jsrust`.
|
|
|
|
# https://github.com/japaric/cargo-call-stack/issues/25
|
|
|
|
export RUSTFLAGS="-C embed-bitcode"
|
|
|
|
|
2020-08-17 18:05:04 +00:00
|
|
|
%if 0%{?build_with_lto}
|
|
|
|
# https://github.com/ptomato/mozjs/commit/36bb7982b41e0ef9a65f7174252ab996cd6777bd
|
|
|
|
export CARGO_PROFILE_RELEASE_LTO=true
|
|
|
|
%endif
|
|
|
|
|
2020-08-03 15:36:59 +00:00
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
|
|
|
export LINKFLAGS="%{?__global_ldflags}"
|
|
|
|
export PYTHON="%{__python3}"
|
|
|
|
|
|
|
|
%configure \
|
|
|
|
--without-system-icu \
|
|
|
|
--with-system-zlib \
|
|
|
|
--disable-tests \
|
|
|
|
--disable-strip \
|
|
|
|
--with-intl-api \
|
|
|
|
--enable-readline \
|
|
|
|
--enable-shared-js \
|
2020-11-17 19:25:36 +00:00
|
|
|
--enable-optimize \
|
|
|
|
--disable-debug \
|
2020-08-03 15:36:59 +00:00
|
|
|
--enable-pie \
|
|
|
|
--disable-jemalloc
|
|
|
|
|
|
|
|
%if 0%{?big_endian}
|
|
|
|
echo "Generate big endian version of config/external/icu/data/icud67l.dat"
|
|
|
|
pushd ../..
|
|
|
|
icupkg -tb config/external/icu/data/icudt67l.dat config/external/icu/data/icudt67b.dat
|
|
|
|
rm -f config/external/icu/data/icudt*l.dat
|
|
|
|
popd
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%make_build
|
|
|
|
|
|
|
|
%install
|
|
|
|
%make_install
|
|
|
|
|
|
|
|
# Fix permissions
|
|
|
|
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
|
|
|
|
|
|
|
|
# Avoid multilib conflicts
|
|
|
|
case `uname -i` in
|
|
|
|
i386 | ppc | s390 | sparc )
|
|
|
|
wordsize="32"
|
|
|
|
;;
|
|
|
|
x86_64 | ppc64 | s390x | sparc64 )
|
|
|
|
wordsize="64"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
wordsize=""
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
if test -n "$wordsize"
|
|
|
|
then
|
|
|
|
mv %{buildroot}%{_includedir}/mozjs-%{major}/js-config.h \
|
|
|
|
%{buildroot}%{_includedir}/mozjs-%{major}/js-config-$wordsize.h
|
|
|
|
|
|
|
|
cat >%{buildroot}%{_includedir}/mozjs-%{major}/js-config.h <<EOF
|
|
|
|
#ifndef JS_CONFIG_H_MULTILIB
|
|
|
|
#define JS_CONFIG_H_MULTILIB
|
|
|
|
|
|
|
|
#include <bits/wordsize.h>
|
|
|
|
|
|
|
|
#if __WORDSIZE == 32
|
|
|
|
# include "js-config-32.h"
|
|
|
|
#elif __WORDSIZE == 64
|
|
|
|
# include "js-config-64.h"
|
|
|
|
#else
|
|
|
|
# error "unexpected value for __WORDSIZE macro"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|
|
|
|
EOF
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Remove unneeded files
|
|
|
|
rm %{buildroot}%{_bindir}/js%{major}-config
|
|
|
|
rm %{buildroot}%{_libdir}/libjs_static.ajs
|
|
|
|
|
|
|
|
# Rename library and create symlinks, following fix-soname.patch
|
|
|
|
mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
|
|
|
|
%{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
|
|
|
|
ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
|
|
|
|
ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
|
|
|
|
|
|
|
|
%check
|
|
|
|
# Run SpiderMonkey tests
|
|
|
|
%if 0%{?require_tests}
|
|
|
|
PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major}
|
|
|
|
%else
|
|
|
|
PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} || :
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Run basic JIT tests
|
|
|
|
%if 0%{?require_tests}
|
|
|
|
PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic
|
|
|
|
%else
|
|
|
|
PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic || :
|
|
|
|
%endif
|
|
|
|
|
|
|
|
%ldconfig_scriptlets
|
|
|
|
|
|
|
|
%files
|
|
|
|
%doc README.html
|
|
|
|
%license LICENSE
|
|
|
|
%{_libdir}/libmozjs-%{major}.so.0*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_bindir}/js%{major}
|
|
|
|
%{_libdir}/libmozjs-%{major}.so
|
|
|
|
%{_libdir}/pkgconfig/*.pc
|
|
|
|
%{_includedir}/mozjs-%{major}/
|
|
|
|
|
|
|
|
%changelog
|
2021-04-12 16:15:35 +00:00
|
|
|
* Mon Apr 12 2021 Jan Horak <jhorak@redhat.com> - 78.9.0-3
|
|
|
|
- Removed autoconf213 dependency
|
|
|
|
|
2021-03-30 18:38:10 +00:00
|
|
|
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com> - 78.9.0-2
|
|
|
|
- Rebuilt for removed libstdc++ symbol (#1937698)
|
|
|
|
|
2021-03-25 08:36:57 +00:00
|
|
|
* Thu Mar 25 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.9.0-1
|
|
|
|
- Update to 78.9.0
|
|
|
|
- Rebase patches
|
|
|
|
- Replace armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS with patch from Debian to include vfp defs
|
|
|
|
|
2021-02-23 11:47:26 +00:00
|
|
|
* Tue Feb 23 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.8.0-2
|
|
|
|
- Don't BR nasm on RHEL
|
|
|
|
|
2021-02-23 08:13:33 +00:00
|
|
|
* Tue Feb 23 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.8.0-1
|
|
|
|
- Update to 78.8.0
|
|
|
|
- Add fix for MOZBZ#1644600
|
|
|
|
|
2021-01-26 08:01:01 +00:00
|
|
|
* Tue Jan 26 2021 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.7.0-1
|
|
|
|
- Update to 78.7.0
|
|
|
|
|
2020-12-15 14:34:24 +00:00
|
|
|
* Tue Dec 15 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.6.0-1
|
|
|
|
- Update to 78.6.0
|
|
|
|
|
2020-11-17 19:25:36 +00:00
|
|
|
* Tue Nov 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.5.0-1
|
|
|
|
- Update to 78.5.0
|
|
|
|
- Build with: --enable-optimize, --disable-debug
|
|
|
|
|
2020-10-19 09:14:07 +00:00
|
|
|
* Mon Oct 19 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.4.0-1
|
|
|
|
- Update to 78.4.0
|
|
|
|
|
2020-09-22 06:23:25 +00:00
|
|
|
* Tue Sep 22 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.3.0-1
|
|
|
|
- Update to 78.3.0
|
|
|
|
|
2020-08-24 18:31:15 +00:00
|
|
|
* Mon Aug 24 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.2.0-1
|
|
|
|
- Update to 78.2.0
|
|
|
|
|
2020-08-17 18:05:04 +00:00
|
|
|
* Mon Aug 17 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.1.0-2
|
|
|
|
- Add BR: python3-setuptools
|
|
|
|
- Backport fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1654696
|
|
|
|
- Set CARGO_PROFILE_RELEASE_LTO=true
|
|
|
|
|
2020-08-03 15:36:59 +00:00
|
|
|
* Tue Jul 28 2020 Frantisek Zatloukal <fzatlouk@redhat.com> - 78.1.0-1
|
|
|
|
- Initial mozjs78 package based on mozjs68
|