From e7bec0668b189d3a8da3687d5e92db027eaf7dae Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Fri, 8 Jul 2022 22:35:53 +0200 Subject: [PATCH] [d/bun-bin] added --- d/bun-bin/SlackBuild | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 d/bun-bin/SlackBuild diff --git a/d/bun-bin/SlackBuild b/d/bun-bin/SlackBuild new file mode 100755 index 00000000..6ded74cd --- /dev/null +++ b/d/bun-bin/SlackBuild @@ -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 < 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