NAME="nodejs"
DESC="JavaScript runtime built on Chrome's V8 JavaScript engine"
VERSION="18.17.1"
FILES=("https://nodejs.org/dist/v$VERSION/node-v$VERSION.tar.xz")
HASHES=("cfadecca2649bb74daba89d60fbd02e5")
DEPENDS=("which" "c-ares" "icu" "libuv" "nghttp2")

PACKAGE() {
  tar xf node-v$VERSION.tar.xz
  cd node-v$VERSION

  ./configure --prefix=/usr        \
            --shared-cares         \
            --shared-libuv         \
            --shared-openssl       \
            --shared-nghttp2       \
            --shared-zlib          \
            --with-intl=system-icu
  make && make DESTDIR="$ROOTDIR" install
  ln -sf node "$ROOTDIR/usr/share/doc/node-$VERSION"

  cd .. && rm -r node-v$VERSION
}
