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