dev-lang/spidermonkey: bump to v68.6.0 (test)
authorThomas Deutschmann <whissi@gentoo.org>
Tue, 31 Mar 2020 00:10:55 +0000 (02:10 +0200)
committerThomas Deutschmann <whissi@gentoo.org>
Tue, 31 Mar 2020 00:11:18 +0000 (02:11 +0200)
Rewritten ebuild from scratch. Unkeyworded. Requires testing.

Package-Manager: Portage-2.3.96, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
dev-lang/spidermonkey/Manifest
dev-lang/spidermonkey/spidermonkey-68.6.0_pre.ebuild [new file with mode: 0644]

index 8e52f7f34326b0f2aacbe67f4e98780e22765dc6..34e48ce82966740d4d364b730712e12b17339bea 100644 (file)
@@ -1,3 +1,5 @@
+DIST firefox-68.0-patches-12.tar.xz 17476 BLAKE2B bd788e24820f902f4ca908b0cf7a49a4c57e058915af1eb87233d19d91271092676c1ee4c67e88df2411ecccea47c4e735efdf95945954f2d9aac5cc2f9051f2 SHA512 8033a3c445eaddd28188b338534da16a4130b679a5f6673b3094524e47435890e6d454d7b67f81bbe21f80ef1b65fa7e6c27d71191ba70dd8ea87fc68463f9a7
+DIST firefox-68.6.0esr.source.tar.xz 313814396 BLAKE2B 54fd94d629a7c70060b7c3c130c2de780ee270a76654f4fd1500a05a7412220e0db9a1fca845565279b347da769e7dbe0bc98a5a2e110fc26e276115fe1e37b7 SHA512 84565d654ed8bd2d036d08de4d16e41ae8881f0b20b34424ab347d50a37384acf50c04f74269720e79db28028569dff79f2b910848939ff87c078f36684a75a3
 DIST js-1.7.0.tar.gz 1165607 BLAKE2B 61749e10886bbb9e4958a41925fae8dcbd7d943b9bf838878368c30e26ba61f300bc2ec37982653b87fedf76707dda2ffd510282de4bce87d1da11ca42fa108c SHA512 9d9fbd9c1dae969ca19ddb0f977ac56f3e0479ec393b859de252fcdd8b7fc325e80399073540884ed365ce56a3219be34c0db9300d5e50f32969660c90527e51
 DIST js185-1.0.0.tar.gz 6164605 BLAKE2B 76a37f0ceae05d3475853875bd0ce4be6e525e4114816f8f281ea6fc6b60a71060975a0fa1cb843f57ad1e2f842dfb26b24244fa0fd6c20f6ae2ebbe430f70be SHA512 2af7122a7c7007fd7b6668776fe1222515a810b3e43bbf0f76b8f94e1ef406ffd3fb5ccec393021b00274c05b38a77235bc8d6886994c56762fcaf0aa7cf6718
 DIST mozjs-38.3.0sfink2.tar.bz2 27232902 BLAKE2B 42a039a41b7479a32e22f260cb58f098e1a1d4833f801f193bdd8b75403f94567b9ef2ebe85b2a811fe2f9b27cd934afe1054bd4e7d9aae0b8a80acdec8e42a4 SHA512 debad1fbd21e025c567b083677cfd0a2023ec2aff750241f495ac2977034a7299e068cb3b0b2351c97457119cc8aef563f00416092a70a3a269d20947b700206
