From 6eb950c7036ccddea20c6986590b4e856cc121f8 Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Thu, 14 Sep 2017 16:15:05 +0300 Subject: [PATCH] nodejs-current: fix hardcoded paths --- packages/nodejs-current/build.sh | 1 + .../nodejs-current/fix-hardcoded-paths.patch | 38 +++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 packages/nodejs-current/fix-hardcoded-paths.patch diff --git a/packages/nodejs-current/build.sh b/packages/nodejs-current/build.sh index cd90e2b20..f580cfb43 100644 --- a/packages/nodejs-current/build.sh +++ b/packages/nodejs-current/build.sh @@ -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.4.0 +TERMUX_PKG_REVISION=1 TERMUX_PKG_SHA256=641a15fa822710ef2dc99793fec48d2a8ef75de0040b86568563d4ab296137ef TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz # Note that we do not use a shared libuv to avoid an issue with the Android diff --git a/packages/nodejs-current/fix-hardcoded-paths.patch b/packages/nodejs-current/fix-hardcoded-paths.patch new file mode 100644 index 000000000..9628692fe --- /dev/null +++ b/packages/nodejs-current/fix-hardcoded-paths.patch @@ -0,0 +1,38 @@ +diff -uNr node-v8.4.0/deps/uv/src/unix/core.c node-v8.4.0.mod/deps/uv/src/unix/core.c +--- node-v8.4.0/deps/uv/src/unix/core.c 2017-08-15 19:42:28.000000000 +0300 ++++ node-v8.4.0.mod/deps/uv/src/unix/core.c 2017-09-14 16:13:27.292856099 +0300 +@@ -1112,7 +1112,9 @@ + + /* No temp environment variables defined */ + #if defined(__ANDROID__) +- buf = "/data/local/tmp"; ++ // Don't use '/data/local/tmp' in Termux ++ //buf = "/data/local/tmp"; ++ buf = "@TERMUX_PREFIX@/tmp"; + #else + buf = "/tmp"; + #endif +diff -uNr node-v8.4.0/deps/v8/src/flag-definitions.h node-v8.4.0.mod/deps/v8/src/flag-definitions.h +--- node-v8.4.0/deps/v8/src/flag-definitions.h 2017-08-15 19:42:30.000000000 +0300 ++++ node-v8.4.0.mod/deps/v8/src/flag-definitions.h 2017-09-14 16:12:34.462856137 +0300 +@@ -1203,7 +1203,7 @@ + DEFINE_BOOL(perf_prof_unwinding_info, false, + "Enable unwinding info for perf linux profiler (experimental).") + DEFINE_IMPLICATION(perf_prof, perf_prof_unwinding_info) +-DEFINE_STRING(gc_fake_mmap, "/tmp/__v8_gc__", ++DEFINE_STRING(gc_fake_mmap, "@TERMUX_PREFIX@/tmp/__v8_gc__", + "Specify the name of the file for fake gc mmap used in ll_prof") + DEFINE_BOOL(log_internal_timer_events, false, "Time internal events.") + DEFINE_BOOL(log_timer_events, false, +diff -uNr node-v8.4.0/deps/v8/src/log.cc node-v8.4.0.mod/deps/v8/src/log.cc +--- node-v8.4.0/deps/v8/src/log.cc 2017-08-15 19:42:31.000000000 +0300 ++++ node-v8.4.0.mod/deps/v8/src/log.cc 2017-09-14 16:11:05.192856201 +0300 +@@ -233,7 +233,7 @@ + FILE* perf_output_handle_; + }; + +-const char PerfBasicLogger::kFilenameFormatString[] = "/tmp/perf-%d.map"; ++const char PerfBasicLogger::kFilenameFormatString[] = "@TERMUX_PREFIX@/tmp/perf-%d.map"; + // Extra space for the PID in the filename + const int PerfBasicLogger::kFilenameBufferPadding = 16; +