mirror of
https://github.com/dslm4515/BMLFS.git
synced 2025-08-01 19:42:55 +00:00
103 lines
3.2 KiB
Bash
103 lines
3.2 KiB
Bash
#! /bin/bash
|
|
|
|
# Node.js
|
|
# Source: https://nodejs.org/dist/v21.5.0/node-v21.5.0.tar.xz
|
|
#
|
|
# $BUILD = Directory to temporarily install
|
|
# $PKGS = Directory to store built packages
|
|
#
|
|
# DEPS
|
|
# Required: Which, c-ares
|
|
# Recommended: ICU, libuv, nghttp2, brotli
|
|
# Optional: http-parser, NPM
|
|
#
|
|
# NOTE: Node.js does not compile with LibreSSL. Use the bundled openssl OR OpenSSL
|
|
# in /opt/openssl
|
|
|
|
# NOTE: Fails to compile with clang. Must use GCC
|
|
|
|
# Apply patches from Chimera Linux
|
|
patch -Np1 -i ../patches/nodejs-chimera/clang-ppc64.patch
|
|
patch -Np1 -i ../patches/nodejs-chimera/disable-running-gyp-on-shared-deps.patch
|
|
patch -Np1 -i ../patches/nodejs-chimera/no-libatomic.patch
|
|
patch -Np1 -i ../patches/nodejs-chimera/shared-uv.patch
|
|
|
|
case $(uname -m) in
|
|
i686) export LDFLAGS="-Wl,--no-keep-memory" ;;
|
|
esac
|
|
|
|
for d in brotli cares zlib
|
|
do
|
|
rm -rf deps/$d
|
|
done
|
|
rm -rf deps/v8/third_party/jinja2
|
|
rm -rf tools/inspector_protocol/jinja2
|
|
|
|
# If using OpenSSL in /opt/openssl, add these aguments to configure:
|
|
export EOSSL="--shared-openssl-includes /opt/openssl/include "
|
|
export EOSSL+="--shared-openssl-libpath /optn/openssl/lib "
|
|
|
|
# If GCC is not in /usr, set the path (CMLFS)
|
|
PATH=/opt/gnu/bin:$PATH CC=gcc CXX=g++ \
|
|
./configure --prefix=/usr --shared-zlib \
|
|
--with-intl=system-icu \
|
|
--shared-libuv \
|
|
--shared-nghttp2 \
|
|
--shared-cares \
|
|
--shared-brotli $EOSSL &&
|
|
|
|
# If GCC is not in /usr, set the path & library path (CMLFS)
|
|
PATH=/opt/gnu/bin:$PATH LD_LIBRARY_PATH=/opt/gnu/lib:/usr/lib \
|
|
make BUILDTYPE=Release -j2
|
|
|
|
#sudo -S -E make DESTDIR=$BUILD install &&
|
|
|
|
# If GCC is not in /usr, set the path & library path (CMLFS)
|
|
sudo -S -E PATH=/opt/gnu/bin:$PATH LD_LIBRARY_PATH=/opt/gnu/lib:/usr/lib \
|
|
make DESTDIR=$BUILD install
|
|
|
|
sudo -S mkdir -pv /BMAN/install /BMAN/usr/share && \
|
|
sudo -S mv $BUILD/usr/share/man /BMAN/usr/share/ && \
|
|
unset CXXFLAGS CFLAGS LDFLAGS EOSSL &&
|
|
|
|
cd $BUILD && sudo -S mkdir -v ${BUILD}/install &&
|
|
cat > /tmp/slack-desc << "EOF"
|
|
# HOW TO EDIT THIS FILE:
|
|
# The "handy ruler" below makes it easier to edit a package description. Line
|
|
# up the first '|' above the ':' following the base package name, and the '|'
|
|
# on the right side marks the last column you can put a character in. You must
|
|
# make exactly 11 lines for the formatting to be correct. It's also
|
|
# customary to leave one space after the ':' except on otherwise blank lines.
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
nodejs: nodejs (JavaScript runtime)
|
|
nodejs:
|
|
nodejs: Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript
|
|
nodejs: engine.
|
|
nodejs:
|
|
nodejs:
|
|
nodejs:
|
|
nodejs: https://nodejs.org/
|
|
nodejs:
|
|
nodejs:
|
|
nodejs:
|
|
EOF
|
|
sudo -S mv -v /tmp/slack-desc install/ &&
|
|
# If GCC is not in /usr, add runpaths via pathcelf
|
|
sudo patchelf --add-rpath /opt/gnu/lib usr/bin/node
|
|
|
|
sudo -S makepkg -l y -c n $PKGS/nodejs-21.5.0-$PSUFFIX && \
|
|
cd /BMAN && \
|
|
cat > /tmp/slack-desc << "EOF"
|
|
nodejs-doc: Manuals for nodejs
|
|
nodejs-doc:
|
|
nodejs-doc: Node.js is a JavaScript runtime built on Chrome's V8 JavaScript
|
|
nodejs-doc: engine.
|
|
nodejs-doc:
|
|
nodejs-doc: https://nodejs.org/
|
|
nodejs-doc:
|
|
EOF
|
|
sudo -S mv -v /tmp/slack-desc install/ && \
|
|
sudo -S makepkg -l y -c n $PKGS/nodejs-doc-21.5.0-$NOPSUFFIX && \
|
|
sudo -S rm -rf ${BUILD}/*
|