[Pkg-javascript-commits] [html2canvas] 02/02: Initial Debian packaging

Ximin Luo infinity0 at debian.org
Mon Nov 21 00:46:44 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository html2canvas.

commit 1a15c135107637c1db299cf186ba30ef694891bf
Author: Ximin Luo <infinity0 at debian.org>
Date:   Mon Nov 21 01:45:43 2016 +0100

    Initial Debian packaging
---
 debian/README.Debian                           |  18 +
 debian/README.source                           |  10 +
 debian/changelog                               |   5 +
 debian/compat                                  |   1 +
 debian/control                                 |  82 ++++
 debian/copyright                               |  55 +++
 debian/docs                                    |   1 +
 debian/gbp.conf                                |   3 +
 debian/html2canvas.js.footer                   |   2 +
 debian/html2canvas.js.header                   |  15 +
 debian/libjs-html2canvas.examples              |   1 +
 debian/libjs-html2canvas.install               |   1 +
 debian/main.mk                                 |  51 +++
 debian/missing-sources/browser-shim.js         | 156 ++++++++
 debian/missing-sources/mocha-phantomjs-core.js | 240 +++++++++++
 debian/missing-sources/punycode.js             | 533 +++++++++++++++++++++++++
 debian/node-html2canvas.install                |   1 +
 debian/node-html2canvas.links                  |   2 +
 debian/patches/enable-package-test.patch       |  19 +
 debian/patches/fix-failing-test.patch          |  18 +
 debian/patches/series                          |   2 +
 debian/rules                                   |  34 ++
 debian/source/format                           |   1 +
 debian/tests/control                           |   2 +
 debian/watch                                   |   5 +
 25 files changed, 1258 insertions(+)

