chiark / gitweb /
97f1137d1e36338cd770f2900d81aa8e6e916ef6
[termux-packages] / packages / nodejs / build.sh
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"
3 TERMUX_PKG_VERSION=6.6.0
4 TERMUX_PKG_BUILD_REVISION=1
5 TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz
6 # Note that we do not use a shared libuv to avoid an issue with the Android
7 # linker, which does not use symbols of linked shared libraries when resolving
8 # symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462.
9 TERMUX_PKG_DEPENDS="openssl, c-ares"
10 TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace"
11 TERMUX_PKG_BUILD_IN_SRC=yes
12
13 termux_step_configure () {
14         # https://github.com/nodejs/build/issues/266: "V8 can handle cross compiling of
15         # snapshots if the {CC,CXX}_host variables are defined, by compiling the
16         # mksnapshot executable with the host compiler". But this currently fails
17         # due to the host build picking up targets flags.
18         export CC_host=gcc
19         export CXX_host=g++
20
21         local _EXTRA_CONFIGURE_ARGS=""
22         if [ $TERMUX_ARCH = "arm" ]; then
23                 DEST_CPU="arm"
24                 _EXTRA_CONFIGURE_ARGS=" --with-arm-float-abi=hard --with-arm-fpu=neon"
25         elif [ $TERMUX_ARCH = "i686" ]; then
26                 DEST_CPU="ia32"
27         elif [ $TERMUX_ARCH = "aarch64" ]; then
28                 DEST_CPU="arm64"
29         elif [ $TERMUX_ARCH = "x86_64" ]; then
30                 DEST_CPU="x64"
31         else
32                 echo "Unsupported arch: $TERMUX_ARCH"
33                 exit 1
34         fi
35
36         ./configure \
37                 --prefix=$TERMUX_PREFIX \
38                 --dest-cpu=$DEST_CPU \
39                 --dest-os=android \
40                 --shared-openssl --shared-zlib --shared-cares \
41                 --without-snapshot \
42                 --without-intl \
43                 --without-inspector \
44                 $_EXTRA_CONFIGURE_ARGS
45 }