0

Initial commit

This commit is contained in:
eleksir
2023-11-19 18:01:40 +03:00
commit 80ec8a7529
586 changed files with 29486 additions and 0 deletions

8
nodejs/README Normal file
View File

@@ -0,0 +1,8 @@
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Node.js uses an event-driven, non-blocking I/O model that makes it
lightweight and efficient. Node.js' package ecosystem, npm, is the
largest ecosystem of open source libraries in the world.
NOTE: This version uses an internal OpenSSL version instead of
the one provided in Slackware package.

125
nodejs/nodejs.SlackBuild Executable file
View File

@@ -0,0 +1,125 @@
#!/bin/sh
set -e
# Slackware build script for nodejs
# 2022 Copyright Sergei Fedosoff <eleksir@gmail.com>
#
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=nodejs
SRCNAM=node
VERSION=${VERSION:-18.18.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_EXs}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
if [ "$ARCH" = "i586" ]; then
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRCNAM-v$VERSION
tar xf $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 {} \+
## Fix man page path.
sed -i 's|share/||' tools/install.py
#sed -i '/var manRoot/ s/"share",//' deps/npm/lib/{,un}build.js
## Fix libdir for 64-bit.
sed -i "s|lib/|lib${LIBDIRSUFFIX}/|g" tools/install.py
sed -i "s/'lib'/'lib${LIBDIRSUFFIX}'/" lib/module.js
sed -i "s|\"lib\"|\"lib${LIBDIRSUFFIX}\"|" deps/npm/lib/npm.js
#sed -i "s|math.h|cmath|" src/node_crypto.cc
./configure \
--prefix=/usr \
--shared-zlib
make -j$(nproc) 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
find $PKG/usr/man -type f -exec gzip -9 {} \+
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
## Add bash completion file for npm.
install -D -m 644 $CWD/npm.sh $PKG/usr/share/bash-completion/completions/npm
## Remove unneeded files.
find $PKG/usr \( -name '.git*' \) -exec rm -rf {} \+
## Set NODE_PATH to look for globally installed modules.
mkdir -p $PKG/etc/profile.d
cat > $PKG/etc/profile.d/${SRCNAM}.csh << EOF
#!/bin/csh
setenv NODE_PATH /usr/lib${LIBDIRSUFFIX}/node_modules
EOF
cat > $PKG/etc/profile.d/${SRCNAM}.sh << EOF
#!/bin/sh
export NODE_PATH=/usr/lib${LIBDIRSUFFIX}/node_modules
EOF
chmod 0755 $PKG/etc/profile.d/*
# Fix some files path
mv $PKG/usr/doc/node $PKG/usr/share/nodejs
rm -rf $PKG/usr/systemtap
install -Dpm 0644 $CWD/$PRGNAM.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cp -a LICENSE *.md $PKG/usr/doc/$PRGNAM-$VERSION
install -Dpm 0644 $CWD/slack-desc $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

10
nodejs/nodejs.info Normal file
View File

@@ -0,0 +1,10 @@
PRGNAM="nodejs"
VERSION="18.18.2"
HOMEPAGE="https://nodejs.org/"
DOWNLOAD="https://nodejs.org/dist/v18.18.2/node-v18.18.2.tar.gz"
MD5SUM="035b97b23310e1db718924823c0d90ae"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
MAINTAINER="Sergei Fedosoff"
EMAIL="eleksir@gmail.com"

7
nodejs/npm.sh Normal file
View File

@@ -0,0 +1,7 @@
# shellcheck shell=bash
cite "about-completion"
about-completion "npm (Node Package Manager) completion"
if _command_exists npm; then
eval "$(npm completion)"
fi

19
nodejs/slack-desc Normal file
View File

@@ -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------------------------------------------------------|
nodejs: nodejs (JavaScript runtime)
nodejs:
nodejs: Node.js is a JavaScript runtime built on Chrome's V8 JavaScript
nodejs: engine.
nodejs:
nodejs: https://nodejs.org/
nodejs:
nodejs:
nodejs:
nodejs:
nodejs: