- #FIXME: node.js build does not handle already installed headers
- # https://github.com/nodejs/node/issues/2637
- rm -Rf $TERMUX_PREFIX/{include/gtest/,/include/ares*}
+ #XXX: node.js build does not handle already installed headers
+ # https://github.com/nodejs/node/issues/2637
+ # So we remove them here and restore afterwards.
+ rm -Rf $TERMUX_PKG_CACHEDIR/gtest-include-dir $TERMUX_PKG_CACHEDIR/ares-includes
+ test -d $TERMUX_PREFIX/include/gtest &&
+ mv $TERMUX_PREFIX/include/gtest $TERMUX_PKG_CACHEDIR/gtest-include-dir
+ test -f $TERMUX_PREFIX/include/ares.h &&
+ 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++