diff --git a/debian/README.Debian b/debian/README.Debian
new file mode 100644
index 0000000..2d160c7
--- /dev/null
+++ b/debian/README.Debian
@@ -0,0 +1,18 @@
+html2canvas.svg
+===============
+
+html2canvas is normally distributed with a second component, html2canvas.svg.js
+as well as the main html2canvas.js.
+
+This Debian package does *NOT* contain html2canvas.svg.js, because it requires
+https://github.com/kangax/fabric.js.git to be available in src/fabric. However,
+I was unable to clone that because their git repository is corrupt (#3430) and
+it'd also take a significant amount of effort, since it has many dependencies.
+
+I personally have no interest in packaging html2canvas.svg, because (as far as
+I can see) it's not used by ipywidgets and this is the only reason I'm spending
+any time at all getting my hands dirty with JS and its time-wasting ecosystem
+of bullshit software. However, if someone else wants to add this component, I
+am more than happy to sit back and let them take over this work.
+
+ -- Ximin Luo <infinity0 at debian.org>  Sat, 19 Nov 2016 22:45:44 +0100
diff --git a/debian/README.source b/debian/README.source
new file mode 100644
index 0000000..8a1e5f7
--- /dev/null
+++ b/debian/README.source
@@ -0,0 +1,10 @@
+Debian build script
+===================
+
+Instead of packaging all the Grunt plugins along with browserify and all that
+pretentious nonsense, we use browserify-lite in a tiny Makefile, debian/main.mk.
+
+The output is markedly different from what upstream generates, but we also run
+a good subset of the upstream tests to check that what we generate is sensible.
+
+ -- Ximin Luo <infinity0 at debian.org>  Sat, 19 Nov 2016 02:58:59 +0100
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..89fbd79
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+html2canvas (0.5.0~beta4+ds1-1) unstable; urgency=medium
+
+  * Initial release. (Closes: #845063)
+
+ -- Ximin Luo <infinity0 at debian.org>  Sat, 19 Nov 2016 04:00:20 +0100
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..f599e28
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+10
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..4836d70
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,82 @@
+Source: html2canvas
+Section: web
+Priority: extra
+Maintainer: Debian Javascript Maintainers <pkg-javascript-devel at lists.alioth.debian.org>
+Uploaders: Ximin Luo <infinity0 at debian.org>
+Build-Depends:
+ debhelper (>= 10),
+ dpkg-dev (>= 1.17.14),
+ nodejs (>= 4.0),
+ node-browserify-lite,
+ node-uglify,
+ python,
+ mocha <!nocheck>,
+ phantomjs <!nocheck>,
+ libjs-es6-promise <!nocheck>,
+ libjs-jquery <!nocheck>,
+# actually mocha should depend on this, it's a bug there
+ libjs-mocha <!nocheck>,
+ node-expect.js <!nocheck>,
+ node-requirejs <!nocheck>,
+ xvfb <!nocheck>,
+ xauth <!nocheck>
+Standards-Version: 3.9.8
+Homepage: https://github.com/niklasvh/html2canvas
+Vcs-Git: https://anonscm.debian.org/git/pkg-javascript/html2canvas.git
+Vcs-Browser: https://anonscm.debian.org/cgit/pkg-javascript/html2canvas.git
+
+Package: libjs-html2canvas
+Architecture: all
+Depends: ${misc:Depends}
+Recommends: javascript-common
+Description: Take screenshots of webpages directly in the browser - browser library
+ html2canvas allows you to take "screenshots" of webpages or parts of it,
+ directly on the users browser. The screenshot is based on the DOM and as such
+ may not be 100% accurate to the real representation as it does not make an
+ actual screenshot, but builds the screenshot based on the information
+ available on the page.
+ .
+ It renders the current page as a canvas image, by reading the DOM and the
+ different styles applied to the elements.
+ .
+ It does not require any rendering from the server, as the whole image is
+ created on the clients browser. However, as it is heavily dependent on the
+ browser, this library is not suitable to be used in nodejs. It doesn't
+ magically circumvent any browser content policy restrictions either, so
+ rendering cross-origin content will require a proxy to get the content to the
+ same origin.
+ .
+ It is still in a very experimental state, so the author doesn't recommend
+ using it in a production environment nor start building applications with it
+ yet, as there will be still major changes made.
+ .
+ This package contains the plain JS library as well as a minified version.
+
+Package: node-html2canvas
+Architecture: all
+Depends: ${misc:Depends}, libjs-html2canvas
+Recommends: nodejs
+Description: Take screenshots of webpages directly in the browser - NodeJS module
+ html2canvas allows you to take "screenshots" of webpages or parts of it,
+ directly on the users browser. The screenshot is based on the DOM and as such
+ may not be 100% accurate to the real representation as it does not make an
+ actual screenshot, but builds the screenshot based on the information
+ available on the page.
+ .
+ It renders the current page as a canvas image, by reading the DOM and the
+ different styles applied to the elements.
+ .
+ It does not require any rendering from the server, as the whole image is
+ created on the clients browser. However, as it is heavily dependent on the
+ browser, this library is not suitable to be used in nodejs. It doesn't
+ magically circumvent any browser content policy restrictions either, so
+ rendering cross-origin content will require a proxy to get the content to the
+ same origin.
+ .
+ It is still in a very experimental state, so the author doesn't recommend
+ using it in a production environment nor start building applications with it
+ yet, as there will be still major changes made.
+ .
+ This package contains the NodeJS package. Note that html2canvas is NOT suited
+ to be used from NodeJS. However some people these days use NPM for non-NodeJS
+ purposes. This package is for those special people.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..b9a08da
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,55 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: html2canvas
+Source: https://github.com/niklasvh/html2canvas
+Files-Excluded: dist/* tests/mocha/lib/* tests/assets/jquery-*.js
+
+Files: *
+Copyright: 2012-2016 Niklas von Hertzen <niklasvh at gmail.com>
+License: Expat
+
+Files: debian/*
+Copyright: 2016 Ximin Luo <infinity0 at debian.org>
+License: Expat
+
+Files: debian/missing-sources/punycode.js
+Copyright: 2014 Mathias Bynens <https://mathiasbynens.be/>
+Comment:
+ https://raw.githubusercontent.com/bestiejs/punycode.js/v1.4.1/punycode.js
+ .
+ punycode in Debian is v2.0.1 and only supports ES6, not ES5. However the
+ latter is what html2canvas needs. Incidentally one figures out that punycode
+ is needed at all, by downloading the pre-built html2canvas.js from npm and
+ looking through the embedded JS code. They forgot to declare it as a
+ dependency in package.json or anywhere else.
+License: Expat
+
+Files: debian/missing-sources/mocha-phantomjs-core.js
+       debian/missing-sources/browser-shim.js
+Copyright: 2013-2016 Nathan Black <nathan at nathanblack.org> (https://github.com/nathanboktae)
+           2012-2013 Ken Collins <ken at metaskills.net> (http://metaskills.net/)
+           2012-2016 mocha-phantomjs-core contributors (https://github.com/nathanboktae/mocha-phantomjs-core/blob/master/package.json)
+Comment:
+ https://github.com/nathanboktae/mocha-phantomjs-core/blob/9112813fa2665c33c1ed3140c652e96d01de7a89/mocha-phantomjs-core.js
+ https://github.com/nathanboktae/mocha-phantomjs-core/blob/9112813fa2665c33c1ed3140c652e96d01de7a89/browser-shim.js
+ .
+ These two files are needed to run the tests.
+License: Expat
+
+License: Expat
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+ .
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+ .
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/debian/docs b/debian/docs
new file mode 100644
index 0000000..cdb5f04
--- /dev/null
+++ b/debian/docs
@@ -0,0 +1 @@
+readme.md
diff --git a/debian/gbp.conf b/debian/gbp.conf
new file mode 100644
index 0000000..5474c60
--- /dev/null
+++ b/debian/gbp.conf
@@ -0,0 +1,3 @@
+[DEFAULT]
+pristine-tar = True
+sign-tags = True
diff --git a/debian/html2canvas.js.footer b/debian/html2canvas.js.footer
new file mode 100644
index 0000000..878459a
--- /dev/null
+++ b/debian/html2canvas.js.footer
@@ -0,0 +1,2 @@
+return __result;
+});
diff --git a/debian/html2canvas.js.header b/debian/html2canvas.js.header
new file mode 100644
index 0000000..586e627
--- /dev/null
+++ b/debian/html2canvas.js.header
@@ -0,0 +1,15 @@
+(function(f) {
+// These shenanigans are needed to get tests/node/package.js working with browserify-lite
+    var g;
+    if (typeof window !== "undefined") {
+        g = window;
+    } else {
+        g = {};
+    }
+    f(g);
+    if (typeof exports==="object" && typeof module!=="undefined") {
+        module.exports = g.html2canvas;
+    }
+    return g.html2canvas;
+})(function(window){
+var __result =
diff --git a/debian/libjs-html2canvas.examples b/debian/libjs-html2canvas.examples
new file mode 100644
index 0000000..e39721e
--- /dev/null
+++ b/debian/libjs-html2canvas.examples
@@ -0,0 +1 @@
+examples/*
diff --git a/debian/libjs-html2canvas.install b/debian/libjs-html2canvas.install
new file mode 100644
index 0000000..be15250
--- /dev/null
+++ b/debian/libjs-html2canvas.install
@@ -0,0 +1 @@
+dist/*          usr/share/javascript/html2canvas
diff --git a/debian/main.mk b/debian/main.mk
new file mode 100755
index 0000000..ab424d3
--- /dev/null
+++ b/debian/main.mk
@@ -0,0 +1,51 @@
+#!/usr/bin/make -f
+
+NODE_PATH = $(PWD):/usr/lib/nodejs
+BROWSERIFY = NODE_PATH=$(NODE_PATH) browserify-lite
+
+HEADER = \
+	python -c 'import json; x = json.load(open("package.json")); \
+	  print("/*\n  %s %s <%s>\n  Copyright (c) 2016 %s\n\n  Released under %s License\n*/\n" \
+	     % (x["name"], x["version"], x["homepage"], x["author"]["name"], x["license"]))'
+
+ALL = dist/html2canvas.js dist/html2canvas.min.js
+
+all: $(ALL)
+
+dist/html2canvas.js: src/core.js debian/html2canvas.js.header debian/html2canvas.js.footer debian/main.mk
+	mkdir -p dist
+	rm -f "$@" && touch "$@"
+	$(HEADER) >> "$@"
+	cat debian/html2canvas.js.header >> "$@"
+# "browserify" in Gruntfile.js
+	$(BROWSERIFY) "$<" --outfile "$@.tmp" --standalone html2canvas
+# The below is basically what the "browserify-derequire" plugin does, as
+# upstream seems to want it in Gruntfile.js
+	sed -i \
+	  -e 's/(\s*require\s*,/(_dereq_,/g' \
+	  -e 's/require\(([^)]*)\)/_dereq_\1/g' \
+	  "$@.tmp"
+	cat "$@.tmp" >> "$@"
+	cat debian/html2canvas.js.footer >> "$@"
+	rm "$@.tmp"
+
+dist/%.min.js: dist/%.js
+# "uglify" in Gruntfile.js
+	uglifyjs --preamble "$$($(HEADER))" "$<" -o "$@"
+
+check:
+# "mochacli" in Gruntfile.js
+	find tests/node/ -name '*.js' \
+	  | xargs -rn1 mocha -R spec
+# "mocha_phantomjs" in Gruntfile.js
+	find tests/mocha/ -path tests/mocha/lib -prune -o -name '*.html' -print \
+	  | xargs -rn1 -I '{}' phantomjs mocha-phantomjs-core.js '{}' spec '{ "useColors": "true" }'
+# Running the webdriver tests are more complex. We can most likely bypass the
+# grunt plugins (like we do for the above) and chromedriver and firefoxdriver
+# are already in Debian. However tests/selenium has extra dependencies that are
+# not, notably node-wd to interact with the webdrivers.
+
+clean:
+	rm -rf $(ALL)
+
+.PHONY: all check clean
diff --git a/debian/missing-sources/browser-shim.js b/debian/missing-sources/browser-shim.js
new file mode 100644
index 0000000..9e25c52
--- /dev/null
+++ b/debian/missing-sources/browser-shim.js
@@ -0,0 +1,156 @@
+(function(){
+
+  if (typeof Function.prototype.bind !== 'function') {
+    Function.prototype.bind = function bind(obj) {
+      var args = Array.prototype.slice.call(arguments, 1),
+        self = this,
+        nop = function() {},
+        bound = function() {
+          return self.apply(
+            this instanceof nop ? this : (obj || {}), args.concat(
+              Array.prototype.slice.call(arguments)
+            )
+          )
+        }
+      nop.prototype = this.prototype || {}
+      bound.prototype = new nop()
+      return bound
+    }
+  }
+
+  function isFileReady(readyState) {
+    // Check to see if any of the ways a file can be ready are available as properties on the file's element
+    return (!readyState || readyState == 'loaded' || readyState == 'complete' || readyState == 'uninitialized')
+  }
+
+  function shimMochaProcess(M) {
+    // Mocha needs a process.stdout.write in order to change the cursor position.
+    M.process = M.process || {}
+    M.process.stdout = M.process.stdout || process.stdout
+    M.process.stdout.write = function(s) { window.callPhantom({ stdout: s }) }
+    window.callPhantom({ getColWith: true })
+  }
+
+  function shimMochaInstance(m) {
+    var origRun = m.run, origUi = m.ui
+    m.ui = function() {
+      var retval = origUi.apply(mocha, arguments)
+      window.callPhantom({ configureMocha: true })
+      m.reporter = function() {}
+      return retval
+    }
+    m.run = function() {
+      window.callPhantom({ testRunStarted: m.suite.suites.length })
+      m.runner = origRun.apply(mocha, arguments)
+      if (m.runner.stats && m.runner.stats.end) {
+        window.callPhantom({ testRunEnded: m.runner })
+      } else {
+        m.runner.on('end', function() {
+          window.callPhantom({ testRunEnded: m.runner })
+        })
+      }
+      return m.runner
+    }
+  }
+
+  Object.defineProperty(window, 'checkForMocha', {
+    value: function() {
+      var scriptTags = document.querySelectorAll('script'),
+          mochaScript = Array.prototype.filter.call(scriptTags, function(s) {
+            var src = s.getAttribute('src')
+            return src && src.match(/mocha\.js$/)
+          })[0]
+
+      if (mochaScript) {
+        mochaScript.onreadystatechange = mochaScript.onload = function () {
+          if (isFileReady(mochaScript.readyState)) {
+            initMochaPhantomJS()
+          }
+        }
+      }
+    }
+  })
+
+  if ('mozInnerScreenX' in window) {
+    // in slimerjs, we can stub out a setter to shim Mocha. phantomjs 2 fails
+    // to allow the property to be reconfigured...
+    Object.defineProperty(window, 'mocha', {
+      get: function() { return undefined },
+      set: function(m) {
+        shimMochaInstance(m)
+        delete window.mocha
+        window.mocha = m
+      },
+      configurable: true
+    })
+
+    Object.defineProperty(window, 'Mocha', {
+      get: function() { return undefined },
+      set: function(m) {
+        delete window.Mocha
+        window.Mocha = m
+        shimMochaProcess(m)
+      },
+      configurable: true
+    })
+  } else {
+    Object.defineProperty(window, 'initMochaPhantomJS', {
+      value: function () {
+        shimMochaProcess(Mocha)
+        shimMochaInstance(mocha)
+        delete window.initMochaPhantomJS
+      },
+      configurable: true
+    })
+  }
+
+  // Mocha needs the formating feature of console.log so copy node's format function and
+  // monkey-patch it into place. This code is copied from node's, links copyright applies.
+  // https://github.com/joyent/node/blob/master/lib/util.js
+  if (!console.format) {
+    console.format = function(f) {
+      if (typeof f !== 'string') {
+        return Array.prototype.map.call(arguments, function(arg) {
+          try {
+            return JSON.stringify(arg)
+          }
+          catch (_) {
+            return '[Circular]'
+          }
+        }).join(' ')
+      }
+      var i = 1;
+      var args = arguments;
+      var len = args.length;
+      var str = String(f).replace(/%[sdj%]/g, function(x) {
+        if (x === '%%') return '%';
+        if (i >= len) return x;
+        switch (x) {
+          case '%s': return String(args[i++]);
+          case '%d': return Number(args[i++]);
+          case '%j':
+            try {
+              return JSON.stringify(args[i++]);
+            } catch (_) {
+              return '[Circular]';
+            }
+          default:
+            return x;
+        }
+      });
+      for (var x = args[i]; i < len; x = args[++i]) {
+        if (x === null || typeof x !== 'object') {
+          str += ' ' + x;
+        } else {
+          str += ' ' + JSON.stringify(x);
+        }
+      }
+      return str;
+    };
+    var origError = console.error;
+    console.error = function(){ origError.call(console, console.format.apply(console, arguments)); };
+    var origLog = console.log;
+    console.log = function(){ origLog.call(console, console.format.apply(console, arguments)); };
+  }
+
+})();
diff --git a/debian/missing-sources/mocha-phantomjs-core.js b/debian/missing-sources/mocha-phantomjs-core.js
new file mode 100644
index 0000000..4718cd3
--- /dev/null
+++ b/debian/missing-sources/mocha-phantomjs-core.js
@@ -0,0 +1,240 @@
+var
+  system = require('system'),
+  webpage = require('webpage'),
+  fs = require('fs'),
+  stderr = system.stderr || system.stdout,
+  url = system.args[1],
+  reporter = system.args[2] || 'spec',
+  configured = false,
+  runStarted = false,
+  isSlimer = 'MozApplicationEvent' in window,
+  config = {},
+  hookData
+
+try {
+  config = JSON.parse(system.args[3] || '{}')
+} catch (e) {
+  console.log(e)
+  console.log('Bad JSON options')
+  phantom.exit(255)
+}
+
+
+if (!url) {
+  system.stdout.writeLine("Usage: " + (isSlimer ? 'slimerjs' : 'phantomjs') + " mocha-phantomjs-core.js URL REPORTER [CONFIG-AS-JSON]")
+  phantom.exit(255)
+}
+
+if (phantom.version.major < 1 || (phantom.version.major === 1 && phantom.version.minor < 9)) {
+  stderr.writeLine('mocha-phantomjs requires PhantomJS > 1.9.1')
+  phantom.exit(-2)
+}
+
+// Create and configure the client page
+var
+  output = config.file ? fs.open(config.file, 'w') : system.stdout,
+  page = webpage.create({
+    settings: config.settings
+  }),
+  fail = function(msg, errno) {
+    if (output && config.file) {
+      output.close()
+    }
+    if (msg) {
+      stderr.writeLine(msg)
+    }
+    return phantom.exit(errno || 1)
+  }
+
+if (config.hooks) {
+  hookData = {
+    page: page,
+    config: config,
+    reporter: reporter
+  }
+  try {
+    config.hooks = require(config.hooks)
+  }
+  catch (e) {
+    stderr.writeLine('Error loading hooks: ' + e.message)
+    phantom.exit(253)
+  }
+} else {
+  config.hooks = {}
+}
+
+if (config.headers) {
+  page.customHeaders = config.headers
+}
+(config.cookies || []).forEach(function(cookie) {
+  page.addCookie(cookie)
+})
+if (config.viewportSize) {
+  page.viewportSize = config.viewportSize
+}
+
+page.onConsoleMessage = function(msg) {
+  return system.stdout.writeLine(msg)
+}
+page.onResourceError = function(resErr) {
+  if (!config.ignoreResourceErrors) {
+    return stderr.writeLine("Error loading resource " + resErr.url + " (" + resErr.errorCode + "). Details: " + resErr.errorString)
+  }
+}
+page.onError = function(msg, traces) {
+  if (page.evaluate(function() { return !!window.onerror })) return
+
+  fail(msg + '\n' + traces.reduce(function(stack, trace) {
+    return stack + '\n  ' + (trace.function ? ' in ' + trace.function + '' : '')
+            + ' at ' + trace.file + ':' + trace.line
+  }, ''))
+}
+
+// Load the test page
+page.open(url)
+page.onInitialized = function() {
+  page.injectJs('browser-shim.js')
+
+  if (isSlimer && config.settings && config.settings.userAgent) {
+    page.evaluate(function(ua) {
+      navigator.__defineGetter__('userAgent', function() { return ua })
+    }, config.settings.userAgent)
+  }
+}
+page.onResourceReceived = function(resource) {
+  if (resource.url.match(/mocha\.js$/)) {
+    page.evaluate(function() {
+      checkForMocha()
+    })
+  }
+}
+page.onCallback = function(data) {
+  if (data) {
+    if (data.stdout) {
+      output.write(data.stdout)
+    } else if (typeof data.screenshot === 'string') {
+      page.render(data.screenshot + '.png')
+    } else if (data.viewportSize && (data.viewportSize.width || data.viewportSize.height)) {
+      page.viewportSize = {
+        width: data.viewportSize.width || page.viewportSize.width,
+        height: data.viewportSize.height || page.viewportSize.height,
+      }
+    } else if (data.configureColWidth) {
+      page.evaluate(function(columns) {
+        Mocha.reporters.Base.window.width = columns
+      }, parseInt(system.env.COLUMNS || 75) * .75 | 0)
+    } else if (data.configureMocha) {
+      configureMocha()
+    } else if ('testRunStarted' in data) {
+      if (data.testRunStarted == 0) {
+        fail('mocha.run() was called with no tests')
+      }
+      runStarted = true
+    } else if (data.testRunEnded) {
+      if (typeof config.hooks.afterEnd === 'function') {
+        hookData.runner = data.testRunEnded
+        config.hooks.afterEnd(hookData)
+      }
+      if (config.file) {
+        output.close()
+      }
+      setTimeout(function() {
+        phantom.exit(data.testRunEnded.failures)
+      }, 100)
+    } else if (data.sendEvent) {
+      page.sendEvent.apply(page, data.sendEvent)
+    }
+  }
+  return true
+}
+page.onLoadFinished = function(status) {
+  page.onLoadFinished = null
+  if (status !== 'success') {
+    fail('Failed to load the page. Check the url: ' + url)
+    return
+  }
+
+  var loadTimeout = config.loadTimeout || 10000
+  setTimeout(function() {
+    if (!configured) {
+      if (page.evaluate(function() { return !window.mocha })) {
+        fail('mocha was not found in the page within ' + loadTimeout + 'ms of the page loading.')
+      } else if (page.evaluate(function() { return window.initMochaPhantomJS })) {
+        fail('Likely due to external resource loading and timing, your tests require calling `window.initMochaPhantomJS()` before calling any mocha setup functions. See https://github.com/nathanboktae/mocha-phantomjs-core/issues/12')
+      } else {
+        fail('mocha was not initialized within ' + loadTimeout + 'ms of the page loading. Make sure to call `mocha.ui` or `mocha.setup`.')
+      }
+    } else if (!runStarted) {
+      fail('mocha.run() was not called within ' + loadTimeout + 'ms of the page loading.')
+    }
+  }, loadTimeout)
+}
+
+function configureMocha() {
+  page.evaluate(function(config, env) {
+    mocha.env = env
+
+    mocha.useColors(config.useColors)
+    mocha.bail(config.bail)
+    if (config.timeout) {
+      mocha.timeout(config.timeout)
+    }
+    if (config.grep) {
+      mocha.grep(config.grep)
+    }
+    if (config.invert) {
+      mocha.invert()
+    }
+  }, config, system.env)
+
+  // setup a the reporter
+  if (page.evaluate(setupReporter, reporter) !== true) {
+    // we failed to set the reporter - likely a 3rd party reporter than needs to be wrapped
+    try {
+      var customReporter = fs.read(reporter)
+    } catch(e) {
+      fail('Unable to open file \'' + reporter + '\'')
+    }
+
+    var wrapper = function() {
+      var exports, module, process, require;
+      require = function(what) {
+        what = what.replace(/[^a-zA-Z0-9]/g, '')
+        for (var r in Mocha.reporters) {
+          if (r.toLowerCase() === what) {
+            return Mocha.reporters[r]
+          }
+        }
+        throw new Error("Your custom reporter tried to require '" + what + "', but Mocha is not running in Node.js in mocha-phantomjs, so Node modules cannot be required - only other reporters");
+      };
+      module = {};
+      exports = undefined;
+      process = Mocha.process;
+      'customreporter';
+      return Mocha.reporters.Custom = exports || module.exports;
+    },
+    wrappedReporter = wrapper.toString().replace("'customreporter'", "(function() {" + (customReporter.toString()) + "})()")
+
+    page.evaluate(wrappedReporter)
+    if (page.evaluate(function() { return !Mocha.reporters.Custom }) ||
+        page.evaluate(setupReporter) !== true) {
+      fail('Failed to use load and use the custom reporter ' + reporter)
+    }
+  }
+
+  if (typeof config.hooks.beforeStart === 'function') {
+    config.hooks.beforeStart(hookData)
+  }
+  configured = true
+}
+
+function setupReporter(reporter) {
+  try {
+    mocha.setup({
+      reporter: reporter || Mocha.reporters.Custom
+    })
+    return true
+  } catch (error) {
+    return error
+  }
+}
\ No newline at end of file
diff --git a/debian/missing-sources/punycode.js b/debian/missing-sources/punycode.js
new file mode 100644
index 0000000..2c87f6c
--- /dev/null
+++ b/debian/missing-sources/punycode.js
@@ -0,0 +1,533 @@
+/*! https://mths.be/punycode v1.4.1 by @mathias */
+;(function(root) {
+
+	/** Detect free variables */
+	var freeExports = typeof exports == 'object' && exports &&
+		!exports.nodeType && exports;
+	var freeModule = typeof module == 'object' && module &&
+		!module.nodeType && module;
+	var freeGlobal = typeof global == 'object' && global;
+	if (
+		freeGlobal.global === freeGlobal ||
+		freeGlobal.window === freeGlobal ||
+		freeGlobal.self === freeGlobal
+	) {
+		root = freeGlobal;
+	}
+
+	/**
+	 * The `punycode` object.
+	 * @name punycode
+	 * @type Object
+	 */
+	var punycode,
+
+	/** Highest positive signed 32-bit float value */
+	maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1
+
+	/** Bootstring parameters */
+	base = 36,
+	tMin = 1,
+	tMax = 26,
+	skew = 38,
+	damp = 700,
+	initialBias = 72,
+	initialN = 128, // 0x80
+	delimiter = '-', // '\x2D'
+
+	/** Regular expressions */
+	regexPunycode = /^xn--/,
+	regexNonASCII = /[^\x20-\x7E]/, // unprintable ASCII chars + non-ASCII chars
+	regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g, // RFC 3490 separators
+
+	/** Error messages */
+	errors = {
+		'overflow': 'Overflow: input needs wider integers to process',
+		'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
+		'invalid-input': 'Invalid input'
+	},
+
+	/** Convenience shortcuts */
+	baseMinusTMin = base - tMin,
+	floor = Math.floor,
+	stringFromCharCode = String.fromCharCode,
+
+	/** Temporary variable */
+	key;
+
+	/*--------------------------------------------------------------------------*/
+
+	/**
+	 * A generic error utility function.
+	 * @private
+	 * @param {String} type The error type.
+	 * @returns {Error} Throws a `RangeError` with the applicable error message.
+	 */
+	function error(type) {
+		throw new RangeError(errors[type]);
+	}
+
+	/**
+	 * A generic `Array#map` utility function.
+	 * @private
+	 * @param {Array} array The array to iterate over.
+	 * @param {Function} callback The function that gets called for every array
+	 * item.
+	 * @returns {Array} A new array of values returned by the callback function.
+	 */
+	function map(array, fn) {
+		var length = array.length;
+		var result = [];
+		while (length--) {
+			result[length] = fn(array[length]);
+		}
+		return result;
+	}
+
+	/**
+	 * A simple `Array#map`-like wrapper to work with domain name strings or email
+	 * addresses.
+	 * @private
+	 * @param {String} domain The domain name or email address.
+	 * @param {Function} callback The function that gets called for every
+	 * character.
+	 * @returns {Array} A new string of characters returned by the callback
+	 * function.
+	 */
+	function mapDomain(string, fn) {
+		var parts = string.split('@');
+		var result = '';
+		if (parts.length > 1) {
+			// In email addresses, only the domain name should be punycoded. Leave
+			// the local part (i.e. everything up to `@`) intact.
+			result = parts[0] + '@';
+			string = parts[1];
+		}
+		// Avoid `split(regex)` for IE8 compatibility. See #17.
+		string = string.replace(regexSeparators, '\x2E');
+		var labels = string.split('.');
+		var encoded = map(labels, fn).join('.');
+		return result + encoded;
+	}
+
+	/**
+	 * Creates an array containing the numeric code points of each Unicode
+	 * character in the string. While JavaScript uses UCS-2 internally,
+	 * this function will convert a pair of surrogate halves (each of which
+	 * UCS-2 exposes as separate characters) into a single code point,
+	 * matching UTF-16.
+	 * @see `punycode.ucs2.encode`
+	 * @see <https://mathiasbynens.be/notes/javascript-encoding>
+	 * @memberOf punycode.ucs2
+	 * @name decode
+	 * @param {String} string The Unicode input string (UCS-2).
+	 * @returns {Array} The new array of code points.
+	 */
+	function ucs2decode(string) {
+		var output = [],
+		    counter = 0,
+		    length = string.length,
+		    value,
+		    extra;
+		while (counter < length) {
+			value = string.charCodeAt(counter++);
+			if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
+				// high surrogate, and there is a next character
+				extra = string.charCodeAt(counter++);
+				if ((extra & 0xFC00) == 0xDC00) { // low surrogate
+					output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
+				} else {
+					// unmatched surrogate; only append this code unit, in case the next
+					// code unit is the high surrogate of a surrogate pair
+					output.push(value);
+					counter--;
+				}
+			} else {
+				output.push(value);
+			}
+		}
+		return output;
+	}
+
+	/**
+	 * Creates a string based on an array of numeric code points.
+	 * @see `punycode.ucs2.decode`
+	 * @memberOf punycode.ucs2
+	 * @name encode
+	 * @param {Array} codePoints The array of numeric code points.
+	 * @returns {String} The new Unicode string (UCS-2).
+	 */
+	function ucs2encode(array) {
+		return map(array, function(value) {
+			var output = '';
+			if (value > 0xFFFF) {
+				value -= 0x10000;
+				output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);
+				value = 0xDC00 | value & 0x3FF;
+			}
+			output += stringFromCharCode(value);
+			return output;
+		}).join('');
+	}
+
+	/**
+	 * Converts a basic code point into a digit/integer.
+	 * @see `digitToBasic()`
+	 * @private
+	 * @param {Number} codePoint The basic numeric code point value.
+	 * @returns {Number} The numeric value of a basic code point (for use in
+	 * representing integers) in the range `0` to `base - 1`, or `base` if
+	 * the code point does not represent a value.
+	 */
+	function basicToDigit(codePoint) {
+		if (codePoint - 48 < 10) {
+			return codePoint - 22;
+		}
+		if (codePoint - 65 < 26) {
+			return codePoint - 65;
+		}
+		if (codePoint - 97 < 26) {
+			return codePoint - 97;
+		}
+		return base;
+	}
+
+	/**
+	 * Converts a digit/integer into a basic code point.
+	 * @see `basicToDigit()`
+	 * @private
+	 * @param {Number} digit The numeric value of a basic code point.
+	 * @returns {Number} The basic code point whose value (when used for
+	 * representing integers) is `digit`, which needs to be in the range
+	 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
+	 * used; else, the lowercase form is used. The behavior is undefined
+	 * if `flag` is non-zero and `digit` has no uppercase form.
+	 */
+	function digitToBasic(digit, flag) {
+		//  0..25 map to ASCII a..z or A..Z
+		// 26..35 map to ASCII 0..9
+		return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
+	}
+
+	/**
+	 * Bias adaptation function as per section 3.4 of RFC 3492.
+	 * https://tools.ietf.org/html/rfc3492#section-3.4
+	 * @private
+	 */
+	function adapt(delta, numPoints, firstTime) {
+		var k = 0;
+		delta = firstTime ? floor(delta / damp) : delta >> 1;
+		delta += floor(delta / numPoints);
+		for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
+			delta = floor(delta / baseMinusTMin);
+		}
+		return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
+	}
+
+	/**
+	 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
+	 * symbols.
+	 * @memberOf punycode
+	 * @param {String} input The Punycode string of ASCII-only symbols.
+	 * @returns {String} The resulting string of Unicode symbols.
+	 */
+	function decode(input) {
+		// Don't use UCS-2
+		var output = [],
+		    inputLength = input.length,
+		    out,
+		    i = 0,
+		    n = initialN,
+		    bias = initialBias,
+		    basic,
+		    j,
+		    index,
+		    oldi,
+		    w,
+		    k,
+		    digit,
+		    t,
+		    /** Cached calculation results */
+		    baseMinusT;
+
+		// Handle the basic code points: let `basic` be the number of input code
+		// points before the last delimiter, or `0` if there is none, then copy
+		// the first basic code points to the output.
+
+		basic = input.lastIndexOf(delimiter);
+		if (basic < 0) {
+			basic = 0;
+		}
+
+		for (j = 0; j < basic; ++j) {
+			// if it's not a basic code point
+			if (input.charCodeAt(j) >= 0x80) {
+				error('not-basic');
+			}
+			output.push(input.charCodeAt(j));
+		}
+
+		// Main decoding loop: start just after the last delimiter if any basic code
+		// points were copied; start at the beginning otherwise.
+
+		for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {
+
+			// `index` is the index of the next character to be consumed.
+			// Decode a generalized variable-length integer into `delta`,
+			// which gets added to `i`. The overflow checking is easier
+			// if we increase `i` as we go, then subtract off its starting
+			// value at the end to obtain `delta`.
+			for (oldi = i, w = 1, k = base; /* no condition */; k += base) {
+
+				if (index >= inputLength) {
+					error('invalid-input');
+				}
+
+				digit = basicToDigit(input.charCodeAt(index++));
+
+				if (digit >= base || digit > floor((maxInt - i) / w)) {
+					error('overflow');
+				}
+
+				i += digit * w;
+				t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
+
+				if (digit < t) {
+					break;
+				}
+
+				baseMinusT = base - t;
+				if (w > floor(maxInt / baseMinusT)) {
+					error('overflow');
+				}
+
+				w *= baseMinusT;
+
+			}
+
+			out = output.length + 1;
+			bias = adapt(i - oldi, out, oldi == 0);
+
+			// `i` was supposed to wrap around from `out` to `0`,
+			// incrementing `n` each time, so we'll fix that now:
+			if (floor(i / out) > maxInt - n) {
+				error('overflow');
+			}
+
+			n += floor(i / out);
+			i %= out;
+
+			// Insert `n` at position `i` of the output
+			output.splice(i++, 0, n);
+
+		}
+
+		return ucs2encode(output);
+	}
+
+	/**
+	 * Converts a string of Unicode symbols (e.g. a domain name label) to a
+	 * Punycode string of ASCII-only symbols.
+	 * @memberOf punycode
+	 * @param {String} input The string of Unicode symbols.
+	 * @returns {String} The resulting Punycode string of ASCII-only symbols.
+	 */
+	function encode(input) {
+		var n,
+		    delta,
+		    handledCPCount,
+		    basicLength,
+		    bias,
+		    j,
+		    m,
+		    q,
+		    k,
+		    t,
+		    currentValue,
+		    output = [],
+		    /** `inputLength` will hold the number of code points in `input`. */
+		    inputLength,
+		    /** Cached calculation results */
+		    handledCPCountPlusOne,
+		    baseMinusT,
+		    qMinusT;
+
+		// Convert the input in UCS-2 to Unicode
+		input = ucs2decode(input);
+
+		// Cache the length
+		inputLength = input.length;
+
+		// Initialize the state
+		n = initialN;
+		delta = 0;
+		bias = initialBias;
+
+		// Handle the basic code points
+		for (j = 0; j < inputLength; ++j) {
+			currentValue = input[j];
+			if (currentValue < 0x80) {
+				output.push(stringFromCharCode(currentValue));
+			}
+		}
+
+		handledCPCount = basicLength = output.length;
+
+		// `handledCPCount` is the number of code points that have been handled;
+		// `basicLength` is the number of basic code points.
+
+		// Finish the basic string - if it is not empty - with a delimiter
+		if (basicLength) {
+			output.push(delimiter);
+		}
+
+		// Main encoding loop:
+		while (handledCPCount < inputLength) {
+
+			// All non-basic code points < n have been handled already. Find the next
+			// larger one:
+			for (m = maxInt, j = 0; j < inputLength; ++j) {
+				currentValue = input[j];
+				if (currentValue >= n && currentValue < m) {
+					m = currentValue;
+				}
+			}
+
+			// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
+			// but guard against overflow
+			handledCPCountPlusOne = handledCPCount + 1;
+			if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
+				error('overflow');
+			}
+
+			delta += (m - n) * handledCPCountPlusOne;
+			n = m;
+
+			for (j = 0; j < inputLength; ++j) {
+				currentValue = input[j];
+
+				if (currentValue < n && ++delta > maxInt) {
+					error('overflow');
+				}
+
+				if (currentValue == n) {
+					// Represent delta as a generalized variable-length integer
+					for (q = delta, k = base; /* no condition */; k += base) {
+						t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
+						if (q < t) {
+							break;
+						}
+						qMinusT = q - t;
+						baseMinusT = base - t;
+						output.push(
+							stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
+						);
+						q = floor(qMinusT / baseMinusT);
+					}
+
+					output.push(stringFromCharCode(digitToBasic(q, 0)));
+					bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
+					delta = 0;
+					++handledCPCount;
+				}
+			}
+
+			++delta;
+			++n;
+
+		}
+		return output.join('');
+	}
+
+	/**
+	 * Converts a Punycode string representing a domain name or an email address
+	 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
+	 * it doesn't matter if you call it on a string that has already been
+	 * converted to Unicode.
+	 * @memberOf punycode
+	 * @param {String} input The Punycoded domain name or email address to
+	 * convert to Unicode.
+	 * @returns {String} The Unicode representation of the given Punycode
+	 * string.
+	 */
+	function toUnicode(input) {
+		return mapDomain(input, function(string) {
+			return regexPunycode.test(string)
+				? decode(string.slice(4).toLowerCase())
+				: string;
+		});
+	}
+
+	/**
+	 * Converts a Unicode string representing a domain name or an email address to
+	 * Punycode. Only the non-ASCII parts of the domain name will be converted,
+	 * i.e. it doesn't matter if you call it with a domain that's already in
+	 * ASCII.
+	 * @memberOf punycode
+	 * @param {String} input The domain name or email address to convert, as a
+	 * Unicode string.
+	 * @returns {String} The Punycode representation of the given domain name or
+	 * email address.
+	 */
+	function toASCII(input) {
+		return mapDomain(input, function(string) {
+			return regexNonASCII.test(string)
+				? 'xn--' + encode(string)
+				: string;
+		});
+	}
+
+	/*--------------------------------------------------------------------------*/
+
+	/** Define the public API */
+	punycode = {
+		/**
+		 * A string representing the current Punycode.js version number.
+		 * @memberOf punycode
+		 * @type String
+		 */
+		'version': '1.4.1',
+		/**
+		 * An object of methods to convert from JavaScript's internal character
+		 * representation (UCS-2) to Unicode code points, and back.
+		 * @see <https://mathiasbynens.be/notes/javascript-encoding>
+		 * @memberOf punycode
+		 * @type Object
+		 */
+		'ucs2': {
+			'decode': ucs2decode,
+			'encode': ucs2encode
+		},
+		'decode': decode,
+		'encode': encode,
+		'toASCII': toASCII,
+		'toUnicode': toUnicode
+	};
+
+	/** Expose `punycode` */
+	// Some AMD build optimizers, like r.js, check for specific condition patterns
+	// like the following:
+	if (
+		typeof define == 'function' &&
+		typeof define.amd == 'object' &&
+		define.amd
+	) {
+		define('punycode', function() {
+			return punycode;
+		});
+	} else if (freeExports && freeModule) {
+		if (module.exports == freeExports) {
+			// in Node.js, io.js, or RingoJS v0.8.0+
+			freeModule.exports = punycode;
+		} else {
+			// in Narwhal or RingoJS v0.7.0-
+			for (key in punycode) {
+				punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);
+			}
+		}
+	} else {
+		// in Rhino or a web browser
+		root.punycode = punycode;
+	}
+
+}(this));
diff --git a/debian/node-html2canvas.install b/debian/node-html2canvas.install
new file mode 100644
index 0000000..1ebd373
--- /dev/null
+++ b/debian/node-html2canvas.install
@@ -0,0 +1 @@
+package.json             usr/lib/nodejs/html2canvas/
diff --git a/debian/node-html2canvas.links b/debian/node-html2canvas.links
new file mode 100644
index 0000000..423b86a
--- /dev/null
+++ b/debian/node-html2canvas.links
@@ -0,0 +1,2 @@
+usr/share/javascript/html2canvas/html2canvas.js     usr/lib/nodejs/html2canvas/dist/html2canvas.js
+usr/share/javascript/html2canvas/html2canvas.min.js usr/lib/nodejs/html2canvas/dist/html2canvas.min.js
diff --git a/debian/patches/enable-package-test.patch b/debian/patches/enable-package-test.patch
new file mode 100644
index 0000000..b71cb74
--- /dev/null
+++ b/debian/patches/enable-package-test.patch
@@ -0,0 +1,19 @@
+Description: Run all tests in package.js and fix requirejs require
+ Former is probably an oversight by upstream, latter is Debian bug #845158
+Author: Ximin Luo <infinity0 at debian.org>
+Forwarded: not-needed
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tests/node/package.js
++++ b/tests/node/package.js
+@@ -8,8 +8,8 @@
+     });
+ });
+ 
+-describe.only("requirejs", function() {
+-    var requirejs = require('requirejs');
++describe("requirejs", function() {
++    var requirejs = require('r');
+ 
+     requirejs.config({
+         baseUrl: path.resolve(__dirname, '../../dist')
diff --git a/debian/patches/fix-failing-test.patch b/debian/patches/fix-failing-test.patch
new file mode 100644
index 0000000..73d523b
--- /dev/null
+++ b/debian/patches/fix-failing-test.patch
@@ -0,0 +1,18 @@
+Description: Fix failing tests
+ Loosen the test for "text-shadow: 1px 1px 1px"
+ phantomjs on Debian GNU/Linux gives a slightly different but equivalent result
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: https://github.com/niklasvh/html2canvas/pull/1002
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/tests/mocha/css.js
++++ b/tests/mocha/css.js
+@@ -75,7 +75,7 @@
+                 expect(shadows[0].offsetX).to.equal(i);
+                 expect(shadows[0].offsetY).to.equal(i);
+                 if (i < 2) {
+-                    expect(shadows[0].color.toString()).to.equal('rgba(0,0,0,0)');
++                    expect(['rgb(0,0,0)', 'rgba(0,0,0,0)']).to.contain(shadows[0].color.toString());
+                 } else if (i % 2 === 0) {
+                     expect(shadows[0].color.toString()).to.equal('rgb(2,2,2)');
+                 } else {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..905df7a
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,2 @@
+fix-failing-test.patch
+enable-package-test.patch
diff --git a/debian/rules b/debian/rules
new file mode 100755
index 0000000..4baf4ad
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,34 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+	dh $@
+
+override_dh_auto_build:
+	cp debian/missing-sources/punycode.js .
+	$(MAKE) -f debian/main.mk all
+
+override_dh_auto_test:
+ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
+# Create dependency symlinks to Debian system packages
+	cp -aL /usr/lib/nodejs/mocha tests/mocha/lib
+	ln -s /usr/lib/nodejs/expect.js/index.js tests/mocha/lib/expect.js
+	ln -s /usr/share/javascript/jquery/jquery.js tests/assets/jquery-1.6.2.js
+	cp debian/missing-sources/mocha-phantomjs-core.js .
+	cp debian/missing-sources/browser-shim.js .
+# The javascript ecosystem is *SO STUPID!*
+	mkdir -p node_modules/bluebird/js/browser/
+	ln -s /usr/share/javascript/es6-promise/es6-promise.js node_modules/bluebird/js/browser/bluebird.js
+# Debian phantomjs can't work headless, see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=817277
+# Furthermore the tests fail unless html2canvas has a big enough screen to draw on
+	xvfb-run --server-args="-screen 0 1280x800x24" \
+	  $(MAKE) -f debian/main.mk check
+endif
+
+override_dh_auto_clean:
+	$(MAKE) -f debian/main.mk clean
+	rm -rf punycode.js mocha-phantomjs-core.js browser-shim.js \
+	  node_modules tests/mocha/lib tests/assets/jquery-1.6.2.js
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..163aaf8
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (quilt)
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644
index 0000000..89056bc
--- /dev/null
+++ b/debian/tests/control
@@ -0,0 +1,2 @@
+Test-Command: nodejs -e "require('"'"'html2canvas'"'"');"
+Depends: @
diff --git a/debian/watch b/debian/watch
new file mode 100644
index 0000000..73ce9fe
--- /dev/null
+++ b/debian/watch
@@ -0,0 +1,5 @@
+version=4
+opts="filenamemangle=s%(?:.*?)?v?(\d[\w.-]*)\.tar\.gz%html2canvas-$1.tar.gz%,\
+dversionmangle=s/\+ds\d*$//,uversionmangle=s/-(\w+)$/~$1/,repacksuffix=+ds1" \
+ https://github.com/niklasvh/html2canvas/tags \
+ (?:.*?/)?v?(\d[\w.-]*)\.tar\.gz

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/html2canvas.git



More information about the Pkg-javascript-commits mailing list