nodejs: Update from 12.4.0 to 12.9.0

This commit is contained in:
Fredrik Fornwall 2019-08-25 18:22:08 +02:00
parent 3c37441fa8
commit ad1a6b0f44
7 changed files with 101 additions and 49 deletions

View File

@ -1,10 +1,9 @@
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_LICENSE="MIT"
TERMUX_PKG_VERSION=12.4.0
TERMUX_PKG_REVISION=2
TERMUX_PKG_VERSION=12.9.0
TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_SHA256=20b52366d3502c60d4aec0bd5052c841a94bf1cd5d74b2ea1e498c1a2ada8ce3
TERMUX_PKG_SHA256=e05fe8ba1bdf58e51cdb5d946ebb7a2dec567b3680da2752e120a763293a41c5
# Note that we do not use a shared libuv to avoid an issue with the Android
# linker, which does not use symbols of linked shared libraries when resolving
# symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.
@ -14,6 +13,35 @@ TERMUX_PKG_BUILD_IN_SRC=true
TERMUX_PKG_CONFLICTS="nodejs-lts, nodejs-current"
TERMUX_PKG_BREAKS="nodejs-dev"
TERMUX_PKG_REPLACES="nodejs-current, nodejs-dev"
TERMUX_PKG_HOSTBUILD=true
termux_step_post_extract_package() {
# Prevent caching of host build:
rm -Rf $TERMUX_PKG_HOSTBUILD_DIR
}
termux_step_host_build() {
local ICU_VERSION=64.2
local ICU_TAR=icu4c-${ICU_VERSION//./_}-src.tar.xz
local ICU_DOWNLOAD=https://fossies.org/linux/misc/$ICU_TAR
termux_download \
$ICU_DOWNLOAD\
$TERMUX_PKG_CACHEDIR/$ICU_TAR \
09762184afa33c3b1042715192da1777f9fda31688cab5b03b8b71fad1dcd0c7
tar xf $TERMUX_PKG_CACHEDIR/$ICU_TAR
cd icu/source
if [ "$TERMUX_ARCH_BITS" = 32 ]; then
./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \
--disable-samples \
--disable-tests \
--build=i686-pc-linux-gnu "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"
else
./configure --prefix $TERMUX_PKG_HOSTBUILD_DIR/icu-installed \
--disable-samples \
--disable-tests
fi
make -j $TERMUX_MAKE_PROCESSES install
}
termux_step_configure() {
local DEST_CPU
@ -44,9 +72,13 @@ termux_step_configure() {
--shared-zlib \
--with-intl=system-icu \
--without-snapshot \
--without-node-snapshot \
--cross-compiling
perl -p -i -e 's/LIBS := \$\(LIBS\)/LIBS := -lpthread/' \
export LD_LIBRARY_PATH=$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib
perl -p -i -e "s@LIBS := \\$\\(LIBS\\)@LIBS := -L$TERMUX_PKG_HOSTBUILD_DIR/icu-installed/lib -lpthread -licui18n -licuuc -licudata@" \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/torque.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/bytecode_builtins_list_generator.host.mk
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/bytecode_builtins_list_generator.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/v8_libbase.host.mk \
$TERMUX_PKG_SRCDIR/out/tools/v8_gypfiles/gen-regexp-special-case.host.mk
}

View File

@ -0,0 +1,14 @@
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

View File

@ -0,0 +1,12 @@
diff -u -r ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h ./deps/v8/src/flags/flag-definitions.h
--- ../node-v12.9.0/deps/v8/src/flags/flag-definitions.h 2019-08-20 17:14:50.000000000 +0000
+++ ./deps/v8/src/flags/flag-definitions.h 2019-08-24 22:38:43.754905700 +0000
@@ -1373,7 +1373,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_IMPLICATION(log_internal_timer_events, prof)

View File

@ -0,0 +1,12 @@
diff -u -r ../node-v12.9.0/deps/v8/src/logging/log.cc ./deps/v8/src/logging/log.cc
--- ../node-v12.9.0/deps/v8/src/logging/log.cc 2019-08-20 17:14:50.000000000 +0000
+++ ./deps/v8/src/logging/log.cc 2019-08-24 22:39:52.426124955 +0000
@@ -280,7 +280,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;

View File

@ -1,38 +0,0 @@
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;

View File

@ -1,7 +1,7 @@
diff -uNr node-v12.4.0/node.gyp node-v12.4.0.mod/node.gyp
--- node-v12.4.0/node.gyp 2019-06-04 14:57:31.000000000 +0300
+++ node-v12.4.0.mod/node.gyp 2019-06-08 01:35:11.310854320 +0300
@@ -1051,98 +1051,6 @@
diff -u -r ../node-v12.9.0/node.gyp ./node.gyp
--- ../node-v12.9.0/node.gyp 2019-08-20 17:14:52.000000000 +0000
+++ ./node.gyp 2019-08-24 20:21:21.471982543 +0000
@@ -1062,107 +1062,6 @@
} ],
]
}, # specialize_node_d
@ -46,7 +46,6 @@ diff -uNr node-v12.4.0/node.gyp node-v12.4.0.mod/node.gyp
- 'test/cctest/test_linked_binding.cc',
- 'test/cctest/test_per_process.cc',
- 'test/cctest/test_platform.cc',
- 'test/cctest/test_report_util.cc',
- 'test/cctest/test_traced_value.cc',
- 'test/cctest/test_util.cc',
- 'test/cctest/test_url.cc',
@ -84,6 +83,9 @@ diff -uNr node-v12.4.0/node.gyp node-v12.4.0.mod/node.gyp
- },
- }],
- [ 'node_report=="true"', {
- 'sources': [
- 'test/cctest/test_report_util.cc',
- ],
- 'defines': [
- 'NODE_REPORT',
- 'NODE_ARCH="<(target_arch)"',
@ -95,8 +97,15 @@ diff -uNr node-v12.4.0/node.gyp node-v12.4.0.mod/node.gyp
- }],
- ],
- }],
- ['OS=="win"', {
- 'libraries': [
- 'Dbghelp.lib',
- 'winmm.lib',
- 'Ws2_32.lib',
- ],
- }],
- ],
- }, # cctest
# TODO(joyeecheung): do not depend on node_lib,
# instead create a smaller static library node_lib_base that does
# just enough for node_native_module.cc and the cache builder to

View File

@ -0,0 +1,11 @@
diff -u -r ../node-v12.9.0/tools/v8_gypfiles/v8.gyp ./tools/v8_gypfiles/v8.gyp
--- ../node-v12.9.0/tools/v8_gypfiles/v8.gyp 2019-08-20 17:14:53.000000000 +0000
+++ ./tools/v8_gypfiles/v8.gyp 2019-08-24 22:02:57.943558855 +0000
@@ -1010,6 +1010,7 @@
'<(V8_ROOT)/src/base/platform/platform-posix.h',
'<(V8_ROOT)/src/base/platform/platform-posix-time.cc',
'<(V8_ROOT)/src/base/platform/platform-posix-time.h',
+ '<(V8_ROOT)/src/base/platform/platform-linux.cc',
],
'conditions': [
['_toolset=="host"', {