@@ -7,6 +9,7 @@ DIST mozjs-60.5.2.tar.bz2 32816585 BLAKE2B 45ac4c9646e1275faf60eeedbf486f802cd10
 DIST mozjs17.0.0.tar.gz 6778934 BLAKE2B a37debf5079fc4c27bb9edd3172c6e7914f6128fac6ffa97b49ac266c477d0916b180fb68ecd0916a52f935959a83d73254b0ba72b4898adc5e3b85927d17d2a SHA512 39b68aeb9f712f146778d8b68ee795709a1372c8ab893a222af4eb34882427d6f5cf877e743d6cb2f1b4348c194d8f3774f00cb775b03515b34b49560b748be4
 DIST spidermonkey-52.0-patches-0.tar.xz 5172 BLAKE2B 8bcf9477de47ef3b882cd3281efa7f77c16ce11fc93f44446a620917adf629fde8290af1dd69f0930a889aacfee3603bf60eb9c1e718a1dfd3e218a1013b6192 SHA512 88ad640fb0efa4972f1b7782bd0abee1751b73914ee51faade93b25c4d8eec64e7693898842a406c49fc2ab43733404efeccb138afb64d2193b9a5eb612578e3
 DIST spidermonkey-60.0-patches-04.tar.xz 4428 BLAKE2B af78049cd9b3ee6a9b689e6253486c4670fd3b506faade7d745dafaa7af329c0bd15cd35e95528a4c96688230f4803130967fb09b97aae2bda0ce0f73acaaf3e SHA512 fb1326a81512146ba98773d4f7e0c4bc1bff0f076897c13f576fcf63b56f6965efeff633eea9160bca9f9bc4546505901084eabc33bc955de0b7ab3d6334387a
+DIST spidermonkey-68.6.0-patches-01.tar.xz 3896 BLAKE2B 183de4fa88fdbad992dd8d7c0df98d456517f6c620a5c7a7873eb18f8d3fe2907f7501033d36e500b05c187604c36f11ea85ec9f2a720205cbba79148ba37d0f SHA512 95b9012a8f6371dc8dae5dc176661bc85555cf9f2d81740705f85b1109ea45b173c7d29078d0e87908a9905ccd872a0c9e619a32a63a071845df3b1dd2e63b69
 DIST spidermonkey-slot0-patches-01.tar.xz 10488 BLAKE2B 4a5195ac11d1076046424fc10d1416d097fb230cd8b0b28ac8b65d379e0c0518586ced0f48f833dea52b13fb5d300e02664657ab2479bfcc343bc358d394d5d7 SHA512 6c878ed0b50c052989a8b965fed845e9c672b691f4c4b1f98ee82e81a33880e1e6bf1dac8222d71322553282de602a88272dedebbcf50d27967fc172f0a8054a
 DIST spidermonkey-slot0-patches-02.tar.xz 10952 BLAKE2B fb7bf5cdac6c821a48d407ff172fe0ec7297e047d3b3bab952f226f413b83ea70325175b41c1680725ff588111b424efc97a0c66e392989da510c43d38528ff1 SHA512 cd62890c4b58658d99fc1b52f05ccb35c07da835b168bb9d5e6b219de5021122c199cc2255c5b0be01ef582f53dd51c9975921e6bde9f14e9b43536e2bee85f2
 DIST spidermonkey-slot17-patches-01.tar.xz 2748 BLAKE2B a55504d726f925096de7e066a1d323154bc796018644f347bc1d012ea6ee8441cc19f30689e06fd26bab5a5d2e8376e90bf2c1930a588be8b48865f7bbc524ea SHA512 21a90f85d156de3cca9811317507162a458f908bb447924fcfbf49b7bb70496b611ce7df90b90775316b8ceafda56692be3bf856b168b83ed40b8a5c668eed3f
