chiark / gitweb /
nodejs: Add npm link patch and bump version
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 3 Nov 2017 12:12:57 +0000 (13:12 +0100)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 3 Nov 2017 12:12:57 +0000 (13:12 +0100)
packages/nodejs/build.sh
packages/nodejs/npm-link-patch.patch [new file with mode: 0644]

index 373ce5d86a49176b05c94ec8688b263bd62ee8f7..070c7d37199e072a0a2bf694d7bcc2fdb65a9ecd 100644 (file)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=https://nodejs.org/
 TERMUX_PKG_DESCRIPTION="Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications"
 TERMUX_PKG_VERSION=8.9.0
+TERMUX_PKG_REVISION=1
 TERMUX_PKG_SHA256=ae8258f89e127a76d4b4aff6fdb8dc395b7da0069cba054b913dfc36b3c91189
 TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
 # Note that we do not use a shared libuv to avoid an issue with the Android
diff --git a/packages/nodejs/npm-link-patch.patch b/packages/nodejs/npm-link-patch.patch
new file mode 100644 (file)
index 0000000..36cdf23
--- /dev/null
@@ -0,0 +1,29 @@
+--- ../node/deps/npm/node_modules/cacache/lib/util/move-file.js        2017-10-22 19:30:25.778456404 +0200
++++ ./deps/npm/node_modules/cacache/lib/util/move-file.js      2017-10-22 20:41:18.021337095 +0200
+@@ -4,6 +4,7 @@
+ const BB = require('bluebird')
+ const chmod = BB.promisify(fs.chmod)
+ const unlink = BB.promisify(fs.unlink)
++const access = BB.promisify(fs.access)
+ let move
+ let pinflight
+@@ -18,6 +19,18 @@
+   // content their own way.
+   //
+   // Note that, as the name suggests, this strictly only supports file moves.
++
++
++  // Calling link() on android is not allowed, we get a SELinux security exception
++  if(process.platform === 'android') {
++    return access(dest, fs.constants.F_OK)
++      .catch(err => {
++        if (!move) { move = require('move-concurrently') }
++        return move(src, dest, { BB, fs })
++          .then(() => chmod(dest, '0444'))
++      })
++  }
++
+   return BB.fromNode(cb => {
+     fs.link(src, dest, err => {
+       if (err) {