From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- .../JavaScript-SpiderMonkey-0.210.0-r1.ebuild | 26 ++ dev-perl/JavaScript-SpiderMonkey/Manifest | 6 + .../JavaScript-SpiderMonkey/files/mozjs185.patch | 464 +++++++++++++++++++++ dev-perl/JavaScript-SpiderMonkey/metadata.xml | 12 + 4 files changed, 508 insertions(+) create mode 100644 dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild create mode 100644 dev-perl/JavaScript-SpiderMonkey/Manifest create mode 100644 dev-perl/JavaScript-SpiderMonkey/files/mozjs185.patch create mode 100644 dev-perl/JavaScript-SpiderMonkey/metadata.xml (limited to 'dev-perl/JavaScript-SpiderMonkey') diff --git a/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild b/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild new file mode 100644 index 000000000000..1bcd74535a3f --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +MODULE_AUTHOR=TBUSCH +MODULE_VERSION=${PV%0.0} +inherit perl-module + +DESCRIPTION="Perl interface to the JavaScript Engine" + +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86" +IUSE="" + +RDEPEND="dev-perl/Log-Log4perl + >=dev-lang/spidermonkey-1.5:0" +DEPEND="${RDEPEND} + dev-perl/ExtUtils-PkgConfig" + +src_prepare() { + epatch "${FILESDIR}"/mozjs185.patch + perl-module_src_prepare +} + +SRC_TEST=do diff --git a/dev-perl/JavaScript-SpiderMonkey/Manifest b/dev-perl/JavaScript-SpiderMonkey/Manifest new file mode 100644 index 000000000000..f54752f87c3d --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/Manifest @@ -0,0 +1,6 @@ +AUX mozjs185.patch 13492 SHA256 d6ff0ff942088d6984f23f34257a314b5572100825c933ebf33c00817ce3c42f SHA512 237e804612e37d6347291e08bd2cfb5469c990f437ad3fbb4c4c7692fdd3ad7775a9f7571d343a1e8f5ce8552b05f6e396c4035c1fdca2a43cdcd4e997aff947 WHIRLPOOL 739c72b78e2a97074a41bac640f24622dd25902227245309df891f830d251655b60fa93f897a70d173bd5eeb4d8ded49e310dfd23dd0f95e1c17718ff3344f0f +DIST JavaScript-SpiderMonkey-0.21.tar.gz 19494 SHA256 7bd1879afaf4d73f37adaab6464611a466c1b93d4fe23509d81eedf428809a1a SHA512 5a1e26d8ee15c73a566715ac150ac597e6bbf542629bf1884ae623478ed6dd1085b4afc02ab6a152c7407239ba46a9d30f9472fc6375fab823815b38372fb1ec WHIRLPOOL f7eee6e66a6945468060fded8a0b195c0a1b33df044aab1dd1cf8d630533746c11b8fa978371ee6030d1ff0c60805d4f742cd22547126080b05bcf11ab9cb6a0 +EBUILD JavaScript-SpiderMonkey-0.210.0-r1.ebuild 490 SHA256 a57943e45589815beef9dc828a8269d9c017069d021040a2c31d185ff1812c5a SHA512 41448daec28cbcc185fdde09034d437ca770ee2c9c08409abc39cc22416df0d8ebf2618a81b35edd9a683c26a74533e637fd403d8b30524ee55ede3e12b01a05 WHIRLPOOL 86333a092a7b0066261a59659251675d903f254c98137ee1c3cb6d7b93f2ac346850c32746e17da0bad5fd35cc502068ba40194539acde5701c41ec7e85a5fd1 +MISC ChangeLog 2679 SHA256 f5a64f3816ea1816653f4ae0d505748a1b984246e8d4300b50b7771225a0bcb7 SHA512 3ffd59949572d3861fd1abfebcc6b4b22109153d747b141f78d9caf2c772e08edfd06b6a0a634f376c47196bee4d666c2a56b57cbeceb7083de7042ed44fc22a WHIRLPOOL 31868285d91137bb34e6d90d7ee6daab7abc3ffd14e3b67c5e1bb5ccd37c5c94ccbf469324b8894dc58e89e1e5d57a1abcba9242e7e5a650c5c0116184732942 +MISC ChangeLog-2015 2082 SHA256 35835bae4cc52e847c8e52e6963585a6b6c14efe8c7a42148af647f9e8a8a959 SHA512 d681a8ef47142b8f29193c4ec49ee0e2d583a7f6a7d0743708b98eb82e1ad001821a9cf5d4b87355fcf058ceae79cc46dcfbcb0bad5f71d9bee369d923c1300f WHIRLPOOL 5d9438026055dd8b5f364ee5ad41087810535bc2957df63f1f66b510a797ad24e8096ce8833e78b5ceb5badb83d6369ec8ebef56f35844d4e692fa03b8845314 +MISC metadata.xml 418 SHA256 4cdd1097ea72756d0a02aaaa8b1cd206051eee4a36557cc8601595d1dc15e478 SHA512 272a2732f91a987ddc8859d39b1589f453ad1bd4f5c410c6c014b680670368a48a4835eb92ef0eb764e57e53ca8e688179db420056097d7ff2cf7cd4ec3b47db WHIRLPOOL 471d77d7bdbe8c3e2cb4242437b43541fa641d4210158fcd638e0b0ef8c24a7926b9af7ae38dfc7608991cfbded76c62421f567779e87f4389081015633fb69a diff --git a/dev-perl/JavaScript-SpiderMonkey/files/mozjs185.patch b/dev-perl/JavaScript-SpiderMonkey/files/mozjs185.patch new file mode 100644 index 000000000000..5ba0f32a8fc6 --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/files/mozjs185.patch @@ -0,0 +1,464 @@ +diff -ur a/Makefile.PL b/Makefile.PL +--- a/Makefile.PL 2010-05-29 02:43:06.000000000 -0400 ++++ b/Makefile.PL 2012-10-11 14:56:18.000000000 -0400 +@@ -12,6 +12,7 @@ + ###################################################################### + + use ExtUtils::MakeMaker; ++use ExtUtils::PkgConfig; + use Getopt::Long; + + # Get the right lib and include dirs for different platforms +@@ -37,7 +38,7 @@ + "/usr/lib/firefox" => "/usr/include/firefox", + ); + +-my ($JS_LIB_DIR, @JS_INCL_DIRS, $JS_LIB_NAME); ++my ($JS_LIB_DIR, @JS_INCL_DIRS, $JS_LIB_NAME, $JS_LIBS, $JS_INCLUDES); + + #### Determine compile options + ############################## +@@ -57,6 +58,19 @@ + "JS_LIB_DIR=s" => \$JS_LIB_DIR, + "JS_LIB_NAME=s" => \$JS_LIB_NAME, + ); ++ ++# try to find spidermonkey via pkg-config first ++ ++$JS_LIBS = ExtUtils::PkgConfig->libs ('mozjs187'); ++if ("".$JS_LIBS ne "") { ++ $JS_INCLUDES = ExtUtils::PkgConfig->cflags ('mozjs187'); ++} else { ++ $JS_LIBS = ExtUtils::PkgConfig->libs ('mozjs185'); ++ if ("".$JS_LIBS ne "") { ++ $JS_INCLUDES = ExtUtils::PkgConfig->cflags ('mozjs185'); ++ } else { ++ ++# pkg-config did not work, use the old (direct) way to find older libs + if ($JS_LIB_DIR) { + push @JS_INCL_DIRS, $JS_LIB_DIR; + } +@@ -78,13 +92,15 @@ + } + } + if (scalar(@JS_INCL_DIRS) == scalar(@c_header_files)) { +- $JS_LIB_DIR = $libfile; ++ $JS_LIB_DIR = "-L".$libfile; + $JS_LIB_DIR =~ s/$possible_lib$//; + + $JS_LIB_NAME = $possible_lib; + $JS_LIB_NAME =~ s/\.(a|so|dll)$//; + $JS_LIB_NAME =~ s/^lib//; + ++ $JS_LIBS = "-l".$JS_LIB_NAME; ++ + last; + } else { + @JS_INCL_DIRS = (); +@@ -94,15 +110,22 @@ + } + last if $JS_LIB_DIR; + } ++foreach my $include_dir(@JS_INCL_DIRS) { ++ $JS_INCLUDES.=" -I".$include_dir; ++} + + if ($JS_INCL_DIRS[0] eq $JS_INCL_DIRS[1]) { + shift @JS_INCL_DIRS; + } + ++} # end of pkgcfg mozjs185 ++} # end of pkgcfg mozjs187 ++ ++ + ## If no SpiderMonkey library found report that and exit. + ## Otherwise print lib and include paths. + +-if (!$JS_LIB_DIR) { ++if (!$JS_LIBS) { + print <= 5.005 ? ## Add these new keywords supported since 5.005 + (ABSTRACT_FROM => 'SpiderMonkey.pm', # retrieve abstract from module + AUTHOR => 'Mike Schilli ') : ()), +- 'LIBS' => ["-L$JS_LIB_DIR -l$JS_LIB_NAME"], ++ 'LIBS' => ["$JS_LIB_DIR $JS_LIBS"], + 'DEFINE' => $JS_DEFINE, # e.g., '-DHAVE_SOMETHING' + # Insert -I. if you add *.h files later: +- 'INC' => "-I".join " -I", @JS_INCL_DIRS, ++# 'INC' => "-I".join " -I", @JS_INCL_DIRS, ++ 'INC' => $JS_INCLUDES, + # Un-comment this if you add C files to link with later: + # 'OBJECT' => '$(O_FILES)', # link all the C files too + ); +diff -ur a/SpiderMonkey.pm b/SpiderMonkey.pm +--- a/SpiderMonkey.pm 2010-05-29 02:49:31.000000000 -0400 ++++ b/SpiderMonkey.pm 2012-10-11 14:56:18.000000000 -0400 +@@ -161,9 +161,8 @@ + $self->{global_class} = + JavaScript::SpiderMonkey::JS_GlobalClass(); + $self->{global_object} = +- JavaScript::SpiderMonkey::JS_NewObject( +- $self->{context}, $self->{global_class}, +- $self->{global_class}, $self->{global_class}); ++ JavaScript::SpiderMonkey::JS_NewCompartmentAndGlobalObject( ++ $self->{context}, $self->{global_class}); + + JavaScript::SpiderMonkey::JS_InitStandardClasses($self->{context}, + $self->{global_object}); +diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs +--- a/SpiderMonkey.xs 2010-05-29 02:49:31.000000000 -0400 ++++ b/SpiderMonkey.xs 2012-10-11 14:56:18.000000000 -0400 +@@ -20,10 +20,13 @@ + #define snprintf _snprintf + #endif + ++#ifndef JSCLASS_GLOBAL_FLAGS ++#define JSCLASS_GLOBAL_FLAGS 0 ++#endif + /* JSRuntime needs this global class */ + static + JSClass global_class = { +- "Global", 0, ++ "Global", JSCLASS_GLOBAL_FLAGS, + JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, + JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub + }; +@@ -67,10 +70,18 @@ + * I hope all reasonable machines can hold an address in + * an int. + */ +- XPUSHs(sv_2mortal(newSViv((int)obj))); ++ XPUSHs(sv_2mortal(newSViv(PTR2IV(obj)))); ++#if JS_VERSION < 185 + XPUSHs(sv_2mortal(newSVpv(JS_GetStringBytes(JSVAL_TO_STRING(id)), 0))); ++#else ++ XPUSHs(sv_2mortal(newSVpv(JS_EncodeString(cx, JSVAL_TO_STRING(id)), 0))); ++#endif + XPUSHs(sv_2mortal(newSVpv(what, 0))); ++#if JS_VERSION < 185 + XPUSHs(sv_2mortal(newSVpv(JS_GetStringBytes(JSVAL_TO_STRING(*vp)), 0))); ++#else ++ XPUSHs(sv_2mortal(newSVpv(JS_EncodeString(cx, JSVAL_TO_STRING(*vp)), 0))); ++#endif + PUTBACK; + call_pv("JavaScript::SpiderMonkey::getsetter_dispatcher", G_DISCARD); + FREETMPS; +@@ -83,10 +94,21 @@ + JSBool getter_dispatcher( + JSContext *cx, + JSObject *obj, ++#if JS_VERSION < 185 + jsval id, ++#else ++ jsid iid, ++#endif + jsval *vp + /* --------------------------------------------------------------------- */ + ) { ++#if JS_VERSION >= 185 ++ jsval id; ++ if (!JS_IdToValue(cx,iid,&id)) { ++ fprintf(stderr, "getter_dispatcher: JS_IdToValue failed.\n"); ++ return JS_FALSE; ++ } ++#endif + return getsetter_dispatcher(cx, obj, id, vp, "getter"); + } + +@@ -94,10 +116,22 @@ + JSBool setter_dispatcher( + JSContext *cx, + JSObject *obj, ++#if JS_VERSION < 185 + jsval id, ++#else ++ jsid iid, ++ JSBool strict, ++#endif + jsval *vp + /* --------------------------------------------------------------------- */ + ) { ++#if JS_VERSION >= 185 ++ jsval id; ++ if (!JS_IdToValue(cx,iid,&id)) { ++ fprintf(stderr, "setter_dispatcher: JS_IdToValue failed.\n"); ++ return JS_FALSE; ++ } ++#endif + return getsetter_dispatcher(cx, obj, id, vp, "setter"); + } + +@@ -128,10 +162,19 @@ + + /* --------------------------------------------------------------------- */ + static JSBool ++#if JS_VERSION < 185 + FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, + jsval *argv, jsval *rval) { ++#else ++FunctionDispatcher(JSContext *cx, uintN argc, jsval *vp) { ++#endif + /* --------------------------------------------------------------------- */ + dSP; ++#if JS_VERSION >= 185 ++ JSObject *obj = JS_THIS_OBJECT(cx,vp); ++ jsval *argv = JS_ARGV(cx,vp); ++ jsval rval; ++#endif + SV *sv; + char *n_jstr; + int n_jnum; +@@ -149,12 +192,20 @@ + ENTER ; + SAVETMPS ; + PUSHMARK(SP); +- XPUSHs(sv_2mortal(newSViv((int)obj))); ++ XPUSHs(sv_2mortal(newSViv(PTR2IV(obj)))); + XPUSHs(sv_2mortal(newSVpv( +- JS_GetFunctionName(fun), 0))); ++#if JS_VERSION < 185 ++ JS_GetStringBytes(JS_GetFunctionId(fun)), 0))); ++#else ++ JS_EncodeString(cx, JS_GetFunctionId(fun)), 0))); ++#endif + for(i=0; ibranch_count = 0; + pcx->branch_max = max_branch_operations; ++#if JS_VERSION < 181 + JS_SetBranchCallback(cx, BranchHandler); ++#else ++ JS_SetOperationCallback(cx, BranchHandler); ++#endif + } + OUTPUT: + +diff -ur a/t/error.t b/t/error.t +--- a/t/error.t 2010-05-28 13:02:43.000000000 -0400 ++++ b/t/error.t 2012-10-11 14:56:18.000000000 -0400 +@@ -9,7 +9,7 @@ + $js1->init (); + ok (!$js1->eval ($jscode1)); + ok ($@ !~ "\n"); +-ok ($@ =~ "SyntaxError"); ++ok ($@ =~ "SyntaxError" || $@ =~ "ReferenceError: invalid assignment left-hand side"); + #print "$@\n"; + my $jscode2 =< + + + + perl@gentoo.org + Gentoo Perl Project + + + JavaScript-SpiderMonkey + JavaScript::SpiderMonkey + + -- cgit v1.2.3