summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dev-lang/spidermonkey/files/spidermonkey-1.8.5-gcc6.patch144
-rw-r--r--dev-lang/spidermonkey/spidermonkey-1.8.5-r6.ebuild149
2 files changed, 293 insertions, 0 deletions
diff --git a/dev-lang/spidermonkey/files/spidermonkey-1.8.5-gcc6.patch b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-gcc6.patch
new file mode 100644
index 000000000000..ab2181faf635
--- /dev/null
+++ b/dev-lang/spidermonkey/files/spidermonkey-1.8.5-gcc6.patch
@@ -0,0 +1,144 @@
+diff -upr a/js/src/jsapi.cpp b/js/src/jsapi.cpp
+--- a/js/src/jsapi.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsapi.cpp 2016-02-29 18:10:49.302307353 -0600
+@@ -3985,7 +3985,7 @@ JS_Enumerate(JSContext *cx, JSObject *ob
+ AutoIdVector props(cx);
+ JSIdArray *ida;
+ if (!GetPropertyNames(cx, obj, JSITER_OWNONLY, &props) || !VectorToIdArray(cx, props, &ida))
+- return false;
++ return NULL;
+ for (size_t n = 0; n < size_t(ida->length); ++n)
+ JS_ASSERT(js_CheckForStringIndex(ida->vector[n]) == ida->vector[n]);
+ return ida;
+diff -upr a/js/src/jsfun.cpp b/js/src/jsfun.cpp
+--- a/js/src/jsfun.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsfun.cpp 2016-02-29 18:21:45.249674890 -0600
+@@ -2051,7 +2051,7 @@ fun_toStringHelper(JSContext *cx, JSObje
+
+ JSString *str = JS_DecompileFunction(cx, fun, indent);
+ if (!str)
+- return false;
++ return NULL;
+
+ if (!indent)
+ cx->compartment->toSourceCache.put(fun, str);
+@@ -2657,7 +2657,7 @@ LookupInterpretedFunctionPrototype(JSCon
+ const Shape *shape = funobj->nativeLookup(id);
+ if (!shape) {
+ if (!ResolveInterpretedFunctionPrototype(cx, funobj))
+- return false;
++ return NULL;
+ shape = funobj->nativeLookup(id);
+ }
+ JS_ASSERT(!shape->configurable());
+diff -upr a/js/src/jsiter.cpp b/js/src/jsiter.cpp
+--- a/js/src/jsiter.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsiter.cpp 2016-02-29 18:24:22.494659919 -0600
+@@ -425,7 +425,7 @@ NewIteratorObject(JSContext *cx, uintN f
+ */
+ JSObject *obj = js_NewGCObject(cx, FINALIZE_OBJECT0);
+ if (!obj)
+- return false;
++ return NULL;
+ obj->init(cx, &js_IteratorClass, NULL, NULL, NULL, false);
+ obj->setMap(cx->compartment->emptyEnumeratorShape);
+ return obj;
+diff -upr a/js/src/jsparse.cpp b/js/src/jsparse.cpp
+--- a/js/src/jsparse.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsparse.cpp 2016-02-29 18:29:03.997437475 -0600
+@@ -3352,7 +3352,7 @@ Parser::functionDef(JSAtom *funAtom, Fun
+ if (!outertc->inFunction() && bodyLevel && funAtom && !lambda && outertc->compiling()) {
+ JS_ASSERT(pn->pn_cookie.isFree());
+ if (!DefineGlobal(pn, outertc->asCodeGenerator(), funAtom))
+- return false;
++ return NULL;
+ }
+
+ pn->pn_blockid = outertc->blockid();
+diff -upr a/js/src/jsstr.cpp b/js/src/jsstr.cpp
+--- a/js/src/jsstr.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsstr.cpp 2016-02-29 19:01:45.857779836 -0600
+@@ -1734,7 +1734,7 @@ class RegExpGuard
+ if (flat) {
+ patstr = flattenPattern(cx, fm.patstr);
+ if (!patstr)
+- return false;
++ return NULL;
+ } else {
+ patstr = fm.patstr;
+ }
+@@ -3400,7 +3400,7 @@ js_InitStringClass(JSContext *cx, JSObje
+ UndefinedValue(), NULL, NULL,
+ JSPROP_READONLY | JSPROP_PERMANENT | JSPROP_SHARED, 0, 0,
+ NULL)) {
+- return JS_FALSE;
++ return NULL;
+ }
+
+ return proto;
+diff -upr a/js/src/jstypedarray.cpp b/js/src/jstypedarray.cpp
+--- a/js/src/jstypedarray.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jstypedarray.cpp 2016-02-29 19:08:53.541136191 -0600
+@@ -1334,7 +1334,7 @@ class TypedArrayTemplate
+ if (size != 0 && count >= INT32_MAX / size) {
+ JS_ReportErrorNumber(cx, js_GetErrorMessage, NULL,
+ JSMSG_NEED_DIET, "size and count");
+- return false;
++ return NULL;
+ }
+
+ int32 bytelen = size * count;
+@@ -1668,7 +1668,7 @@ TypedArrayConstruct(JSContext *cx, jsint
+
+ default:
+ JS_NOT_REACHED("shouldn't have gotten here");
+- return false;
++ return NULL;
+ }
+ }
+
+diff -upr a/js/src/jsxml.cpp b/js/src/jsxml.cpp
+--- a/js/src/jsxml.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/jsxml.cpp 2016-02-29 19:17:10.363279731 -0600
+@@ -282,7 +282,7 @@ NewXMLNamespace(JSContext *cx, JSLinearS
+
+ obj = NewBuiltinClassInstanceXML(cx, &js_NamespaceClass);
+ if (!obj)
+- return JS_FALSE;
++ return NULL;
+ JS_ASSERT(JSVAL_IS_VOID(obj->getNamePrefixVal()));
+ JS_ASSERT(JSVAL_IS_VOID(obj->getNameURIVal()));
+ JS_ASSERT(JSVAL_IS_VOID(obj->getNamespaceDeclared()));
+@@ -431,7 +431,7 @@ ConvertQNameToString(JSContext *cx, JSOb
+ size_t length = str->length();
+ jschar *chars = (jschar *) cx->malloc((length + 2) * sizeof(jschar));
+ if (!chars)
+- return JS_FALSE;
++ return NULL;
+ *chars = '@';
+ const jschar *strChars = str->getChars(cx);
+ if (!strChars) {
+diff -upr a/js/src/methodjit/InvokeHelpers.cpp b/js/src/methodjit/InvokeHelpers.cpp
+--- a/js/src/methodjit/InvokeHelpers.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/methodjit/InvokeHelpers.cpp 2016-02-29 20:34:14.496983346 -0600
+@@ -728,7 +728,7 @@ AtSafePoint(JSContext *cx)
+ {
+ JSStackFrame *fp = cx->fp();
+ if (fp->hasImacropc())
+- return false;
++ return NULL;
+
+ JSScript *script = fp->script();
+ return script->maybeNativeCodeForPC(fp->isConstructing(), cx->regs->pc);
+diff -upr a/js/src/nanojit/NativeX64.cpp b/js/src/nanojit/NativeX64.cpp
+--- a/js/src/nanojit/NativeX64.cpp 2011-03-31 14:08:36.000000000 -0500
++++ b/js/src/nanojit/NativeX64.cpp 2016-02-29 20:19:56.487934808 -0600
+@@ -1899,7 +1899,7 @@ namespace nanojit
+ }
+ }
+
+- static const AVMPLUS_ALIGN16(int64_t) negateMask[] = {0x8000000000000000LL,0};
++ static const AVMPLUS_ALIGN16(int64_t) negateMask[] = {int64_t(0x8000000000000000LL),0};
+
+ void Assembler::asm_fneg(LIns *ins) {
+ Register rr, ra;
diff --git a/dev-lang/spidermonkey/spidermonkey-1.8.5-r6.ebuild b/dev-lang/spidermonkey/spidermonkey-1.8.5-r6.ebuild
new file mode 100644
index 000000000000..aa91c2911517
--- /dev/null
+++ b/dev-lang/spidermonkey/spidermonkey-1.8.5-r6.ebuild
@@ -0,0 +1,149 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+WANT_AUTOCONF="2.1"
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="threads"
+inherit autotools eutils toolchain-funcs multilib python-any-r1 versionator pax-utils
+
+MY_PN="js"
+TARBALL_PV="$(replace_all_version_separators '' $(get_version_component_range 1-3))"
+MY_P="${MY_PN}-${PV}"
+TARBALL_P="${MY_PN}${TARBALL_PV}-1.0.0"
+DESCRIPTION="Stand-alone JavaScript C library"
+HOMEPAGE="http://www.mozilla.org/js/spidermonkey/"
+SRC_URI="https://ftp.mozilla.org/pub/mozilla.org/js/${TARBALL_P}.tar.gz"
+
+LICENSE="NPL-1.1"
+SLOT="0/mozjs185"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~x64-macos"
+IUSE="debug minimal static-libs test"
+
+S="${WORKDIR}/${MY_P}"
+BUILDDIR="${S}/js/src"
+
+RDEPEND=">=dev-libs/nspr-4.7.0
+ sys-libs/readline:0
+ x64-macos? ( dev-libs/jemalloc )"
+DEPEND="${RDEPEND}
+ ${PYTHON_DEPS}
+ app-arch/zip
+ virtual/pkgconfig"
+
+pkg_setup(){
+ if [[ ${MERGE_TYPE} != "binary" ]]; then
+ export LC_ALL="C"
+ fi
+}
+
+src_prepare() {
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=628723#c43
+ epatch "${FILESDIR}/${P}-fix-install-symlinks.patch"
+ # https://bugzilla.mozilla.org/show_bug.cgi?id=638056#c9
+ epatch "${FILESDIR}/${P}-fix-ppc64.patch"
+ # https://bugs.gentoo.org/show_bug.cgi?id=400727
+ # https://bugs.gentoo.org/show_bug.cgi?id=420471
+ epatch "${FILESDIR}/${P}-arm_respect_cflags-3.patch"
+ # https://bugs.gentoo.org/show_bug.cgi?id=438746
+ epatch "${FILESDIR}"/${PN}-1.8.7-freebsd-pthreads.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=441928
+ epatch "${FILESDIR}"/${PN}-1.8.5-perf_event-check.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=439260
+ epatch "${FILESDIR}"/${P}-symbol-versions.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=441934
+ epatch "${FILESDIR}"/${PN}-1.8.5-ia64-fix.patch
+ epatch "${FILESDIR}"/${PN}-1.8.5-ia64-static-strings.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=431560
+ epatch "${FILESDIR}"/${PN}-1.8.5-isfinite.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=552786
+ epatch "${FILESDIR}"/${PN}-perl-defined-array-check.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=439558
+ epatch "${FILESDIR}"/${PN}-1.8.7-x32.patch
+ # https://bugs.gentoo.org/show_bug.cgi?id=582478
+ epatch "${FILESDIR}"/${PN}-1.8.5-gcc6.patch
+
+ epatch_user
+
+ cd "${BUILDDIR}" || die
+ eautoconf
+}
+
+src_configure() {
+ cd "${BUILDDIR}" || die
+
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" \
+ AR="$(tc-getAR)" RANLIB="$(tc-getRANLIB)" \
+ LD="$(tc-getLD)" \
+ econf \
+ ${myopts} \
+ --enable-jemalloc \
+ --enable-readline \
+ --enable-threadsafe \
+ --with-system-nspr \
+ --disable-optimize \
+ --disable-profile-guided-optimization \
+ $(use_enable debug) \
+ $(use_enable static-libs static) \
+ $(use_enable test tests)
+}
+
+cross_make() {
+ emake \
+ CFLAGS="${BUILD_CFLAGS}" \
+ CXXFLAGS="${BUILD_CXXFLAGS}" \
+ AR="${BUILD_AR}" \
+ CC="${BUILD_CC}" \
+ CXX="${BUILD_CXX}" \
+ RANLIB="${BUILD_RANLIB}" \
+ "$@"
+}
+src_compile() {
+ cd "${BUILDDIR}" || die
+ if tc-is-cross-compiler; then
+ tc-export_build_env BUILD_{AR,CC,CXX,RANLIB}
+ cross_make jscpucfg host_jsoplengen host_jskwgen
+ cross_make -C config nsinstall
+ mv {,native-}jscpucfg || die
+ mv {,native-}host_jskwgen || die
+ mv {,native-}host_jsoplengen || die
+ mv config/{,native-}nsinstall || die
+ sed -i \
+ -e 's@./jscpucfg@./native-jscpucfg@' \
+ -e 's@./host_jskwgen@./native-host_jskwgen@' \
+ -e 's@./host_jsoplengen@./native-host_jsoplengen@' \
+ Makefile || die
+ sed -i -e 's@/nsinstall@/native-nsinstall@' config/config.mk || die
+ rm -f config/host_nsinstall.o \
+ config/host_pathsub.o \
+ host_jskwgen.o \
+ host_jsoplengen.o || die
+ fi
+ emake
+}
+
+src_test() {
+ cd "${BUILDDIR}/jsapi-tests" || die
+ # for bug 415791
+ pax-mark mr jsapi-tests
+ emake check
+}
+
+src_install() {
+ cd "${BUILDDIR}" || die
+ emake DESTDIR="${D}" install
+ # bug 437520 , exclude js shell for small systems
+ if ! use minimal ; then
+ dobin shell/js
+ pax-mark m "${ED}/usr/bin/js"
+ fi
+ dodoc ../../README
+ dohtml README.html
+
+ if ! use static-libs; then
+ # We can't actually disable building of static libraries
+ # They're used by the tests and in a few other places
+ find "${D}" -iname '*.a' -delete || die
+ fi
+}