Commit | Line | Data |
---|---|---|
59f0d218 FF |
1 | TERMUX_PKG_HOMEPAGE=http://nodejs.org/ |
2 | TERMUX_PKG_DESCRIPTION="Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications" | |
dc68cb1e | 3 | TERMUX_PKG_VERSION=5.5.0 |
1189304e | 4 | TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz |
93982adb | 5 | TERMUX_PKG_DEPENDS="openssl, libuv" |
59f0d218 FF |
6 | TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace" |
7 | TERMUX_PKG_BUILD_IN_SRC=yes | |
8 | ||
9 | termux_step_configure () { | |
d53dc644 FF |
10 | #XXX: node.js build does not handle already installed headers |
11 | # https://github.com/nodejs/node/issues/2637 | |
12 | # So we remove them here and restore afterwards. | |
13 | rm -Rf $TERMUX_PKG_CACHEDIR/gtest-include-dir $TERMUX_PKG_CACHEDIR/ares-includes | |
14 | test -d $TERMUX_PREFIX/include/gtest && | |
15 | mv $TERMUX_PREFIX/include/gtest $TERMUX_PKG_CACHEDIR/gtest-include-dir | |
16 | test -f $TERMUX_PREFIX/include/ares.h && | |
17 | mkdir $TERMUX_PKG_CACHEDIR/ares-includes/ && | |
18 | mv $TERMUX_PREFIX/include/ares* $TERMUX_PKG_CACHEDIR/ares-includes/ | |
a3ef97c0 | 19 | |
1224589f FF |
20 | # https://github.com/nodejs/build/issues/266: "V8 can handle cross compiling of |
21 | # snapshots if the {CC,CXX}_host variables are defined, by compiling the | |
22 | # mksnapshot executable with the host compiler". But this currently fails | |
23 | # due to the host build picking up targets flags. | |
24 | export CC_host=gcc | |
25 | export CXX_host=g++ | |
26 | ||
59f0d218 | 27 | if [ $TERMUX_ARCH = "arm" ]; then |
1224589f | 28 | DEST_CPU="arm" |
59f0d218 | 29 | elif [ $TERMUX_ARCH = "i686" ]; then |
1224589f | 30 | DEST_CPU="ia32" |
d59a97b3 | 31 | elif [ $TERMUX_ARCH = "aarch64" ]; then |
1224589f | 32 | DEST_CPU="arm64" |
d59a97b3 | 33 | elif [ $TERMUX_ARCH = "x86_64" ]; then |
1224589f | 34 | DEST_CPU="x64" |
59f0d218 FF |
35 | else |
36 | echo "Unsupported arch: $TERMUX_ARCH" | |
37 | exit 1 | |
38 | fi | |
9ba78439 | 39 | |
1224589f FF |
40 | #LDFLAGS+=" -lstlport_static" |
41 | ||
42 | ./configure \ | |
43 | --prefix=$TERMUX_PREFIX \ | |
44 | --dest-cpu=$DEST_CPU \ | |
45 | --dest-os=android \ | |
46 | --shared-openssl --shared-zlib --shared-libuv \ | |
47 | --without-snapshot | |
59f0d218 | 48 | } |
d53dc644 FF |
49 | |
50 | termux_step_post_massage () { | |
51 | test -d $TERMUX_PKG_CACHEDIR/gtest-include-dir && | |
52 | mv $TERMUX_PKG_CACHEDIR/gtest-include-dir $TERMUX_PREFIX/include/gtest | |
53 | test -d $TERMUX_PKG_CACHEDIR/ares-includes && | |
54 | mv $TERMUX_PKG_CACHEDIR/ares-includes/* $TERMUX_PREFIX/include/ | |
1224589f FF |
55 | # Exit with success to avoid aborting script due to set -e: |
56 | true | |
d53dc644 | 57 | } |