nodejs: Patches for getting npm to work
authorFredrik Fornwall <fredrik@fornwall.net>
Sat, 25 Jul 2015 22:03:43 +0000 (18:03 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Sat, 25 Jul 2015 22:03:43 +0000 (18:03 -0400)
packages/nodejs/build.sh
packages/nodejs/npm-avoid-chown.patch [new file with mode: 0644]
packages/nodejs/npm-tmp-patch.patch [new file with mode: 0644]

index 901600e..66da1cc 100644 (file)
@@ -1,6 +1,7 @@
 TERMUX_PKG_HOMEPAGE=http://nodejs.org/
 TERMUX_PKG_DESCRIPTION="Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications"
 TERMUX_PKG_VERSION=0.12.7
+TERMUX_PKG_BUILD_REVISION=1
 TERMUX_PKG_SRCURL=http://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz
 TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--dest-os=android --shared-openssl --shared-zlib --shared-cares --shared-libuv --without-snapshot"
 TERMUX_PKG_DEPENDS="c-ares, openssl, libuv"
diff --git a/packages/nodejs/npm-avoid-chown.patch b/packages/nodejs/npm-avoid-chown.patch
new file mode 100644 (file)
index 0000000..6c452ee
--- /dev/null
@@ -0,0 +1,17 @@
+Termux is effectively a single-user system so chown:ing
+does not make much sense.
+
+Without this patch npm fails with EPERM on chown
+for cache.json when first building the local index.
+diff -u -r ../node-v0.12.7/deps/npm/lib/cache/update-index.js ./deps/npm/lib/cache/update-index.js
+--- ../node-v0.12.7/deps/npm/lib/cache/update-index.js 2015-07-09 18:41:19.000000000 -0400
++++ ./deps/npm/lib/cache/update-index.js       2015-07-24 20:45:21.078116384 -0400
+@@ -4,7 +4,7 @@
+ var assert = require('assert')
+ var path = require('path')
+ var mkdir = require('mkdirp')
+-var chownr = require('chownr')
++var chownr = function(path, uid, gid, cb) { cb(null); }
+ var npm = require('../npm.js')
+ var log = require('npmlog')
+ var cacheFile = require('npm-cache-filename')
diff --git a/packages/nodejs/npm-tmp-patch.patch b/packages/nodejs/npm-tmp-patch.patch
new file mode 100644 (file)
index 0000000..ac8a760
--- /dev/null
@@ -0,0 +1,12 @@
+diff -u -r ../node-v0.12.7/deps/npm/node_modules/osenv/node_modules/os-tmpdir/index.js ./deps/npm/node_modules/osenv/node_modules/os-tmpdir/index.js
+--- ../node-v0.12.7/deps/npm/node_modules/osenv/node_modules/os-tmpdir/index.js        2015-07-09 18:41:19.000000000 -0400
++++ ./deps/npm/node_modules/osenv/node_modules/os-tmpdir/index.js      2015-07-24 20:56:42.278310940 -0400
+@@ -14,7 +14,7 @@
+               path = process.env.TMPDIR ||
+                       process.env.TMP ||
+                       process.env.TEMP ||
+-                      '/tmp';
++                      '@TERMUX_PREFIX@/tmp';
+       }
+       if (trailingSlashRe.test(path)) {