#!/bin/bash if [ "$EUID" = 0 ] then echo "Please don't run this as root" exit fi VERSION=17.5.0 if [ ! -f src/node-$VERSION/Makefile ] then mkdir src -p cd src echo "clonning" curl https://github.com/nodejs/node/archive/refs/tags/v$VERSION.zip -L --output $VERSION.zip || exit 1 unzip $VERSION.zip || exit 1 ./patch.sh cd - fi echo "building" #LD_LIBRARY_PATH=$(pwd)/../rootfs/lib:$(pwd)/../rootfs/lib64:$(pwd)/../rootfs/usr/lib:$(pwd)/../rootfs/usr/lib32:$(pwd)/../rootfs/usr/lib64:/lib:$(pwd)/lib64:$(pwd)/usr/lib:$(pwd)/usr/lib32:$(pwd)/usr/lib64 cd src/node-$VERSION #https://github.com/nodejs/node/issues/41497 ./configure --prefix=/usr --fully-static --enable-static || exit 1 for i in out/tools/v8_gypfiles/gen-regexp-special-case.target.mk out/test_crypto_engine.target.mk; do sed -i 's/\-static//g' $i || echo "nevermind"; done make -j$(nproc) || exit 1 cd - sudo src/node-$VERSION/tools/install.py install $(pwd)/../rootfs || exit 1