Blame SPECS/mozjs52.spec

fd8fb9
%global major 52
fd8fb9
fd8fb9
# Require libatomic for ppc
fd8fb9
%ifarch ppc
fd8fb9
%global system_libatomic 1
fd8fb9
%endif
fd8fb9
fd8fb9
# Big endian platforms
fd8fb9
%ifarch ppc ppc64 s390 s390x
fd8fb9
%global big_endian 1
fd8fb9
%endif
fd8fb9
fd8fb9
Name:           mozjs%{major}
fd8fb9
Version:        52.9.0
fd8fb9
Release:        2%{?dist}
fd8fb9
Summary:        SpiderMonkey JavaScript library
fd8fb9
fd8fb9
License:        MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2.1 and LGPLv2.1+ and AFL and ASL 2.0
fd8fb9
URL:            https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
fd8fb9
Source0:        https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
fd8fb9
fd8fb9
# Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
fd8fb9
Patch0001:      fix-soname.patch
fd8fb9
Patch0002:      copy-headers.patch
fd8fb9
Patch0003:      tests-increase-timeout.patch
fd8fb9
Patch0004:      tests-snans-be.patch
fd8fb9
fd8fb9
# Disable JS Helper threads on ppc64le
fd8fb9
# https://bugzilla.redhat.com/show_bug.cgi?id=1523121
fd8fb9
Patch0010:      disable-extra-threads.patch
fd8fb9
fd8fb9
# Patches from https://github.com/ptomato/mozjs / Debian mozjs52_52.3.1-4.debian.tar.xz
fd8fb9
Patch0101:      disable-mozglue.patch
fd8fb9
Patch0104:      include-configure-script.patch
fd8fb9
fd8fb9
# Patches from Fedora firefox package:
fd8fb9
Patch18:        xulrunner-24.0-jemalloc-ppc.patch
fd8fb9
Patch19:        xulrunner-24.0-s390-inlines.patch
fd8fb9
Patch26:        build-icu-big-endian.patch
fd8fb9
Patch36:        build-missing-xlocale-h.patch
fd8fb9
Patch304:       mozilla-1253216.patch
fd8fb9
fd8fb9
BuildRequires:  autoconf213
fd8fb9
BuildRequires:  perl-devel
fd8fb9
BuildRequires:  pkgconfig(libffi)
fd8fb9
BuildRequires:  pkgconfig(zlib)
fd8fb9
BuildRequires:  python2-devel
fd8fb9
BuildRequires:  readline-devel
fd8fb9
BuildRequires:  /usr/bin/zip
fd8fb9
%if 0%{?system_libatomic}
fd8fb9
BuildRequires:  libatomic
fd8fb9
%endif
fd8fb9
fd8fb9
# Firefox does not allow to build with system version of jemalloc
fd8fb9
Provides: bundled(jemalloc) = 4.3.1
fd8fb9
fd8fb9
%description
fd8fb9
SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
fd8fb9
JavaScript. It is intended to be embedded in other applications
fd8fb9
that provide host environments for JavaScript.
fd8fb9
fd8fb9
%package        devel
fd8fb9
Summary:        Development files for %{name}
fd8fb9
Requires:       %{name}%{?_isa} = %{version}-%{release}
fd8fb9
fd8fb9
%description    devel
fd8fb9
The %{name}-devel package contains libraries and header files for
fd8fb9
developing applications that use %{name}.
fd8fb9
fd8fb9
%prep
fd8fb9
%setup -q -n firefox-%{version}esr/js/src
fd8fb9
fd8fb9
pushd ../..
fd8fb9
%patch0001 -p1
fd8fb9
%patch0002 -p1
fd8fb9
%patch0003 -p1
fd8fb9
%patch0004 -p1
fd8fb9
fd8fb9
%patch0010 -p1
fd8fb9
fd8fb9
%patch0101 -p1
fd8fb9
%patch0104 -p1
fd8fb9
fd8fb9
%patch18 -p1 -b .jemalloc-ppc
fd8fb9
%patch19 -p2 -b .s390-inlines
fd8fb9
fd8fb9
# Patch for big endian platforms only
fd8fb9
%if 0%{?big_endian}
fd8fb9
%patch26 -p1 -b .icu
fd8fb9
%patch36 -p2 -b .xlocale
fd8fb9
%endif
fd8fb9
fd8fb9
%patch304 -p1 -b .1253216
fd8fb9
fd8fb9
# make sure we don't ever accidentally link against bundled security libs
fd8fb9
rm -rf security/
fd8fb9
popd
fd8fb9
fd8fb9
# Remove zlib directory (to be sure using system version)
fd8fb9
rm -rf ../../modules/zlib
fd8fb9
fd8fb9
%build
fd8fb9
# Disable null pointer gcc6 optimization in gcc6 (rhbz#1328045)
fd8fb9
export CFLAGS="%{optflags} -fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks"
fd8fb9
export CXXFLAGS="$CFLAGS"
fd8fb9
export LINKFLAGS="%{?__global_ldflags}"
fd8fb9
export PYTHON="%{__python2}"
fd8fb9
# Keep using Python 2 for the build for now
fd8fb9
# https://bugzilla.redhat.com/show_bug.cgi?id=1610009
fd8fb9
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
fd8fb9
fd8fb9
autoconf-2.13
fd8fb9
%configure \
fd8fb9
  --without-system-icu \
