Blame SPECS/mozjs52.spec

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