Blame SPECS/mozjs60.spec

3de678
%global major 60
3de678
3de678
# Require libatomic for ppc
3de678
%ifarch ppc
3de678
%global system_libatomic 1
3de678
%endif
3de678
3de678
# Big endian platforms
3de678
%ifarch ppc ppc64 s390 s390x
3de678
%global big_endian 1
3de678
%endif
3de678
3de678
Name:           mozjs%{major}
3de678
Version:        60.9.0
3de678
Release:        4%{?dist}
3de678
Summary:        SpiderMonkey JavaScript library
3de678
3de678
License:        MPLv2.0 and MPLv1.1 and BSD and GPLv2+ and GPLv3+ and LGPLv2+ and AFL and ASL 2.0
3de678
URL:            https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey
3de678
Source0:        https://ftp.mozilla.org/pub/firefox/releases/%{version}esr/source/firefox-%{version}esr.source.tar.xz
3de678
3de678
# Patches from Debian mozjs52_52.3.1-4.debian.tar.xz:
3de678
Patch0001:      fix-soname.patch
3de678
Patch0002:      copy-headers.patch
3de678
Patch0003:      tests-increase-timeout.patch
3de678
Patch0008:      Always-use-the-equivalent-year-to-determine-the-time-zone.patch
3de678
Patch0009:      icu_sources_data.py-Decouple-from-Mozilla-build-system.patch
3de678
Patch0010:      icu_sources_data-Write-command-output-to-our-stderr.patch
3de678
Patch0011:      tests-For-tests-that-are-skipped-on-64-bit-mips64-is-also.patch
3de678
3de678
# Build fixes - https://hg.mozilla.org/mozilla-central/rev/ca36a6c4f8a4a0ddaa033fdbe20836d87bbfb873
3de678
Patch12:        emitter.patch
3de678
Patch13:        emitter_test.patch
3de678
Patch14:        init_patch.patch
3de678
3de678
# s390x fixes:
3de678
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/enddianness.patch
3de678
Patch15:        enddianness.patch
3de678
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/jsproperty-endian.patch
3de678
Patch16:        jsproperty-endian.patch
3de678
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/tests-Skip-a-test-on-s390x.patch
3de678
Patch17:        tests-Skip-a-test-on-s390x.patch
3de678
# https://salsa.debian.org/gnome-team/mozjs60/blob/debian/master/debian/patches/tests-Expect-a-test-to-fail-on-big-endian.patch
3de678
Patch18:        tests-Expect-a-test-to-fail-on-big-endian.patch
3de678
3de678
# Patches from Fedora firefox package:
3de678
Patch26:        build-icu-big-endian.patch
3de678
3de678
# aarch64 fixes for -O2
3de678
Patch30:        Save-x28-before-clobbering-it-in-the-regex-compiler.patch
3de678
Patch31:        Save-and-restore-non-volatile-x28-on-ARM64-for-generated-unboxed-object-constructor.patch
3de678
3de678
BuildRequires:  autoconf213
3de678
BuildRequires:  gcc
3de678
BuildRequires:  gcc-c++
3de678
BuildRequires:  perl-devel
3de678
BuildRequires:  pkgconfig(libffi)
3de678
BuildRequires:  pkgconfig(zlib)
3de678
BuildRequires:  python2-devel
3de678
BuildRequires:  readline-devel
3de678
BuildRequires:  /usr/bin/zip
3de678
%if 0%{?system_libatomic}
3de678
BuildRequires:  libatomic
3de678
%endif
3de678
3de678
# Firefox does not allow to build with system version of jemalloc
3de678
Provides: bundled(jemalloc) = 4.3.1
3de678
3de678
%description
3de678
SpiderMonkey is the code-name for Mozilla Firefox's C++ implementation of
3de678
JavaScript. It is intended to be embedded in other applications
3de678
that provide host environments for JavaScript.
3de678
3de678
%package        devel
3de678
Summary:        Development files for %{name}
3de678
Requires:       %{name}%{?_isa} = %{version}-%{release}
3de678
3de678
%description    devel
3de678
The %{name}-devel package contains libraries and header files for
3de678
developing applications that use %{name}.
3de678
3de678
%prep
3de678
%setup -q -n firefox-%{version}/js/src
3de678
3de678
pushd ../..
3de678
%patch0001 -p1
3de678
%patch0002 -p1
3de678
%patch0003 -p1
3de678
%patch0008 -p1
3de678
%patch0009 -p1
3de678
%patch0010 -p1
3de678
%patch0011 -p1
3de678
3de678
%patch12 -p1
3de678
%patch13 -p1
3de678
%patch14 -p1
3de678
3de678
# s390x fixes
3de678
%patch15 -p1
3de678
%patch16 -p1
3de678
%patch17 -p1
3de678
%patch18 -p1
3de678
3de678
# Patch for big endian platforms only
3de678
%if 0%{?big_endian}
3de678
%patch26 -p1 -b .icu
3de678
%endif
3de678
3de678
# aarch64 -O2 fixes
3de678
%ifarch aarch64
3de678
%patch30 -p1
3de678
%patch31 -p1
3de678
%endif
3de678
3de678
# make sure we don't ever accidentally link against bundled security libs
3de678
rm -rf security/
3de678
popd
3de678
3de678
# Remove zlib directory (to be sure using system version)
3de678
rm -rf ../../modules/zlib
3de678
3de678
%build
3de678
export CFLAGS="%{optflags}"
3de678
3de678
export CXXFLAGS="$CFLAGS"
3de678
export LINKFLAGS="%{?__global_ldflags}"
3de678
export PYTHON="%{__python2}"
3de678
# Keep using Python 2 for the build for now
3de678
# https://bugzilla.redhat.com/show_bug.cgi?id=1610009
3de678
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
3de678
3de678
autoconf-2.13
3de678
%configure \
3de678
  --without-system-icu \
