# $Id$ PNAME="spidermonkey" PVER="52.8.0" PBUILD="r1" PCAT="dev-java" DESCRIPTION="SpiderMonkey is the code-name for the Mozilla's C implementation of JavaScript." HOMEPAGE="https://developer.mozilla.org/en-US/docs/SpiderMonkey" DEPEND=">= sys-libs/zlib-1.2 >= sys-libs/readline-7 >= sys-libs/libstdc++-7.3" SDEPEND=">= dev-lang/python-2.7 >= app-arch/zip-3" SRCFILE="firefox-${PVER}esr.source.tar.xz" SRCDIR="${BUILDDIR}/firefox-${PVER}esr" sminclude python msetfeature "!check" SRC_URI=( http://ftp.mozilla.org/pub/firefox/releases/${PVER}esr/source/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-52.7.3-fix-soname.patch mirror://${PNAME}/${PNAME}-52.7.3-copy-headers.patch mirror://${PNAME}/${PNAME}-52.7.3-disable-mozglue.patch mirror://${PNAME}/${PNAME}-52.8.0-include-configure-script.patch ) UP2DATE="updatecmd https://hg.mozilla.org/mozilla-unified/tags | grep '/FIREFOX_.*esr_RELEASE' | sed -e 's:.*/FIREFOX_\(.*\)esr_RELEASE:\1:' -e 's:_:\.:g' | upsort_pipe" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} mpatch ${PNAME}-52.7.3-fix-soname.patch || die mpatch ${PNAME}-52.7.3-copy-headers.patch || die mpatch ${PNAME}-52.7.3-disable-mozglue.patch || die mpatch ${PNAME}-52.8.0-include-configure-script.patch || die sed -i '/^rm -rf _virtualenv/d' configure.in || die sed -i '/^mkdir -p _virtualenv/d' configure.in || die install -d _virtualenv/bin || die cp -a /usr/bin/python-m32 _virtualenv/bin || die cp -a /usr/bin/python-m64 _virtualenv/bin || die cp -a /usr/bin/python$(mget-python-version)-m32 _virtualenv/bin || die cp -a /usr/bin/python$(mget-python-version)-m64 _virtualenv/bin || die export WANT_AUTOCONF=2.1 autoconf || die cd ${SRCDIR}/js/src export WANT_AUTOCONF=2.1 autoconf || die } src_compile() { export CPPFLAGS="" export CFLAGS+=' -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp -flto=3' export CXXFLAGS+=' -fno-delete-null-pointer-checks -fno-strict-aliasing -fno-tree-vrp -flto=3' export CC=gcc export CXX=g++ export SHELL="${SHELL}" cd ${SRCDIR}/js/src # --enable-optimize="-O2" # --enable-gold mconfigure \ --disable-debug \ --disable-debug-symbols \ --disable-strip \ --enable-gold \ --disable-optimize \ --enable-pie \ --enable-posix-nspr-emulation \ --enable-readline \ --enable-release \ --enable-shared-js \ --disable-tests \ --with-intl-api \ --with-system-zlib \ --without-system-icu \ || die # shell export fixes some bugs in a chroot environment # see: http://comments.gmane.org/gmane.linux.lfs.beyond.support/47450 SHELL="${SHELL}" mmake || die } src_install() { cd ${SRCDIR}/js/src SHELL="${SHELL}" mmake DESTDIR=${BINDIR} install || die }