fd8fb9
  --enable-posix-nspr-emulation \
fd8fb9
  --with-system-zlib \
fd8fb9
  --enable-tests \
fd8fb9
  --disable-strip \
fd8fb9
  --with-intl-api \
fd8fb9
  --enable-readline \
fd8fb9
  --enable-shared-js \
fd8fb9
  --disable-optimize \
fd8fb9
  --enable-pie \
fd8fb9
%ifarch s390 s390x
fd8fb9
  --disable-jemalloc \
fd8fb9
%endif
fd8fb9
%ifarch %{arm} aarch64 ppc %{power64}
fd8fb9
  --disable-ion
fd8fb9
%endif
fd8fb9
fd8fb9
%if 0%{?big_endian}
fd8fb9
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
fd8fb9
pushd ../..
fd8fb9
  ./mach python intl/icu_sources_data.py .
fd8fb9
  ls -l config/external/icu/data
fd8fb9
  rm -f config/external/icu/data/icudt*l.dat
fd8fb9
popd
fd8fb9
%endif
fd8fb9
fd8fb9
%make_build
fd8fb9
fd8fb9
%install
fd8fb9
# Keep using Python 2 for the build for now
fd8fb9
# https://bugzilla.redhat.com/show_bug.cgi?id=1610009
fd8fb9
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
fd8fb9
fd8fb9
%make_install
fd8fb9
fd8fb9
# Fix permissions
fd8fb9
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
fd8fb9
fd8fb9
# Remove unneeded files
fd8fb9
rm %{buildroot}%{_bindir}/js%{major}-config
fd8fb9
rm %{buildroot}%{_libdir}/libjs_static.ajs
fd8fb9
fd8fb9
# Rename library and create symlinks, following fix-soname.patch
fd8fb9
mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
fd8fb9
   %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
