diff options
author | Lumin Etherlight <lumin+slackbuilds@etherlight.link> | 2024-10-05 02:08:47 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-10-05 02:55:51 +0700 |
commit | 9ec663d16ebfc2a6debf89d03051e83b5df321b6 (patch) | |
tree | e20f483889cbd0bea41d63d332b5230854189fe1 | |
parent | 928ec02eab49aee064943b5e3aa75f67d1a2e015 (diff) |
development/nodejs18: Added (18.x LTS version of Node.js).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r-- | development/nodejs18/README | 11 | ||||
-rw-r--r-- | development/nodejs18/nodejs18.SlackBuild | 138 | ||||
-rw-r--r-- | development/nodejs18/nodejs18.info | 10 | ||||
-rw-r--r-- | development/nodejs18/npm.sh | 58 | ||||
-rw-r--r-- | development/nodejs18/slack-desc | 19 |
5 files changed, 236 insertions, 0 deletions
diff --git a/development/nodejs18/README b/development/nodejs18/README new file mode 100644 index 000000000000..494b6afd2e30 --- /dev/null +++ b/development/nodejs18/README @@ -0,0 +1,11 @@ +Node.js 18.x (LTS) is a JavaScript runtime environment. + +Node.js 18.x (LTS) uses a model of event-driven, +non-blocking I/O that makes it efficient. The npm +JavaScript package manager is included. + +This is a Long Term Support version, and will only +be updated with bug and security fixes. + +NOTE: The nodejs18 SlackBuild conflicts with the + nodejs SlackBuild. diff --git a/development/nodejs18/nodejs18.SlackBuild b/development/nodejs18/nodejs18.SlackBuild new file mode 100644 index 000000000000..e137afb05c9d --- /dev/null +++ b/development/nodejs18/nodejs18.SlackBuild @@ -0,0 +1,138 @@ +#!/bin/bash + +# Slackware build script for nodejs18 +# +# Maintainer: Lumin Etherlight <lumin+slackbuilds@etherlight.link> + +# Thanks to Audrius Kažukauskas +# Ryan P.C. McQuen | Everett, WA +# Willy Sudiarto Raharjo <willysr@slackbuilds.org> + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version, with the following exception: +# the text of the GPL license may be omitted. + +# This program is distributed in the hope that it will be useful, but +# without any warranty; without even the implied warranty of +# merchantability or fitness for a particular purpose. Compiling, +# interpreting, executing or merely reading the text of the program +# may result in lapses of consciousness and/or very being, up to and +# including the end of all existence and the Universe as we know it. +# See the GNU General Public License for more details. + +# You may have received a copy of the GNU General Public License +# along with this program (most likely, a file named COPYING). If +# not, see <https://www.gnu.org/licenses/>. + +# CHANGE LOG: +# +# 2024-10-02 lumin: New 18.x LTS script. +# +# * Build against Slackware shared libraries. +# +# * Switch direct indiscriminate sed edits of +# upstream files for simple manipulation of +# installed files before making package. +# + +cd "$(dirname "$0")" ; CWD=$(pwd) + +PRGNAM=nodejs18 +SRCNAM=node +VERSION=${VERSION:-18.20.4} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ -n "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" +else + SLKCFLAGS="-O2" +fi + +set -eu + +rm -rf "$PKG" +mkdir -p "$TMP" "$PKG" "$OUTPUT" +cd "$TMP" +rm -rf "$SRCNAM-v$VERSION" +tar xvf "$CWD/$SRCNAM-v$VERSION.tar.gz" +cd "$SRCNAM-v$VERSION" +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +./configure \ + --prefix=/usr \ + --shared-libuv \ + --shared-nghttp2 \ + --shared-openssl \ + --shared-zlib \ + --shared-brotli \ + --shared-cares \ + --openssl-use-def-ca-store \ + --with-intl=system-icu \ + --ninja + +make CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" +make install DESTDIR="$PKG" + +find "$PKG" -print0 | xargs -0 file | \ + grep -e "executable" -e "shared object" | \ + grep ELF | cut -f 1 -d : | \ + xargs strip --strip-unneeded 2> /dev/null \ + || true + +if [ "$ARCH" = "x86_64" ]; then + mv "$PKG"/usr/lib "$PKG"/usr/lib64 + rm "$PKG"/usr/bin/corepack "$PKG"/usr/bin/npm "$PKG"/usr/bin/npx + ln -s ../lib64/node_modules/npm/bin/npm-cli.js "$PKG"/usr/bin/npm + ln -s ../lib64/node_modules/npm/bin/npx-cli.js "$PKG"/usr/bin/npx + ln -s ../lib64/node_modules/corepack/dist/corepack.js \ + "$PKG"/usr/bin/corepack +fi + +mv "$PKG"/usr/share/man "$PKG"/usr/ +find "$PKG"/usr/man -type f -exec gzip -9 {} \; + +install -D -m 644 "$CWD"/npm.sh \ + "$PKG"/usr/share/bash-completion/completions/npm + +mkdir "$PKG"/usr/doc/ +mv "$PKG"/usr/share/doc/node "$PKG/usr/doc/$PRGNAM-$VERSION" +rmdir "$PKG"/usr/share/doc/ +cp -a -- LICENSE *.md "$PKG/usr/doc/$PRGNAM-$VERSION" +cat "$CWD/$PRGNAM.SlackBuild" > \ + "$PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild" + +mkdir -p "$PKG"/install +cat "$CWD"/slack-desc > "$PKG"/install/slack-desc + +cd "$PKG" +/sbin/makepkg -l y -c n "$OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" diff --git a/development/nodejs18/nodejs18.info b/development/nodejs18/nodejs18.info new file mode 100644 index 000000000000..2a629c62b702 --- /dev/null +++ b/development/nodejs18/nodejs18.info @@ -0,0 +1,10 @@ +PRGNAM="nodejs18" +VERSION="18.20.4" +HOMEPAGE="https://nodejs.org/" +DOWNLOAD="https://nodejs.org/dist/v18.20.4/node-v18.20.4.tar.gz" +MD5SUM="285520a4841b0c6821a8af84a2a642c4" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Lumin Etherlight" +EMAIL="lumin+slackbuilds@etherlight.link" diff --git a/development/nodejs18/npm.sh b/development/nodejs18/npm.sh new file mode 100644 index 000000000000..25bef2c17b4b --- /dev/null +++ b/development/nodejs18/npm.sh @@ -0,0 +1,58 @@ +#!/bin/bash +###-begin-npm-completion-### +# +# npm command completion script +# +# Installation: npm completion >> ~/.bashrc (or ~/.zshrc) +# Or, maybe: npm completion > /usr/local/etc/bash_completion.d/npm +# + +if type complete &>/dev/null; then + _npm_completion () { + local words cword + if type _get_comp_words_by_ref &>/dev/null; then + _get_comp_words_by_ref -n = -n @ -w words -i cword + else + cword="$COMP_CWORD" + words=("${COMP_WORDS[@]}") + fi + + local si="$IFS" + IFS=$'\n' COMPREPLY=($(COMP_CWORD="$cword" \ + COMP_LINE="$COMP_LINE" \ + COMP_POINT="$COMP_POINT" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + complete -o default -F _npm_completion npm +elif type compdef &>/dev/null; then + _npm_completion() { + local si=$IFS + compadd -- $(COMP_CWORD=$((CURRENT-1)) \ + COMP_LINE=$BUFFER \ + COMP_POINT=0 \ + npm completion -- "${words[@]}" \ + 2>/dev/null) + IFS=$si + } + compdef _npm_completion npm +elif type compctl &>/dev/null; then + _npm_completion () { + local cword line point words si + read -Ac words + read -cn cword + let cword-=1 + read -l line + read -ln point + si="$IFS" + IFS=$'\n' reply=($(COMP_CWORD="$cword" \ + COMP_LINE="$line" \ + COMP_POINT="$point" \ + npm completion -- "${words[@]}" \ + 2>/dev/null)) || return $? + IFS="$si" + } + compctl -K _npm_completion npm +fi +###-end-npm-completion-### diff --git a/development/nodejs18/slack-desc b/development/nodejs18/slack-desc new file mode 100644 index 000000000000..58b08e8ca745 --- /dev/null +++ b/development/nodejs18/slack-desc @@ -0,0 +1,19 @@ +# 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------------------------------------------------------| +nodejs18: nodejs18 (JavaScript runtime) +nodejs18: +nodejs18: Node.js 18.x (LTS) is a cross-platform open-source JavaScript runtime +nodejs18: built on Chrome's V8 JavaScript engine. This is a Long Term Support +nodejs18: version, and will only be updated with bug and security fixes. +nodejs18: +nodejs18: https://nodejs.org/ +nodejs18: +nodejs18: +nodejs18: +nodejs18: |