Blame SPECS/mozjs52.spec

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