fd8fb9
ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
fd8fb9
ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
fd8fb9
fd8fb9
%check
fd8fb9
# Run SpiderMonkey tests
ec154f
python2 tests/jstests.py -d -s -t 1800 --no-progress ../../js/src/js/src/shell/js \
fd8fb9
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390
fd8fb9
;
fd8fb9
%else
fd8fb9
|| :
fd8fb9
%endif
fd8fb9
fd8fb9
# Run basic JIT tests
ec154f
python2 jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/js/src/shell/js basic \
fd8fb9
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390
fd8fb9
;
fd8fb9
%else
fd8fb9
|| :
fd8fb9
%endif
fd8fb9
fd8fb9
%ldconfig_scriptlets
fd8fb9
fd8fb9
%files
fd8fb9
%doc README.html
fd8fb9
%{_libdir}/libmozjs-%{major}.so.0*
fd8fb9
fd8fb9
%files devel
fd8fb9
%{_bindir}/js%{major}
fd8fb9
%{_libdir}/libmozjs-%{major}.so
fd8fb9
%{_libdir}/pkgconfig/*.pc
fd8fb9
%{_includedir}/mozjs-%{major}/
fd8fb9
fd8fb9
%changelog
fd8fb9
* Mon Feb 10 2020 Kalev Lember <klember@redhat.com> - 52.9.0-2
fd8fb9
- Rebuild for CET notes
fd8fb9
- Resolves: #1657318
fd8fb9
fd8fb9
* Wed Jul 25 2018 Kalev Lember <klember@redhat.com> - 52.9.0-1
fd8fb9
- Update to 52.9.0
fd8fb9
fd8fb9
* Mon Jun 11 2018 Ray Strode <rstrode@redhat.com> - 52.8.0-2
fd8fb9
- safeguard against linking against bundled nss
fd8fb9
  Related: #1563708
fd8fb9
fd8fb9
* Fri May 11 2018 Kalev Lember <klember@redhat.com> - 52.8.0-1
fd8fb9
- Update to 52.8.0
fd8fb9
- Fix the build on ppc
fd8fb9
- Disable JS Helper threads on ppc64le (#1523121)
fd8fb9
fd8fb9
* Sat Apr 07 2018 Kalev Lember <klember@redhat.com> - 52.7.3-1
fd8fb9
- Update to 52.7.3
fd8fb9
fd8fb9
* Tue Mar 20 2018 Kalev Lember <klember@redhat.com> - 52.7.2-1
fd8fb9
- Update to 52.7.2
fd8fb9
- Switch to %%ldconfig_scriptlets
fd8fb9
fd8fb9
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 52.6.0-2
fd8fb9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
fd8fb9
fd8fb9
* Tue Jan 23 2018 Kalev Lember <klember@redhat.com> - 52.6.0-1
fd8fb9
- Update to 52.6.0
fd8fb9
fd8fb9
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-5
fd8fb9
- SpiderMonkey tests have regressions on %%{power64}, too
fd8fb9
fd8fb9
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-4
fd8fb9
- SpiderMonkey tests have regressions on big endian platforms
fd8fb9
fd8fb9
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-3
fd8fb9
- SpiderMonkey tests do not fail on any arch
fd8fb9
- Basic JIT tests are failing on s390 arches, only
fd8fb9
- Use macro for ppc64 arches
fd8fb9
- Run tests using Python2 explicitly
fd8fb9
- Simplify %%check
fd8fb9
- Use the %%{major} macro consequently
fd8fb9
- Replace %%define with %%global
fd8fb9
fd8fb9
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-2
fd8fb9
- Use macro for Python 2 interpreter
fd8fb9
- Use proper export and quoting
fd8fb9
fd8fb9
* Tue Nov 14 2017 Kalev Lember <klember@redhat.com> - 52.5.0-1
fd8fb9
- Update to 52.5.0
fd8fb9
fd8fb9
* Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-3
fd8fb9
- Include standalone /usr/bin/js52 interpreter
fd8fb9
fd8fb9
* Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-2
fd8fb9
- Various secondary arch fixes
fd8fb9
fd8fb9
* Thu Sep 28 2017 Kalev Lember <klember@redhat.com> - 52.4.0-1
fd8fb9
- Update to 52.4.0
fd8fb9
fd8fb9
* Wed Sep 20 2017 Kalev Lember <klember@redhat.com> - 52.3.0-1
fd8fb9
- Initial Fedora packaging, based on earlier mozjs45 work