From 8d13533e467e4c166e3852e36d90af15941ed65c Mon Sep 17 00:00:00 2001 From: Eivind Uggedal Date: Fri, 14 Aug 2015 08:26:51 +0000 Subject: [PATCH] New package: slimerjs-0.9.6 --- srcpkgs/slimerjs/patches/gecko-40.patch | 51 +++++++++++++++++++++++++ srcpkgs/slimerjs/template | 27 +++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 srcpkgs/slimerjs/patches/gecko-40.patch create mode 100644 srcpkgs/slimerjs/template diff --git a/srcpkgs/slimerjs/patches/gecko-40.patch b/srcpkgs/slimerjs/patches/gecko-40.patch new file mode 100644 index 00000000000..f831afc8461 --- /dev/null +++ b/srcpkgs/slimerjs/patches/gecko-40.patch @@ -0,0 +1,51 @@ +From 1668cb41f53ed2bad116a876f615fe133e7fb314 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Jerry=20Lundstr=C3=B6m?= +Date: Wed, 12 Aug 2015 11:07:25 +0200 +Subject: [PATCH] Update supported Gecko version to 40.*. Fix 'Sandbox must + subsume sandboxPrototype' error by supplying the content window as prototype + if the Gecko version is 40 or above. + +--- + src/application.ini | 2 +- + src/modules/slLauncher.jsm | 11 ++++++++--- + 2 files changed, 9 insertions(+), 4 deletions(-) + +diff --git a/src/application.ini b/src/application.ini +index 46f151a..4fb267b 100644 +--- src/application.ini ++++ src/application.ini +@@ -8,4 +8,4 @@ Copyright=Copyright 2012-2015 Laurent Jouanneau & Innophi + + [Gecko] + MinVersion=17.0.0 +-MaxVersion=39.* ++MaxVersion=40.* +diff --git a/src/modules/slLauncher.jsm b/src/modules/slLauncher.jsm +index e49e811..72e4004 100644 +--- src/modules/slLauncher.jsm ++++ src/modules/slLauncher.jsm +@@ -22,6 +22,10 @@ const fileHandler = Cc["@mozilla.org/network/protocol;1?name=file"] + .getService(Ci.nsIFileProtocolHandler) + const systemPrincipal = Cc['@mozilla.org/systemprincipal;1'] + .createInstance(Ci.nsIPrincipal) ++const appInfo = Cc["@mozilla.org/xre/app-info;1"] ++ .getService(Ci.nsIXULAppInfo); ++const versionComparator = Cc["@mozilla.org/xpcom/version-comparator;1"] ++ .getService(Ci.nsIVersionComparator); + + /** + * this function retrieves various informations +@@ -92,9 +96,10 @@ var slLauncher = { + // prepare the sandbox to execute coffee script injected with injectJs + coffeeScriptSandbox = Cu.Sandbox(contentWindow, + { +- 'sandboxName': 'coffeescript', +- 'sandboxPrototype': {}, +- 'wantXrays': true ++ sandboxName: 'coffeescript', ++ // XULrunner 40.0 and above handles sandboxPrototype different then before ++ sandboxPrototype: versionComparator.compare(appInfo.platformVersion, '40') < 0 ? {} : contentWindow, ++ wantXrays: true + }); + let src = slUtils.readChromeFile("resource://slimerjs/coffee-script/extras/coffee-script.js"); + Cu.evalInSandbox('var CoffeeScript;', coffeeScriptSandbox, 'ECMAv5', 'slLauncher::launchMainScript', 1); diff --git a/srcpkgs/slimerjs/template b/srcpkgs/slimerjs/template new file mode 100644 index 00000000000..f177f91d3df --- /dev/null +++ b/srcpkgs/slimerjs/template @@ -0,0 +1,27 @@ +# Template file for 'slimerjs' +pkgname=slimerjs +version=0.9.6 +revision=1 +noarch=yes +wrksrc=$pkgname-RELEASE_$version +hostmakedepends="zip" +depends="bash firefox<=4.0" +short_desc="A scriptable browser for Firefox" +maintainer="Eivind Uggedal " +license="MPL-2.0, BSD" +homepage="https://slimerjs.org" +distfiles="https://github.com/laurentj/$pkgname/archive/RELEASE_${version}.tar.gz" +checksum=6c0b36c2ed21351e7dd26140e452af5f98877d1071021d164b97daf39f9fe55c + +do_build() { + ./buildpackage.sh --no-bin +} + +do_install() { + local dist=_dist/$pkgname-$version + mkdir -p $DESTDIR/usr/{bin,share/$pkgname} + vcopy "$dist/$pkgname $dist/*.ja $dist/*.ini $dist/chrome" \ + usr/share/$pkgname + ln -s ../share/$pkgname/$pkgname $DESTDIR/usr/bin/$pkgname + vlicense LICENSE +}