2021-06-14 16:33:29 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
|
|
|
|
PRGNAM=$(basename $CWD)
|
|
|
|
VERSION=${VERSION:-$(curl -s "https://gitlab.haskell.org/haskell/ghcup-hs/-/tags?format=atom" | grep "title>v" | head -n1 | grep -o "[0-9rc.-]*")}
|
|
|
|
ARCH=$(uname -m)
|
2022-11-17 11:45:58 +01:00
|
|
|
BUILD=${BUILD:-2}
|
2021-06-14 16:33:29 +02:00
|
|
|
TAG=${TAG:-gwh}
|
|
|
|
TMP=${TMP:-/tmp/$TAG}
|
|
|
|
PKG=$TMP/pkg-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2022-01-22 19:52:02 +01:00
|
|
|
REPOSITORY=${REPOSITORY:-/home/installs/SlackBuilds/_repositories/$PRGNAM}
|
2021-09-29 12:57:50 +02:00
|
|
|
|
|
|
|
mkdir -p $REPOSITORY
|
|
|
|
|
|
|
|
[ ! -e $REPOSITORY/${PRGNAM}-${VERSION} ] && wget -c -O $REPOSITORY/${PRGNAM}-${VERSION} https://downloads.haskell.org/~ghcup/$VERSION/${ARCH}-linux-ghcup-$VERSION
|
2021-06-14 16:33:29 +02:00
|
|
|
|
|
|
|
rm -fr $PKG
|
2022-04-11 08:09:46 +02:00
|
|
|
mkdir -p $PKG/usr/bin
|
2021-06-14 16:33:29 +02:00
|
|
|
|
2022-11-17 11:45:58 +01:00
|
|
|
cp $REPOSITORY/${PRGNAM}-${VERSION} $PKG/usr/bin/ghcup
|
|
|
|
chmod 0755 $PKG/usr/bin/ghcup
|
2021-06-14 16:33:29 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
|
|
|
|
cat <<EOF > $PKG/install/slack-desc
|
|
|
|
# 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 ':'.
|
|
|
|
|
|
|
|
|-----handy-ruler------------------------------------------------------|
|
|
|
|
${PRGNAM}: ${PRGNAM} ( installer for Haskell )
|
|
|
|
${PRGNAM}:
|
|
|
|
${PRGNAM}: ghcup makes it easy to install specific versions of ghc on GNU/Linux,
|
|
|
|
${PRGNAM}: macOS (aka Darwin) and FreeBSD and can also bootstrap a fresh Haskell
|
|
|
|
${PRGNAM}: developer environment from scratch. It follows the unix UNIX
|
|
|
|
${PRGNAM}: philosophy of do one thing and do it well.
|
|
|
|
${PRGNAM}:
|
|
|
|
${PRGNAM}: Similar in scope to rustup, pyenv and jenv.
|
|
|
|
${PRGNAM}:
|
|
|
|
${PRGNAM}: https://www.haskell.org/ghcup/
|
|
|
|
${PRGNAM}: https://gitlab.haskell.org/haskell/ghcup-hs
|
|
|
|
EOF
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
|
2023-08-16 12:23:26 +02:00
|
|
|
/sbin/makepkg --linkadd y --chown n --prepend ${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz
|