2019-11-12 22:39:31 +00:00
|
|
|
%global major 68
|
|
|
|
|
|
|
|
# LTO - Enable in Release builds, but consider disabling for development as it increases compile time
|
2019-11-19 10:08:59 +00:00
|
|
|
%global build_with_lto 1
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
%if 0%{?build_with_lto}
|
|
|
|
%global optflags %{optflags} -flto
|
|
|
|
%global build_ldflags %{build_ldflags} -flto
|
|
|
|
%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}
|
2019-12-07 12:48:01 +00:00
|
|
|
Version: 68.3.0
|
|
|
|
Release: 1%{?dist}
|
2019-11-12 22:39:31 +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
|
|
|
|
|
2019-11-19 10:08:59 +00:00
|
|
|
# Patches from Debian mozjs60, rebased for mozjs68:
|
|
|
|
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
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
|
|
|
|
Patch12: emitter.patch
|
|
|
|
Patch13: emitter_test.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
|
2019-11-17 19:42:08 +00:00
|
|
|
|
|
|
|
# armv7 fixes
|
2019-11-17 14:41:13 +00:00
|
|
|
Patch16: rust_armv7.patch
|
2019-11-17 19:42:08 +00:00
|
|
|
Patch17: armv7_disable_WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS.patch
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
# Patches from Fedora firefox package:
|
|
|
|
Patch26: build-icu-big-endian.patch
|
|
|
|
|
|
|
|
# Support Python 3 in js tests
|
|
|
|
Patch30: jstests_python-3.patch
|
|
|
|
|
|
|
|
BuildRequires: autoconf213
|
|
|
|
BuildRequires: cargo
|
|
|
|
BuildRequires: clang-devel
|
|
|
|
BuildRequires: gcc
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: llvm
|
|
|
|
BuildRequires: llvm-devel
|
|
|
|
BuildRequires: perl-devel
|
|
|
|
BuildRequires: pkgconfig(libffi)
|
|
|
|
BuildRequires: pkgconfig(zlib)
|
|
|
|
# Build requires Python 2, tests are patched to run with Python 3
|
|
|
|
BuildRequires: python2-devel
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
BuildRequires: python3-six
|
|
|
|
BuildRequires: readline-devel
|
|
|
|
BuildRequires: rust
|
|
|
|
BuildRequires: zip
|
|
|
|
%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 ../..
|
2019-11-19 10:08:59 +00:00
|
|
|
%patch01 -p1
|
|
|
|
%patch02 -p1
|
|
|
|
%patch03 -p1
|
|
|
|
%patch09 -p1
|
|
|
|
%patch10 -p1
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
%patch12 -p1
|
|
|
|
%patch13 -p1
|
|
|
|
%patch14 -p1
|
|
|
|
%patch15 -p1
|
|
|
|
|
2019-11-17 14:41:13 +00:00
|
|
|
%ifarch armv7hl
|
2019-11-17 19:42:08 +00:00
|
|
|
# Correct armv7hl rust triple seems to be armv7-unknown-linux-gnueabihf and not armv7-unknown-linux-gnueabi
|
2019-11-14 12:50:00 +00:00
|
|
|
%patch16 -p1
|
2019-11-17 19:42:08 +00:00
|
|
|
# Disable WASM_EMULATE_ARM_UNALIGNED_FP_ACCESS as it causes the compilation to fail
|
|
|
|
# https://bugzilla.mozilla.org/show_bug.cgi?id=1526653
|
|
|
|
%patch17 -p1
|
2019-11-14 12:50:00 +00:00
|
|
|
%endif
|
|
|
|
|
2019-11-12 22:39:31 +00:00
|
|
|
# Patch for big endian platforms only
|
|
|
|
%if 0%{?big_endian}
|
|
|
|
%patch26 -p1 -b .icu
|
|
|
|
%endif
|
|
|
|
|
|
|
|
# Execute tests with Python 3
|
|
|
|
%patch30 -p1
|
|
|
|
|
|
|
|
# make sure we don't ever accidentally link against bundled security libs
|
|
|
|
rm -rf security/
|
|
|
|
popd
|
|
|
|
|
|
|
|
# Remove zlib directory (to be sure using system version)
|
|
|
|
rm -rf ../../modules/zlib
|
|
|
|
|
|
|
|
%build
|
|
|
|
# Prefer GCC, because clang doesn't support -fstack-clash-protection yet
|
|
|
|
export CC=gcc
|
|
|
|
export CXX=g++
|
|
|
|
|
|
|
|
%if 0%{?build_with_lto}
|
|
|
|
export AR=%{_bindir}/gcc-ar
|
|
|
|
export RANLIB=%{_bindir}/gcc-ranlib
|
|
|
|
export NM=%{_bindir}/gcc-nm
|
|
|
|
%endif
|
|
|
|
|
|
|
|
export CFLAGS="%{optflags}"
|
|
|
|
export CXXFLAGS="$CFLAGS"
|
|
|
|
export LINKFLAGS="%{?__global_ldflags}"
|
|
|
|
export PYTHON="%{__python2}"
|
|
|
|
|
|
|
|
autoconf-2.13
|
|
|
|
%configure \
|
|
|
|
--without-system-icu \
|
|
|
|
--enable-posix-nspr-emulation \
|
|
|
|
--with-system-zlib \
|
|
|
|
--disable-tests \
|
|
|
|
--disable-strip \
|
|
|
|
--with-intl-api \
|
|
|
|
--enable-readline \
|
|
|
|
--enable-shared-js \
|
|
|
|
--disable-optimize \
|
|
|
|
--enable-pie \
|
|
|
|
--disable-jemalloc \
|
|
|
|
|
|
|
|
%if 0%{?big_endian}
|
|
|
|
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
|
|
|
|
pushd ../..
|
|
|
|
./mach python intl/icu_sources_data.py .
|
|
|
|
ls -l config/external/icu/data
|
|
|
|
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
|
2019-11-20 11:40:39 +00:00
|
|
|
PYTHONPATH=tests/lib %{__python3} tests/jstests.py -d -s -t 1800 --no-progress --wpt=disabled ../../js/src/dist/bin/js%{major} \
|
|
|
|
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le
|
|
|
|
;
|
|
|
|
%else
|
|
|
|
|| :
|
|
|
|
%endif
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
# Run basic JIT tests
|
2019-11-20 11:40:39 +00:00
|
|
|
PYTHONPATH=tests/lib %{__python3} jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/dist/bin/js%{major} basic \
|
|
|
|
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le
|
|
|
|
;
|
|
|
|
%else
|
|
|
|
|| :
|
|
|
|
%endif
|
2019-11-12 22:39:31 +00:00
|
|
|
|
|
|
|
%ldconfig_scriptlets
|
|
|
|
|
|
|
|
%files
|
|
|
|
%doc README.html
|
|
|
|
%{_libdir}/libmozjs-%{major}.so.0*
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
%{_bindir}/js%{major}
|
|
|
|
%{_libdir}/libmozjs-%{major}.so
|
|
|
|
%{_libdir}/pkgconfig/*.pc
|
|
|
|
%{_includedir}/mozjs-%{major}/
|
|
|
|
|
|
|
|
%changelog
|
2019-12-07 12:48:01 +00:00
|
|
|
* Sat Dec 07 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.3.0-1
|
|
|
|
- Update to 68.3.0
|
|
|
|
|
2019-11-20 11:40:39 +00:00
|
|
|
* Wed Nov 20 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-5
|
|
|
|
- Don't enforce tests to pass on s390 and s390x again
|
|
|
|
|
2019-11-19 10:08:59 +00:00
|
|
|
* Tue Nov 19 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-4
|
|
|
|
- Enable LTO
|
|
|
|
- Enforce SpiderMonkey tests in check section on all architectures
|
|
|
|
|
2019-11-17 19:42:08 +00:00
|
|
|
* Sun Nov 17 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-3
|
|
|
|
- Fix armv7 build
|
|
|
|
|
2019-11-14 14:02:24 +00:00
|
|
|
* Thu Nov 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-2
|
|
|
|
- Fix s390x build
|
|
|
|
- Exclude armv7 for now, see comment up in the spec
|
|
|
|
|
2019-11-12 22:39:31 +00:00
|
|
|
* Mon Nov 04 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 68.2.0-1
|
|
|
|
- Initial mozjs68 package based on mozjs60
|