Commit | Line | Data |
---|---|---|
2e97faec | 1 | # status: Does not build |
a61e7e45 FF |
2 | TERMUX_PKG_HOMEPAGE=https://nodejs.org/ |
3 | TERMUX_PKG_DESCRIPTION="Platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications" | |
47478ddf FF |
4 | TERMUX_PKG_VERSION=8.2.1 |
5 | TERMUX_PKG_SHA256=66fe1379bc7daf9a16c6b5c45ab695bf1cdcfae9738d2989e940104d6b31973f | |
a61e7e45 | 6 | TERMUX_PKG_SRCURL=https://nodejs.org/dist/v${TERMUX_PKG_VERSION}/node-v${TERMUX_PKG_VERSION}.tar.gz |
a61e7e45 FF |
7 | # Note that we do not use a shared libuv to avoid an issue with the Android |
8 | # linker, which does not use symbols of linked shared libraries when resolving | |
9 | # symbols on dlopen(). See https://github.com/termux/termux-packages/issues/462. | |
10 | TERMUX_PKG_DEPENDS="openssl, c-ares" | |
11 | TERMUX_PKG_RM_AFTER_INSTALL="lib/node_modules/npm/html lib/node_modules/npm/make.bat share/systemtap lib/dtrace" | |
12 | TERMUX_PKG_BUILD_IN_SRC=yes | |
53a2231f | 13 | TERMUX_PKG_CONFLICTS="nodejs" |
a61e7e45 FF |
14 | |
15 | termux_step_configure () { | |
16 | # See https://github.com/nodejs/build/issues/266 about enabling snapshots | |
17 | # when cross compiling. We use {CC,CXX}_host for compilation of code to | |
18 | # be run on the build maching (snapshots when cross compiling are | |
19 | # generated using a CPU emulator provided by v8) and {CC,CXX} for the | |
20 | # cross compile. We unset flags such as CFLAGS as they would affect | |
21 | # both the host and cross compiled build. | |
22 | # Remaining issue to be solved before enabling snapshots by removing | |
23 | # the --without-snapshot flag is that pkg-config picks up cross compilation | |
24 | # flags which breaks the host build. | |
53a2231f FF |
25 | export CC_host="gcc -pthread" |
26 | export CXX_host="g++ -pthread" | |
27 | export CC="$CC $CFLAGS $CPPFLAGS $LDFLAGS" | |
28 | export CXX="$CXX $CXXFLAGS $CPPFLAGS $LDFLAGS" | |
29 | export CFLAGS="-Os" | |
30 | export CXXFLAGS="-Os" | |
31 | unset CPPFLAGS LDFLAGS | |
a61e7e45 | 32 | |
4d57e593 | 33 | |
a61e7e45 FF |
34 | if [ $TERMUX_ARCH = "arm" ]; then |
35 | DEST_CPU="arm" | |
36 | elif [ $TERMUX_ARCH = "i686" ]; then | |
37 | DEST_CPU="ia32" | |
38 | elif [ $TERMUX_ARCH = "aarch64" ]; then | |
39 | DEST_CPU="arm64" | |
40 | elif [ $TERMUX_ARCH = "x86_64" ]; then | |
41 | DEST_CPU="x64" | |
42 | else | |
6a3364bf | 43 | termux_error_exit "Unsupported arch '$TERMUX_ARCH'" |
a61e7e45 FF |
44 | fi |
45 | ||
53a2231f FF |
46 | export GYP_DEFINES="host_os=linux" |
47 | ||
a61e7e45 FF |
48 | # See note above TERMUX_PKG_DEPENDS why we do not use a shared libuv. |
49 | ./configure \ | |
50 | --prefix=$TERMUX_PREFIX \ | |
51 | --dest-cpu=$DEST_CPU \ | |
52 | --dest-os=android \ | |
53 | --shared-cares \ | |
54 | --shared-openssl \ | |
55 | --shared-zlib \ | |
56 | --without-inspector \ | |
57 | --without-intl \ | |
53a2231f | 58 | --cross-compiling |
a61e7e45 | 59 | } |