3de678
  --enable-posix-nspr-emulation \
3de678
  --with-system-zlib \
3de678
  --enable-tests \
3de678
  --disable-strip \
3de678
  --with-intl-api \
3de678
  --enable-readline \
3de678
  --enable-shared-js \
3de678
  --disable-optimize \
3de678
  --enable-pie \
3de678
  --disable-jemalloc \
3de678
3de678
%if 0%{?big_endian}
3de678
echo "Generate big endian version of config/external/icu/data/icud58l.dat"
3de678
pushd ../..
3de678
  ./mach python intl/icu_sources_data.py .
3de678
  ls -l config/external/icu/data
3de678
  rm -f config/external/icu/data/icudt*l.dat
3de678
popd
3de678
%endif
3de678
3de678
%make_build
3de678
3de678
%install
3de678
# Keep using Python 2 for the build for now
3de678
# https://bugzilla.redhat.com/show_bug.cgi?id=1610009
3de678
export RHEL_ALLOW_PYTHON2_FOR_BUILD=1
3de678
3de678
%make_install
3de678
3de678
# Fix permissions
3de678
chmod -x %{buildroot}%{_libdir}/pkgconfig/*.pc
3de678
3de678
# Avoid multilib conflicts
3de678
case `uname -i` in
3de678
  i386 | ppc | s390 | sparc )
3de678
    wordsize="32"
3de678
    ;;
3de678
  x86_64 | ppc64 | s390x | sparc64 )
3de678
    wordsize="64"
3de678
    ;;
3de678
  *)
3de678
    wordsize=""
3de678
    ;;
3de678
esac
3de678
3de678
if test -n "$wordsize"
3de678
then
3de678
  mv %{buildroot}%{_includedir}/mozjs-60/js-config.h \
3de678
     %{buildroot}%{_includedir}/mozjs-60/js-config-$wordsize.h
3de678
3de678
  cat >%{buildroot}%{_includedir}/mozjs-60/js-config.h <
3de678
#ifndef JS_CONFIG_H_MULTILIB
3de678
#define JS_CONFIG_H_MULTILIB
3de678
3de678
#include <bits/wordsize.h>
3de678
3de678
#if __WORDSIZE == 32
3de678
# include "js-config-32.h"
3de678
#elif __WORDSIZE == 64
3de678
# include "js-config-64.h"
3de678
#else
3de678
# error "unexpected value for __WORDSIZE macro"
3de678
#endif
3de678
3de678
#endif
3de678
EOF
3de678
3de678
fi
3de678
3de678
# Remove unneeded files
3de678
rm %{buildroot}%{_bindir}/js%{major}
3de678
rm %{buildroot}%{_bindir}/js%{major}-config
3de678
rm %{buildroot}%{_libdir}/libjs_static.ajs
3de678
3de678
# Rename library and create symlinks, following fix-soname.patch
3de678
mv %{buildroot}%{_libdir}/libmozjs-%{major}.so \
3de678
   %{buildroot}%{_libdir}/libmozjs-%{major}.so.0.0.0
3de678
ln -s libmozjs-%{major}.so.0.0.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so.0
3de678
ln -s libmozjs-%{major}.so.0 %{buildroot}%{_libdir}/libmozjs-%{major}.so
3de678
3de678
%check
3de678
# Run SpiderMonkey tests
3de678
/usr/bin/python2-for-tests tests/jstests.py -d -s -t 1800 --no-progress ../../js/src/js/src/shell/js \
3de678
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390x
3de678
;
3de678
%else
3de678
|| :
3de678
%endif
3de678
3de678
# Run basic JIT tests
3de678
/usr/bin/python2-for-tests jit-test/jit_test.py -s -t 1800 --no-progress ../../js/src/js/src/shell/js basic \
3de678
%ifarch %{ix86} x86_64 %{arm} aarch64 ppc ppc64le s390x
3de678
;
3de678
%else
3de678
|| :
3de678
%endif
3de678
3de678
%ldconfig_scriptlets
3de678
3de678
%files
3de678
%doc README.html
3de678
%{_libdir}/libmozjs-%{major}.so.0*
3de678
3de678
%files devel
3de678
%{_libdir}/libmozjs-%{major}.so
3de678
%{_libdir}/pkgconfig/*.pc
3de678
%{_includedir}/mozjs-%{major}/
3de678
3de678
%changelog
3de678
* Mon Feb 17 2020 Kalev Lember <klember@redhat.com> - 60.9.0-4
3de678
- Update enddianness.patch with more s390x fixes
3de678
- Enable tests on s390x again
3de678
- Resolves: #1803824
3de678
3de678
* Tue Sep 10 2019 Kalev Lember <klember@redhat.com> - 60.9.0-3
3de678
- Fix multilib conflicts in js-config.h
3de678
3de678
* Sat Sep 07 2019 Kalev Lember <klember@redhat.com> - 60.9.0-2
3de678
- Backport patches for s390x support
3de678
- Resolves: #1746889
3de678
3de678
* Tue Sep 03 2019 Kalev Lember <klember@redhat.com> - 60.9.0-1
3de678
- Update to 60.9.0
3de678
3de678
* Wed May 29 2019 Kalev Lember <klember@redhat.com> - 60.7.0-2
3de678
- Enable gating
3de678
3de678
* Tue May 21 2019 Kalev Lember <klember@redhat.com> - 60.7.0-1
3de678
- Update to 60.7.0
3de678
3de678
* Mon Apr 15 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.6.1-2
3de678
- Backport two Firefox 61 patches and allow compiler optimizations on aarch64
3de678
3de678
* Sun Apr 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.6.1-1
3de678
- Update to 60.6.1
3de678
3de678
* Thu Feb 21 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-5
3de678
- Re-enable null pointer gcc optimization
3de678
3de678
* Sun Feb 17 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 60.4.0-4
3de678
- Rebuild for readline 8.0
3de678
3de678
* Thu Feb 14 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-3
3de678
- Build aarch64 with -O0 because of rhbz#1676292
3de678
3de678
* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 60.4.0-2
3de678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
3de678
3de678
* Wed Jan 02 2019 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.4.0-1
3de678
- Update to 60.4.0
3de678
3de678
* Mon Nov 12 2018 Kalev Lember <klember@redhat.com> - 60.3.0-1
3de678
- Update to 60.3.0
3de678
3de678
* Thu Oct 04 2018 Kalev Lember <klember@redhat.com> - 60.2.2-1
3de678
- Update to 60.2.2
3de678
3de678
* Fri Sep 28 2018 Kalev Lember <klember@redhat.com> - 60.2.1-1
3de678
- Update to 60.2.1
3de678
3de678
* Tue Sep 11 2018 Kalev Lember <klember@redhat.com> - 60.2.0-1
3de678
- Update to 60.2.0
3de678
3de678
* Tue Sep 04 2018 Frantisek Zatloukal <fzatlouk@redhat.com> - 60.1.0-1
3de678
- Update to 60.1.0
3de678
3de678
* Wed Jul 25 2018 Kalev Lember <klember@redhat.com> - 52.9.0-1
3de678
- Update to 52.9.0
3de678
3de678
* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 52.8.0-3
3de678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
3de678
3de678
* Mon Jun 11 2018 Ray Strode <rstrode@redhat.com> - 52.8.0-2
3de678
- safeguard against linking against bundled nss
3de678
  Related: #1563708
3de678
3de678
* Fri May 11 2018 Kalev Lember <klember@redhat.com> - 52.8.0-1
3de678
- Update to 52.8.0
3de678
- Fix the build on ppc
3de678
- Disable JS Helper threads on ppc64le (#1523121)
3de678
3de678
* Sat Apr 07 2018 Kalev Lember <klember@redhat.com> - 52.7.3-1
3de678
- Update to 52.7.3
3de678
3de678
* Tue Mar 20 2018 Kalev Lember <klember@redhat.com> - 52.7.2-1
3de678
- Update to 52.7.2
3de678
- Switch to %%ldconfig_scriptlets
3de678
3de678
* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 52.6.0-2
3de678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
3de678
3de678
* Tue Jan 23 2018 Kalev Lember <klember@redhat.com> - 52.6.0-1
3de678
- Update to 52.6.0
3de678
3de678
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-5
3de678
- SpiderMonkey tests have regressions on %%{power64}, too
3de678
3de678
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-4
3de678
- SpiderMonkey tests have regressions on big endian platforms
3de678
3de678
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-3
3de678
- SpiderMonkey tests do not fail on any arch
3de678
- Basic JIT tests are failing on s390 arches, only
3de678
- Use macro for ppc64 arches
3de678
- Run tests using Python2 explicitly
3de678
- Simplify %%check
3de678
- Use the %%{major} macro consequently
3de678
- Replace %%define with %%global
3de678
3de678
* Fri Nov 24 2017 Björn Esser <besser82@fedoraproject.org> - 52.5.0-2
3de678
- Use macro for Python 2 interpreter
3de678
- Use proper export and quoting
3de678
3de678
* Tue Nov 14 2017 Kalev Lember <klember@redhat.com> - 52.5.0-1
3de678
- Update to 52.5.0
3de678
3de678
* Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-3
3de678
- Include standalone /usr/bin/js52 interpreter
3de678
3de678
* Tue Oct 31 2017 Kalev Lember <klember@redhat.com> - 52.4.0-2
3de678
- Various secondary arch fixes
3de678
3de678
* Thu Sep 28 2017 Kalev Lember <klember@redhat.com> - 52.4.0-1
3de678
- Update to 52.4.0
3de678
3de678
* Wed Sep 20 2017 Kalev Lember <klember@redhat.com> - 52.3.0-1
3de678
- Initial Fedora packaging, based on earlier mozjs45 work