node: Update to 4.0

This commit is contained in:
Fredrik Fornwall 2015-09-08 19:18:52 -04:00
parent 2e89449878
commit 9ba78439c4
7 changed files with 81 additions and 26760 deletions

View File

@ -1,28 +0,0 @@
TERMUX_PKG_HOMEPAGE=https://iojs.org
TERMUX_PKG_DESCRIPTION="An npm compatibe platform base on node.js"
TERMUX_PKG_VERSION=2.5.0
TERMUX_PKG_SRCURL=https://iojs.org/dist/v${TERMUX_PKG_VERSION}/iojs-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--dest-os=android --shared-openssl --shared-zlib --shared-libuv --without-snapshot"
TERMUX_PKG_DEPENDS="c-ares, openssl, libuv"
TERMUX_PKG_BUILD_IN_SRC=yes
termux_step_configure () {
if [ $TERMUX_ARCH = "arm" ]; then
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=arm"
elif [ $TERMUX_ARCH = "i686" ]; then
TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=ia32"
else
echo "Unsupported arch: $TERMUX_ARCH"
exit 1
fi
# Some v8 code checks for ANDROID instead of __ANDROID__:
export CFLAGS="$CFLAGS -DANDROID=1"
export CXXFLAGS="$CXXFLAGS -DANDROID=1"
# The cc_macros() function in configure executes $CC to look at features such as armv7 and neon:
export CC="$CC $CFLAGS"
# To avoid build process trying to use linux-specific flock which breaks build on mac:
export LINK=$CXX
env $TERMUX_PKG_SRCDIR/configure \
--prefix=$TERMUX_PREFIX \
${TERMUX_PKG_EXTRA_CONFIGURE_ARGS}
}

View File

@ -1,9 +1,8 @@
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_VERSION=4.0.0
TERMUX_PKG_SRCURL=https://nodejs.org/dist/latest/node-v${TERMUX_PKG_VERSION}.tar.xz
TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--dest-os=android --shared-openssl --shared-zlib --shared-libuv"
TERMUX_PKG_DEPENDS="c-ares, openssl, libuv"
TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace"
TERMUX_PKG_BUILD_IN_SRC=yes
@ -17,14 +16,6 @@ termux_step_configure () {
echo "Unsupported arch: $TERMUX_ARCH"
exit 1
fi
# Some v8 code checks for ANDROID instead of __ANDROID__:
export CFLAGS="$CFLAGS -DANDROID=1"
export CXXFLAGS="$CXXFLAGS -DANDROID=1"
# The cc_macros() function in configure executes $CC to look at features such as armv7 and neon:
export CC="$CC $CFLAGS"
# To avoid build process trying to use linux-specific flock which breaks build on mac:
export LINK=$CXX
env $TERMUX_PKG_SRCDIR/configure \
--prefix=$TERMUX_PREFIX \
${TERMUX_PKG_EXTRA_CONFIGURE_ARGS}
./configure --prefix=$TERMUX_PREFIX ${TERMUX_PKG_EXTRA_CONFIGURE_ARGS}
}

View File

@ -0,0 +1,12 @@
diff -u -r ../node-v4.0.0/deps/npm/lib/build.js ./deps/npm/lib/build.js
--- ../node-v4.0.0/deps/npm/lib/build.js 2015-09-08 11:30:35.000000000 -0400
+++ ./deps/npm/lib/build.js 2015-09-08 18:44:34.301980390 -0400
@@ -210,6 +210,8 @@
if (process.platform !== "win32") {
+ // Fix shebang paths in binary scripts:
+ require('child_process').spawn('termux-fix-shebang', [from])
return linkIfExists(from, to, gently, cb)
} else {
return cmdShimIfExists(from, to, cb)
}
}

View File

@ -1,14 +1,14 @@
See https://github.com/joyent/node/issues/8540
See https://github.com/nodejs/node-v0.x-archive/issues/8540
diff -u -r ../node-v0.12.3/lib/net.js ./lib/net.js
--- ../node-v0.12.3/lib/net.js 2015-05-13 20:30:45.000000000 -0400
+++ ./lib/net.js 2015-05-22 13:09:34.630948530 -0400
@@ -926,7 +926,7 @@
// and
// https://svnweb.freebsd.org/base/head/lib/libc/net/getaddrinfo.c?r1=172052&r2=175955
// for more information on the lack of support for FreeBSD.
- if (process.platform !== 'freebsd')
+ if (process.platform !== 'freebsd' && process.platform !== 'android')
dnsopts.hints |= dns.V4MAPPED;
}
diff -u -r ../node-v4.0.0/lib/net.js ./lib/net.js
--- ../node-v4.0.0/lib/net.js 2015-09-08 11:30:45.000000000 -0400
+++ ./lib/net.js 2015-09-08 17:37:04.293684663 -0400
@@ -951,7 +951,7 @@
// systems. See
// http://lists.freebsd.org/pipermail/freebsd-bugs/2008-February/028260.html
// for more information on the lack of support for FreeBSD.
- if (process.platform !== 'freebsd')
+ if (process.platform !== 'freebsd' && process.platform !== 'android')
dnsopts.hints |= dns.V4MAPPED;
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,52 @@
Without this patch functions such as process.getgroups
are not built on Android, which breaks things such as
npm/node_modules/which/which.js.
diff -u -r ../node-v4.0.0/src/node.cc ./src/node.cc
--- ../node-v4.0.0/src/node.cc 2015-09-08 11:30:45.000000000 -0400
+++ ./src/node.cc 2015-09-08 19:06:39.415724588 -0400
@@ -69,7 +69,7 @@
#include <unistd.h> // setuid, getuid
#endif
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__)
#include <pwd.h> // getpwnam()
#include <grp.h> // getgrnam()
#endif
@@ -1590,7 +1590,7 @@
}
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__)
static const uid_t uid_not_found = static_cast<uid_t>(-1);
static const gid_t gid_not_found = static_cast<gid_t>(-1);
@@ -1910,7 +1910,7 @@
}
}
-#endif // __POSIX__ && !defined(__ANDROID__)
+#endif // __POSIX__
void Exit(const FunctionCallbackInfo<Value>& args) {
@@ -2866,7 +2866,7 @@
env->SetMethod(process, "umask", Umask);
-#if defined(__POSIX__) && !defined(__ANDROID__)
+#if defined(__POSIX__)
env->SetMethod(process, "getuid", GetUid);
env->SetMethod(process, "geteuid", GetEUid);
env->SetMethod(process, "setuid", SetUid);
@@ -2880,7 +2880,7 @@
env->SetMethod(process, "getgroups", GetGroups);
env->SetMethod(process, "setgroups", SetGroups);
env->SetMethod(process, "initgroups", InitGroups);
-#endif // __POSIX__ && !defined(__ANDROID__)
+#endif // __POSIX__
env->SetMethod(process, "_kill", Kill);