diff --git a/dev-lang/spidermonkey/spidermonkey-68.6.0_pre.ebuild b/dev-lang/spidermonkey/spidermonkey-68.6.0_pre.ebuild
new file mode 100644 (file)
index 0000000..8f84dca
--- /dev/null
@@ -0,0 +1,216 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="7"
+
+PYTHON_COMPAT=( python3_{6..8} )
+
+WANT_AUTOCONF="2.1"
+
+inherit autotools check-reqs python-any-r1
+
+MY_PN="mozjs"
+MY_PV="${PV/_pre*}" # Handle Gentoo pre-releases
+
+MY_MAJOR=$(ver_cut 1)
+
+MOZ_ESR="1"
+
+# Convert the ebuild version to the upstream mozilla version
+MOZ_PV="${MY_PV/_alpha/a}" # Handle alpha for SRC_URI
+MOZ_PV="${MOZ_PV/_beta/b}" # Handle beta for SRC_URI
+MOZ_PV="${MOZ_PV%%_rc*}" # Handle rc for SRC_URI
+
+if [[ ${MOZ_ESR} == 1 ]] ; then
+       # ESR releases have slightly different version numbers
+       MOZ_PV="${MOZ_PV}esr"
+fi
+
+# Patch version
+FIREFOX_PATCHSET="firefox-68.0-patches-12"
+SPIDERMONKEY_PATCHSET="${PN}-68.6.0-patches-01"
+
+MOZ_HTTP_URI="https://archive.mozilla.org/pub/firefox/releases"
+MOZ_SRC_URI="${MOZ_HTTP_URI}/${MOZ_PV}/source/firefox-${MOZ_PV}.source.tar.xz"
+
+if [[ "${PV}" == *_rc* ]]; then
+       MOZ_HTTP_URI="https://archive.mozilla.org/pub/firefox/candidates/${MOZ_PV}-candidates/build${PV##*_rc}"
+       MOZ_SRC_URI="${MOZ_HTTP_URI}/source/firefox-${MOZ_PV}.source.tar.xz"
+fi
+
+PATCH_URIS=(
+       https://dev.gentoo.org/~{anarchy,whissi,polynomial-c,axs}/mozilla/patchsets/${FIREFOX_PATCHSET}.tar.xz
+       https://dev.gentoo.org/~{whissi,polynomial-c,axs}/mozilla/patchsets/${SPIDERMONKEY_PATCHSET}.tar.xz
+)
+
+SRC_URI="${MOZ_SRC_URI}
+       ${PATCH_URIS[@]}"
+
+DESCRIPTION="SpiderMonkey is Mozilla's JavaScript engine written in C and C++"
+HOMEPAGE="https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey"
+
+KEYWORDS=""
+
+SLOT="68"
+LICENSE="MPL-2.0 GPL-2 LGPL-2.1"
+IUSE="debug +jit +system-icu test"
+
+RESTRICT="!test? ( test )"
+
+BDEPEND="dev-lang/python:2.7
+       test? ( ${PYTHON_DEPS} )"
+
+DEPEND=">=dev-libs/nspr-4.21
+       sys-libs/readline:0=
+       >=sys-libs/zlib-1.2.3
+       system-icu? ( >=dev-libs/icu-63.1:= )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/firefox-${MY_PV}/js/src"
+
+pkg_pretend() {
+       if use test ; then
+               CHECKREQS_DISK_BUILD="6G"
+       else
+               CHECKREQS_DISK_BUILD="5G"
+       fi
+
+       check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+       if use test ; then
+               CHECKREQS_DISK_BUILD="6G"
+       else
+               CHECKREQS_DISK_BUILD="5G"
+       fi
+
+       check-reqs_pkg_setup
+
+       use test && python-any-r1_pkg_setup
+}
+
+src_prepare() {
+       cd ../.. || die
+       rm "${WORKDIR}"/firefox/2013_avoid_noinline_on_GCC_with_skcms.patch
+       rm "${WORKDIR}"/firefox/2015_fix_cssparser.patch
+       eapply "${WORKDIR}"/firefox
+       eapply "${WORKDIR}"/spidermonkey-patches
+
+       default
+
+       MOZJS_BUILDDIR="${WORKDIR}/build"
+       mkdir "${MOZJS_BUILDDIR}" || die
+
+       cd "${S}" || die
+       eautoconf
+}
+
+src_configure() {
+       tc-export CC CXX LD AR RANLIB
+
+       # backup current active Python version
+       local PYTHON_OLD=${PYTHON}
+
+       # build system will require Python2.7
+       export PYTHON=python2.7
+
+       cd "${MOZJS_BUILDDIR}" || die
+
+       ECONF_SOURCE="${S}" \
+       econf \
+               --disable-jemalloc \
+               --enable-readline \
+               --with-system-nspr \
+               --with-system-zlib \
+               --disable-optimize \
+               --with-intl-api \
+               $(use_with system-icu) \
+               $(use_enable debug) \
+               $(use_enable jit ion) \
+               $(use_enable test tests) \
+               CONFIG_SHELL="${EPREFIX}/bin/bash" \
+               XARGS="${EPREFIX}/usr/bin/xargs"
+
+       # restore PYTHON
+       export PYTHON=${PYTHON_OLD}
+}
+
+src_compile() {
+       cd "${MOZJS_BUILDDIR}" || die
+       default
+}
+
+src_test() {
+       if "${MOZJS_BUILDDIR}/js/src/js" -e 'print("Hello world!")'; then
+               einfo "Smoke-test successful, continuing with full test suite"
+       else
+               die "Smoke-test failed: did interpreter initialization fail?"
+       fi
+
+       local -a KNOWN_TESTFAILURES
+       KNOWN_TESTFAILURES+=( test262/intl402/RelativeTimeFormat/prototype/format/en-us-numeric-auto.js )
+       KNOWN_TESTFAILURES+=( non262/Intl/DateTimeFormat/tz-environment-variable.js )
+       KNOWN_TESTFAILURES+=( non262/Intl/RelativeTimeFormat/format.js )
+       KNOWN_TESTFAILURES+=( non262/Date/time-zones-imported.js )
+       KNOWN_TESTFAILURES+=( non262/Date/toString-localized.js )
+       KNOWN_TESTFAILURES+=( non262/Date/time-zone-path.js )
+       KNOWN_TESTFAILURES+=( non262/Date/time-zones-historic.js )
+       KNOWN_TESTFAILURES+=( non262/Date/toString-localized-posix.js )
+       KNOWN_TESTFAILURES+=( non262/Date/reset-time-zone-cache-same-offset.js )
+
+       echo "" > "${T}"/known_failures.list || die
+
+       local KNOWN_TESTFAILURE
+       for KNOWN_TESTFAILURE in ${KNOWN_TESTFAILURES[@]} ; do
+               echo "${KNOWN_TESTFAILURE}" >> "${T}"/known_failures.list
+       done
+
+       PYTHONPATH="${S}/tests/lib" \
+               ${PYTHON} \
+               "${S}"/tests/jstests.py -d -s -t 1800 --wpt=disabled --no-progress \
+               --exclude-file="${T}"/known_failures.list \
+               "${MOZJS_BUILDDIR}"/js/src/js \
+               || die
+
+       if use jit ; then
+               KNOWN_TESTFAILURES=()
+
+               echo "" > "${T}"/known_failures.list || die
+
+               for KNOWN_TESTFAILURE in ${KNOWN_TESTFAILURES[@]} ; do
+                       echo "${KNOWN_TESTFAILURE}" >> "${T}"/known_failures.list
+               done
+
+               PYTHONPATH="${S}/tests/lib" \
+                       ${PYTHON} \
+                       "${S}"/tests/jstests.py -d -s -t 1800 --wpt=disabled --no-progress \
+                       --exclude-file="${T}"/known_failures.list \
+                       "${MOZJS_BUILDDIR}"/js/src/js basic \
+                       || die
+       fi
+}
+
+src_install() {
+       cd "${MOZJS_BUILDDIR}" || die
+       default
+
+       # fix soname links
+       pushd "${ED}"/usr/$(get_libdir) &>/dev/null || die
+       mv lib${MY_PN}-${MY_MAJOR}.so lib${MY_PN}-${MY_MAJOR}.so.0.0.0 || die
+       ln -s lib${MY_PN}-${MY_MAJOR}.so.0.0.0 lib${MY_PN}-${MY_MAJOR}.so.0 || die
+       ln -s lib${MY_PN}-${MY_MAJOR}.so.0 lib${MY_PN}-${MY_MAJOR}.so || die
+       popd &>/dev/null || die
+
+       # remove unneeded files
+       rm \
+               "${ED}"/usr/bin/js${MY_MAJOR}-config \
+               "${ED}"/usr/$(get_libdir)/libjs_static.ajs \
+               || die
+
+       # fix permissions
+       chmod -x \
+               "${ED}"/usr/$(get_libdir)/pkgconfig/*.pc \
+               "${ED}"/usr/include/mozjs-${MY_MAJOR}/js-config.h \
+               || die
+}