From ecdac123787b96ce6649f0f91da12ea6458cc2b1 Mon Sep 17 00:00:00 2001 From: Palica Date: Tue, 23 Jun 2020 22:35:08 +0200 Subject: Updating liguros repo --- .../JavaScript-SpiderMonkey-0.210.0-r1.ebuild | 26 ++ dev-perl/JavaScript-SpiderMonkey/Manifest | 1 + ...avaScript-SpiderMonkey-0.210.0-no-dot-inc.patch | 167 +++++++ .../JavaScript-SpiderMonkey/files/mozjs185.patch | 486 +++++++++++++++++++++ dev-perl/JavaScript-SpiderMonkey/metadata.xml | 13 + 5 files changed, 693 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/JavaScript-SpiderMonkey-0.210.0-no-dot-inc.patch 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..f706b2f4e578 --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild @@ -0,0 +1,26 @@ +# Copyright 1999-2017 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" + +PATCHES=( + "${FILESDIR}/mozjs185.patch" + "${FILESDIR}/${P}-no-dot-inc.patch" +) + +SRC_TEST=do diff --git a/dev-perl/JavaScript-SpiderMonkey/Manifest b/dev-perl/JavaScript-SpiderMonkey/Manifest new file mode 100644 index 000000000000..c3093664ceb6 --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/Manifest @@ -0,0 +1 @@ +DIST JavaScript-SpiderMonkey-0.21.tar.gz 19494 BLAKE2B 842769d02b04d489b9fac446b0ec24ba7feca6c0206ca0927528af81bc464ab31c0b617635f060fa4a0e230da13901306192dfdf99db1f442ea84af33997e778 SHA512 5a1e26d8ee15c73a566715ac150ac597e6bbf542629bf1884ae623478ed6dd1085b4afc02ab6a152c7407239ba46a9d30f9472fc6375fab823815b38372fb1ec diff --git a/dev-perl/JavaScript-SpiderMonkey/files/JavaScript-SpiderMonkey-0.210.0-no-dot-inc.patch b/dev-perl/JavaScript-SpiderMonkey/files/JavaScript-SpiderMonkey-0.210.0-no-dot-inc.patch new file mode 100644 index 000000000000..f76aaa95a1ce --- /dev/null +++ b/dev-perl/JavaScript-SpiderMonkey/files/JavaScript-SpiderMonkey-0.210.0-no-dot-inc.patch @@ -0,0 +1,167 @@ +From c89a871ead0a961f8a0125d875cbe28974e23f29 Mon Sep 17 00:00:00 2001 +From: Kent Fredric +Date: Thu, 26 Oct 2017 18:50:34 +1300 +Subject: Fix test failures without '.' in @INC + +Bug: https://bugs.gentoo.org/617006 +Bug: https://rt.cpan.org/Ticket/Display.html?id=121452 +--- + t/00array.t | 2 +- + t/01doc-href.t | 2 +- + t/02nav-appv.t | 2 +- + t/03doc-write.t | 2 +- + t/04loop.t | 2 +- + t/05form.t | 2 +- + t/06form2.t | 2 +- + t/07func.t | 2 +- + t/08func2.t | 2 +- + t/09meth.t | 2 +- + t/10elobj.t | 2 +- + 11 files changed, 11 insertions(+), 11 deletions(-) + +diff --git a/t/00array.t b/t/00array.t +index 3bd85a6..ba36807 100755 +--- a/t/00array.t ++++ b/t/00array.t +@@ -5,7 +5,7 @@ + print "1..1\n"; + + $init = ""; +-require "t/init.pl"; ++require "./t/init.pl"; + + $js->array_by_path("document.form"); + +diff --git a/t/01doc-href.t b/t/01doc-href.t +index 7f79c95..c545ca7 100755 +--- a/t/01doc-href.t ++++ b/t/01doc-href.t +@@ -6,7 +6,7 @@ print "1..1\n"; + + $init = ""; + +-require "t/init.pl"; ++require "./t/init.pl"; + + my $source = <array_by_path("document.array"); + my $e = $js->array_set_element($a, 0, "gurkenhobel"); +diff --git a/t/07func.t b/t/07func.t +index c0f95cc..9b12633 100644 +--- a/t/07func.t ++++ b/t/07func.t +@@ -6,7 +6,7 @@ print "1..1\n"; + + $init = ""; + $buffer = ""; +-require "t/init.pl"; ++require "./t/init.pl"; + + my $source = < +Date: Fri, 12 Oct 2012 08:09:57 +1300 +Subject: Support spidermonkey 1.8.5 and newer + +Fix support for x86_64 + +Bug: https://bugs.gentoo.org/404129 +--- + Makefile.PL | 44 ++++++++++++----- + SpiderMonkey.pm | 5 +- + SpiderMonkey.xs | 150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-- + t/error.t | 2 +- + 4 files changed, 180 insertions(+), 21 deletions(-) + +diff --git a/Makefile.PL b/Makefile.PL +index 901b773..6095dcd 100644 +--- a/Makefile.PL ++++ b/Makefile.PL +@@ -12,6 +12,7 @@ + ###################################################################### + + use ExtUtils::MakeMaker; ++use ExtUtils::PkgConfig; + use Getopt::Long; + + # Get the right lib and include dirs for different platforms +@@ -39,7 +40,7 @@ my %possible_install_paths = ( + "/opt/local/lib" => "/opt/local/include", # MacPorts + ); + +-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 + ############################## +@@ -59,6 +60,19 @@ GetOptions( + "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; + } +@@ -80,13 +94,15 @@ foreach my $install_path(keys %possible_install_paths) { + } + } + 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 = (); +@@ -96,15 +112,22 @@ foreach my $install_path(keys %possible_install_paths) { + } + 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 --git a/SpiderMonkey.pm b/SpiderMonkey.pm +index 223204a..de210c3 100644 +--- a/SpiderMonkey.pm ++++ b/SpiderMonkey.pm +@@ -162,9 +162,8 @@ sub init { + $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 --git a/SpiderMonkey.xs b/SpiderMonkey.xs +index 4d97117..1cfc9a5 100644 +--- a/SpiderMonkey.xs ++++ b/SpiderMonkey.xs +@@ -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 @@ JSBool getsetter_dispatcher( + * 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 getsetter_dispatcher( + 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 getter_dispatcher( + 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 @@ int debug_enabled( + + /* --------------------------------------------------------------------- */ + 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 @@ FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, + 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 --git a/t/error.t b/t/error.t +index 732226c..de977a1 100644 +--- a/t/error.t ++++ b/t/error.t +@@ -9,7 +9,7 @@ my $js1 = JavaScript::SpiderMonkey->new (); + $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 + + gentoo-staging + -- cgit v1.3