Fredrik Fornwall
9 years ago
7 changed files with 81 additions and 26760 deletions
@ -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} |
|
||||
} |
|
@ -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) |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -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); |
||||
|
|
Loading…
Reference in new issue