%global pre_release .rc0 %global major 38 Summary: JavaScript interpreter and libraries Name: mozjs38 Version: %{major}.2.1 Release: 8%{?dist} License: MPLv2.0 and BSD and GPLv2+ and GPLv3+ and LGPLv2.1 and LGPLv2.1+ and AFL and ASL 2.0 URL: https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Releases/38 Source0: https://people.mozilla.org/~sstangl/mozjs-%{version}%{pre_release}.tar.bz2 # According to mozilla devs x86_64 is the only 64-bit architecture. I tend to not agree with them. Patch0: fix-64bit-archs.patch # same issue on s390 as in XUL/FF - https://bugzilla.redhat.com/show_bug.cgi?id=1219542 Patch1: rhbz-1219542-s390-build.patch BuildRequires: pkgconfig(icu-i18n) BuildRequires: pkgconfig(nspr) BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(zlib) BuildRequires: readline-devel BuildRequires: /usr/bin/zip BuildRequires: python-devel %description JavaScript is the Netscape-developed object scripting language used in millions of web pages and server applications worldwide. Netscape's JavaScript is a super set of the ECMA-262 Edition 3 (ECMAScript) standard scripting language, with only mild differences from the published standard. %package devel Summary: Header files, libraries and development documentation for %{name} Group: Development/Libraries Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains the header files, static libraries and development documentation for %{name}. If you like to develop programs using %{name}, you will need to install %{name}-devel. %prep %setup -q -n mozjs-%{major}.0.0/js/src %patch0 -p1 %ifarch s390 %patch1 -p3 -b .rhbz-1219542-s390 %endif %if 0%{?fedora} > 22 # Correct failed to link tests due to hardened build sed -i 's|"-O2"|"-O2 -fPIC"|' configure %endif # Remove zlib directory (to be sure using system version) rm -rf ../../modules/zlib # Fix release number head -n -1 ../../config/milestone.txt > ../../config/milestone.txt echo "%{version}%{pre_release}" >> ../../config/milestone.txt # Make mozjs these functions visible: # JS::UTF8CharsToNewTwoByteCharsZ and JS::LossyUTF8CharsToNewTwoByteCharsZ sed -i 's|^\(TwoByteCharsZ\)$|JS_PUBLIC_API\(\1\)|g' vm/CharacterEncoding.cpp sed -i 's|^extern\ \(TwoByteCharsZ\)$|JS_PUBLIC_API\(\1\)|g' ../public/CharacterEncoding.h # Also make visible js::DisableExtraThreads() sed -i '/^void$/{$!{N;s/^\(void\)\n\(js\:\:DisableExtraThreads()\)$/JS_PUBLIC_API\(\1\)\n\2/;ty;P;D;:y}}' vm/Runtime.cpp sed -i 's|\(void\) \(DisableExtraThreads()\)|JS_PUBLIC_API\(\1\) \2|g' vm/Runtime.h %build # Need -fpermissive due to some macros using nullptr as bool false export CFLAGS="%{optflags} -fpermissive -fno-tree-vrp -fno-strict-aliasing" export CXXFLAGS="$CFLAGS" export PYTHON=/usr/bin/python2 %configure \ --with-system-nspr \ --enable-threadsafe \ --enable-readline \ --enable-xterm-updates \ --enable-shared-js \ --enable-gcgenerational \ --disable-optimize \ --with-system-zlib \ --enable-system-ffi \ --with-system-icu \ --without-intl-api \ --enable-pie make %{?_smp_mflags} %install make install DESTDIR=%{buildroot} mv %{buildroot}%{_libdir}/pkgconfig/js.pc %{buildroot}%{_libdir}/pkgconfig/mozjs-%{major}.pc chmod a-x %{buildroot}%{_libdir}/pkgconfig/*.pc # Do not install binaries or static libraries rm -f %{buildroot}%{_libdir}/*.a %{buildroot}%{_libdir}/*.ajs %{buildroot}%{_bindir}/js* # Install files, not symlinks to build directory pushd %{buildroot}%{_includedir} for link in `find . -type l`; do header=`readlink $link` rm -f $link cp -p $header $link done popd cp -p js/src/js-config.h %{buildroot}%{_includedir}/mozjs-%{major} %check tests/jstests.py -d -s --no-progress ../../js/src/js/src/shell/js %post -p /sbin/ldconfig %postun -p /sbin/ldconfig %files %license ../../LICENSE %doc ../../README %{_libdir}/*.so %files devel %{_libdir}/pkgconfig/*.pc %{_includedir}/mozjs-%{major} %changelog * Thu Mar 31 2016 Marek Skalicky - 38.2.1-8 - Disable two optimizations which caused regressions with new gcc - Use fedora default -O2 instead of mozjs -O3 * Thu Feb 04 2016 Fedora Release Engineering - 38.2.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild * Fri Dec 4 2015 Marek Skalicky - 38.2.1-6 - Make one function from vm/Runtime.cpp visible (needed by MongoDB 3.2) * Thu Nov 26 2015 Dan HorĂ¡k - 38.2.1-5 - fix build on s390 (rhbz#1219542) * Wed Nov 25 2015 Marek Skalicky - 38.2.1-4 - Make two functions from CharacterEncoding.cpp visible (needed by MongoDB) * Mon Oct 26 2015 Marcin Juszkiewicz - 38.2.1-3 - Handle all Fedora 64-bit architectures. * Tue Oct 13 2015 Marek Skalicky - 38.2.1-2 - Fixed inaccuracies from package review (paraller build, tests don't fail,...) * Tue Oct 6 2015 Marek Skalicky - 38.2.1-1 - Initial mozjs38 spec (based on mozjs31)