[d/bun-bin] added

This commit is contained in:
Gwenhael Le Moine 2022-07-08 22:35:53 +02:00
parent 400cbe8e60
commit e7bec0668b
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

61
d/bun-bin/SlackBuild Executable file
View file

@ -0,0 +1,61 @@
#!/bin/bash
set -e
CWD=$(pwd)
PRGNAM=$(basename $CWD)
ARCH=$(uname -m)
BUILD=2 # add completions
TAG=gwh
OUTPUT=/tmp
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
PREFIX=/usr
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/Jarred-Sumner/bun/tags | jq -r '.[0].name')}
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
BINARCH=x64
mkdir -p $REPOSITORY
# cleaning
rm -fr $PKG
# download
[ ! -e $REPOSITORY/bun-linux-${BINARCH}-${VERSION}.zip ] && wget -c https://github.com/Jarred-Sumner/bun/releases/download/bun-${VERSION}/bun-linux-${BINARCH}.zip -O $REPOSITORY/bun-linux-${BINARCH}-${VERSION}.zip
# installation
mkdir -p $PKG/usr
cd $PKG/usr/
unzip $REPOSITORY/bun-linux-${BINARCH}-${VERSION}.zip
mv bun-linux-${BINARCH} bin
chmod +x bin/bun
mkdir -p $PKG/usr/share/zsh/site-functions
$PKG/usr/bin/bun completions > $PKG/usr/share/zsh/site-functions/_bun
# packaging
cd $PKG
chown -R root:root *
mkdir install
cat <<EOF > install/slack-desc
$PRGNAM: $PRGNAM (Incredibly fast JavaScript runtime, bundler, transpiler and package manager)
$PRGNAM:
$PRGNAM: Bun is a fast all-in-one JavaScript runtime
$PRGNAM:
$PRGNAM: Bundle, transpile, install and run JavaScript & TypeScript projects — all in Bun.
$PRGNAM: Bun is a new JavaScript runtime with a native bundler, transpiler, task runner and
$PRGNAM: npm client built-in.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://bun.sh/
EOF
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz