From 49f47ae04cfc5d7d724083184132dbba227dcf79 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 2 May 2016 17:14:47 -0400 Subject: [PATCH] nodejs: Disable v8 warning and set TMPDIR --- packages/nodejs/build.sh | 2 +- .../deps-v8-src-flag-definitions.h.patch | 14 +++++++++++++ packages/nodejs/src-node_main.cc.patch | 21 +++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 packages/nodejs/deps-v8-src-flag-definitions.h.patch create mode 100644 packages/nodejs/src-node_main.cc.patch diff --git a/packages/nodejs/build.sh b/packages/nodejs/build.sh index c68245d4d..d646dbf75 100644 --- a/packages/nodejs/build.sh +++ b/packages/nodejs/build.sh @@ -1,7 +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=6.0.0 -TERMUX_PKG_BUILD_REVISION=2 +TERMUX_PKG_BUILD_REVISION=3 TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_DEPENDS="openssl, libuv, libgnustl, c-ares" TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace" diff --git a/packages/nodejs/deps-v8-src-flag-definitions.h.patch b/packages/nodejs/deps-v8-src-flag-definitions.h.patch new file mode 100644 index 000000000..4623e405f --- /dev/null +++ b/packages/nodejs/deps-v8-src-flag-definitions.h.patch @@ -0,0 +1,14 @@ +--- ../node-v6.0.0/deps/v8/src/flag-definitions.h 2016-04-26 15:50:11.000000000 -0400 ++++ ./deps/v8/src/flag-definitions.h 2016-05-02 16:46:31.289030161 -0400 +@@ -172,7 +172,10 @@ + // + #define FLAG FLAG_FULL + +-DEFINE_BOOL(warn_template_set, true, ++/* Termux modification: Do not enable this warning per default ++ as it will only confuse users needlessly. The root causes ++ of this warning will get fixed anyway soon in npm packages. */ ++DEFINE_BOOL(warn_template_set, false, + "warn on deprecated v8::Template::Set() use") + + DEFINE_BOOL(experimental_extras, false, diff --git a/packages/nodejs/src-node_main.cc.patch b/packages/nodejs/src-node_main.cc.patch new file mode 100644 index 000000000..6c43c5224 --- /dev/null +++ b/packages/nodejs/src-node_main.cc.patch @@ -0,0 +1,21 @@ +diff -u -r ../node-v6.0.0/src/node_main.cc ./src/node_main.cc +--- ../node-v6.0.0/src/node_main.cc 2016-04-26 15:50:22.000000000 -0400 ++++ ./src/node_main.cc 2016-05-02 16:29:08.313594254 -0400 +@@ -1,4 +1,5 @@ + #include "node.h" ++#include + + #ifdef _WIN32 + #include +@@ -50,6 +51,11 @@ + // UNIX + int main(int argc, char *argv[]) { + setvbuf(stderr, NULL, _IOLBF, 1024); ++ if (getenv("TMPDIR") == NULL) { ++ /* Give javascript programs (such as updated versions of npm) a working tmpdir. */ ++ putenv("TMPDIR=@TERMUX_PREFIX@/tmp"); ++ } ++ + return node::Start(argc, argv); + } + #endif