From 200653a644d2f823f3e481bf3c2c9e73d808b8ad Mon Sep 17 00:00:00 2001 From: Kent Fredric Date: Thu, 26 Oct 2017 19:03:14 +1300 Subject: dev-perl/JavaScript-SpiderMonkey: Fix '.' in @INC tests bug #617006 - Patch tests - Rework mozjs patch to apply cleanly against 0.21 Closes: https://bugs.gentoo.org/617006 Package-Manager: Portage-2.3.8, Repoman-2.3.3 --- .../JavaScript-SpiderMonkey-0.210.0-r1.ebuild | 10 +- ...avaScript-SpiderMonkey-0.210.0-no-dot-inc.patch | 167 +++++++++++++++++++++ .../JavaScript-SpiderMonkey/files/mozjs185.patch | 96 +++++++----- 3 files changed, 231 insertions(+), 42 deletions(-) create mode 100644 dev-perl/JavaScript-SpiderMonkey/files/JavaScript-SpiderMonkey-0.210.0-no-dot-inc.patch (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 index 1bcd74535a3f..f706b2f4e578 100644 --- a/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild +++ b/dev-perl/JavaScript-SpiderMonkey/JavaScript-SpiderMonkey-0.210.0-r1.ebuild @@ -1,4 +1,4 @@ -# Copyright 1999-2016 Gentoo Foundation +# Copyright 1999-2017 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 EAPI=5 @@ -18,9 +18,9 @@ RDEPEND="dev-perl/Log-Log4perl DEPEND="${RDEPEND} dev-perl/ExtUtils-PkgConfig" -src_prepare() { - epatch "${FILESDIR}"/mozjs185.patch - perl-module_src_prepare -} +PATCHES=( + "${FILESDIR}/mozjs185.patch" + "${FILESDIR}/${P}-no-dot-inc.patch" +) SRC_TEST=do 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 @@ ###################################################################### @@ -9,8 +25,8 @@ diff -ur a/Makefile.PL b/Makefile.PL use Getopt::Long; # Get the right lib and include dirs for different platforms -@@ -37,7 +38,7 @@ - "/usr/lib/firefox" => "/usr/include/firefox", +@@ -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); @@ -18,7 +34,7 @@ diff -ur a/Makefile.PL b/Makefile.PL #### Determine compile options ############################## -@@ -57,6 +58,19 @@ +@@ -59,6 +60,19 @@ GetOptions( "JS_LIB_DIR=s" => \$JS_LIB_DIR, "JS_LIB_NAME=s" => \$JS_LIB_NAME, ); @@ -38,7 +54,7 @@ diff -ur a/Makefile.PL b/Makefile.PL if ($JS_LIB_DIR) { push @JS_INCL_DIRS, $JS_LIB_DIR; } -@@ -78,13 +92,15 @@ +@@ -80,13 +94,15 @@ foreach my $install_path(keys %possible_install_paths) { } } if (scalar(@JS_INCL_DIRS) == scalar(@c_header_files)) { @@ -55,7 +71,7 @@ diff -ur a/Makefile.PL b/Makefile.PL last; } else { @JS_INCL_DIRS = (); -@@ -94,15 +110,22 @@ +@@ -96,15 +112,22 @@ foreach my $install_path(keys %possible_install_paths) { } last if $JS_LIB_DIR; } @@ -79,7 +95,7 @@ diff -ur a/Makefile.PL b/Makefile.PL print <= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'SpiderMonkey.pm', # retrieve abstract from module AUTHOR => 'Mike Schilli ') : ()), @@ -114,10 +130,11 @@ diff -ur a/Makefile.PL b/Makefile.PL # 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 @@ +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} = @@ -129,9 +146,10 @@ diff -ur a/SpiderMonkey.pm b/SpiderMonkey.pm 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 +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 @@ -147,7 +165,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub }; -@@ -67,10 +70,18 @@ +@@ -67,10 +70,18 @@ JSBool getsetter_dispatcher( * I hope all reasonable machines can hold an address in * an int. */ @@ -167,7 +185,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs PUTBACK; call_pv("JavaScript::SpiderMonkey::getsetter_dispatcher", G_DISCARD); FREETMPS; -@@ -83,10 +94,21 @@ +@@ -83,10 +94,21 @@ JSBool getsetter_dispatcher( JSBool getter_dispatcher( JSContext *cx, JSObject *obj, @@ -189,7 +207,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs return getsetter_dispatcher(cx, obj, id, vp, "getter"); } -@@ -94,10 +116,22 @@ +@@ -94,10 +116,22 @@ JSBool getter_dispatcher( JSBool setter_dispatcher( JSContext *cx, JSObject *obj, @@ -212,7 +230,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs return getsetter_dispatcher(cx, obj, id, vp, "setter"); } -@@ -128,10 +162,19 @@ +@@ -128,10 +162,19 @@ int debug_enabled( /* --------------------------------------------------------------------- */ static JSBool @@ -232,7 +250,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs SV *sv; char *n_jstr; int n_jnum; -@@ -149,12 +192,20 @@ +@@ -149,12 +192,20 @@ FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, ENTER ; SAVETMPS ; PUSHMARK(SP); @@ -255,7 +273,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } PUTBACK; count = call_pv("JavaScript::SpiderMonkey::function_dispatcher", G_SCALAR); -@@ -174,7 +225,11 @@ +@@ -174,7 +225,11 @@ FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, if(Debug) fprintf(stderr, "DEBUG: %lx is a ref!\n", (long) sv); @@ -268,7 +286,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } else if(SvIOK(sv)) { /* It appears that we have been sent an int return -@@ -183,7 +238,11 @@ +@@ -183,7 +238,11 @@ FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, n_jnum=SvIV(sv); if(Debug) fprintf(stderr, "DEBUG: %lx is an int (%d)\n", (long) sv,n_jnum); @@ -280,7 +298,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } else if(SvNOK(sv)) { /* It appears that we have been sent an double return * value. Thats fine we can give javascript an double -@@ -192,11 +251,20 @@ +@@ -192,11 +251,20 @@ FunctionDispatcher(JSContext *cx, JSObject *obj, uintN argc, if(Debug) fprintf(stderr, "DEBUG: %lx is a double(%f)\n", (long) sv,n_jdbl); @@ -301,7 +319,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } } -@@ -240,8 +308,13 @@ +@@ -240,8 +308,13 @@ ErrorReporter(JSContext *cx, const char *message, JSErrorReport *report) { } /* --------------------------------------------------------------------- */ @@ -315,7 +333,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs /* --------------------------------------------------------------------- */ PJS_Context* pcx = (PJS_Context*) JS_GetContextPrivate(cx); -@@ -374,11 +447,46 @@ +@@ -374,11 +447,46 @@ JS_NewObject(cx, class, proto, parent) JSObject *obj; CODE: { @@ -362,7 +380,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } OUTPUT: RETVAL -@@ -404,6 +512,9 @@ +@@ -404,6 +512,9 @@ JS_InitClass(cx, iobj, parent_proto, clasp, constructor, nargs, ps, fs, static_p na = (uintN) nargs; CODE: { @@ -372,7 +390,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs obj = JS_InitClass(cx, iobj, parent_proto, clasp, constructor, nargs, ps, fs, static_ps, static_fs); -@@ -411,6 +522,9 @@ +@@ -411,6 +522,9 @@ JS_InitClass(cx, iobj, parent_proto, clasp, constructor, nargs, ps, fs, static_p XSRETURN_UNDEF; } RETVAL = obj; @@ -382,7 +400,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } OUTPUT: RETVAL -@@ -469,11 +583,17 @@ +@@ -469,11 +583,17 @@ JS_InitStandardClasses(cx, gobj) JSBool rc; CODE: { @@ -400,7 +418,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } OUTPUT: RETVAL -@@ -582,10 +702,18 @@ +@@ -582,10 +702,18 @@ JS_GetProperty(cx, obj, name) rc = JS_GetProperty(cx, obj, name, &vp); if(rc) { str = JS_ValueToString(cx, vp); @@ -419,7 +437,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } } else { sv = &PL_sv_undef; -@@ -675,10 +803,18 @@ +@@ -675,10 +803,18 @@ JS_GetElement(cx, obj, idx) rc = JS_GetElement(cx, obj, idx, &vp); if(rc) { str = JS_ValueToString(cx, vp); @@ -438,7 +456,7 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } } else { sv = &PL_sv_undef; -@@ -718,7 +854,11 @@ +@@ -718,7 +854,11 @@ JS_SetMaxBranchOperations(cx, max_branch_operations) PJS_Context* pcx = (PJS_Context *) JS_GetContextPrivate(cx); pcx->branch_count = 0; pcx->branch_max = max_branch_operations; @@ -450,10 +468,11 @@ diff -ur a/SpiderMonkey.xs b/SpiderMonkey.xs } 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 @@ +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"); @@ -462,3 +481,6 @@ diff -ur a/t/error.t b/t/error.t #print "$@\n"; my $jscode2 =<