nodejs: Update from 4.2.3 to 5.4.1
authorFredrik Fornwall <fredrik@fornwall.net>
Fri, 15 Jan 2016 03:41:39 +0000 (22:41 -0500)
committerFredrik Fornwall <fredrik@fornwall.net>
Fri, 15 Jan 2016 03:41:39 +0000 (22:41 -0500)
packages/nodejs/build.sh
packages/nodejs/configure.patch [new file with mode: 0644]
packages/nodejs/deps-npm-lib-build.js.patch
packages/nodejs/lib-net.js.patch [deleted file]

index dd2f7c1..e30adc1 100644 (file)
@@ -1,8 +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=4.2.3
+TERMUX_PKG_VERSION=5.4.1
 TERMUX_PKG_SRCURL=https://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-libuv"
 TERMUX_PKG_DEPENDS="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
@@ -18,20 +17,34 @@ termux_step_configure () {
                mkdir $TERMUX_PKG_CACHEDIR/ares-includes/ &&
                mv $TERMUX_PREFIX/include/ares* $TERMUX_PKG_CACHEDIR/ares-includes/
 
+       # https://github.com/nodejs/build/issues/266: "V8 can handle cross compiling of
+       # snapshots if the {CC,CXX}_host variables are defined, by compiling the
+       # mksnapshot executable with the host compiler". But this currently fails
+       # due to the host build picking up targets flags.
+       export CC_host=gcc
+       export CXX_host=g++
+
        if [ $TERMUX_ARCH = "arm" ]; then
-               TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=arm"
+               DEST_CPU="arm"
        elif [ $TERMUX_ARCH = "i686" ]; then
-               TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=ia32"
+               DEST_CPU="ia32"
        elif [ $TERMUX_ARCH = "aarch64" ]; then
-               TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=arm64"
+               DEST_CPU="arm64"
        elif [ $TERMUX_ARCH = "x86_64" ]; then
-               TERMUX_PKG_EXTRA_CONFIGURE_ARGS+=" --dest-cpu=x64"
+               DEST_CPU="x64"
        else
                echo "Unsupported arch: $TERMUX_ARCH"
                exit 1
        fi
 
-       ./configure --prefix=$TERMUX_PREFIX ${TERMUX_PKG_EXTRA_CONFIGURE_ARGS}
+       #LDFLAGS+=" -lstlport_static"
+
+       ./configure \
+               --prefix=$TERMUX_PREFIX \
+               --dest-cpu=$DEST_CPU \
+               --dest-os=android \
+               --shared-openssl --shared-zlib --shared-libuv \
+               --without-snapshot
 }
 
 termux_step_post_massage () {
@@ -39,4 +52,6 @@ termux_step_post_massage () {
                mv $TERMUX_PKG_CACHEDIR/gtest-include-dir $TERMUX_PREFIX/include/gtest
        test -d $TERMUX_PKG_CACHEDIR/ares-includes &&
                mv $TERMUX_PKG_CACHEDIR/ares-includes/* $TERMUX_PREFIX/include/
+       # Exit with success to avoid aborting script due to set -e:
+       true
 }
diff --git a/packages/nodejs/configure.patch b/packages/nodejs/configure.patch
new file mode 100644 (file)
index 0000000..9fef4a5
--- /dev/null
@@ -0,0 +1,29 @@
+XXX: Revert https://github.com/nodejs/node/pull/3135 since it causes
+problems when trying to compile on Android with shared libuv, zlib
+and openssl due to v8 not using stlport correctly.
+
+diff -u -r ../node-v5.4.1/configure ./configure
+--- ../node-v5.4.1/configure   2016-01-12 16:21:55.000000000 -0500
++++ ./configure        2016-01-14 21:32:40.404401232 -0500
+@@ -771,15 +771,15 @@
+     if pkg_cflags:
+       output['include_dirs'] += (
+           filter(None, map(str.strip, pkg_cflags.split('-I'))))
+-    elif options.__dict__[shared_lib + '_includes']:
+-      output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
++    #elif options.__dict__[shared_lib + '_includes']:
++    #  output['include_dirs'] += [options.__dict__[shared_lib + '_includes']]
+     # libpath needs to be provided ahead libraries
+     if pkg_libpath:
+-      output['libraries'] += [pkg_libpath]
+-    elif options.__dict__[shared_lib + '_libpath']:
+-      output['libraries'] += [
+-          '-L%s' % options.__dict__[shared_lib + '_libpath']]
++      output['libraries'] += filter(None, map(str.strip, pkg_cflags.split('-L')))
++    #elif options.__dict__[shared_lib + '_libpath']:
++    #  output['libraries'] += [
++    #      '-L%s' % options.__dict__[shared_lib + '_libpath']]
+     default_libs = getattr(options, shared_lib + '_libname')
+     default_libs = map('-l{0}'.format, default_libs.split(','))
index 8fe2cd7..d41ee2d 100644 (file)
@@ -1,12 +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") {
+diff -u -r ../node-v5.1.0/deps/npm/lib/build.js ./deps/npm/lib/build.js
+--- ../node-v5.1.0/deps/npm/lib/build.js       2015-11-17 15:55:27.000000000 -0500
++++ ./deps/npm/lib/build.js    2015-11-17 19:01:33.061204729 -0500
+@@ -223,6 +223,8 @@
+ function linkBin (from, to, gently, cb) {
+   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)
-   }
- }
diff --git a/packages/nodejs/lib-net.js.patch b/packages/nodejs/lib-net.js.patch
deleted file mode 100644 (file)
index bf5864d..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-See https://github.com/nodejs/node-v0.x-archive/issues/8540
-
-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;
-   }