From 21d6b085b62646fe74353bfeb60c90ef1a393b58 Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Mon, 14 Jun 2021 16:33:29 +0200 Subject: [PATCH] package ghcup binary --- d/ghcup/SlackBuild | 49 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100755 d/ghcup/SlackBuild diff --git a/d/ghcup/SlackBuild b/d/ghcup/SlackBuild new file mode 100755 index 00000000..c63c6572 --- /dev/null +++ b/d/ghcup/SlackBuild @@ -0,0 +1,49 @@ +#!/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) +BUILD=${BUILD:-1} +TAG=${TAG:-gwh} +TMP=${TMP:-/tmp/$TAG} +PKG=$TMP/pkg-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +[ ! -e $CWD/${PRGNAM}-${VERSION} ] && wget -c -O $CWD/${PRGNAM}-${VERSION} https://downloads.haskell.org/~ghcup/$VERSION/${ARCH}-linux-ghcup-$VERSION + +rm -fr $PKG +mkdir -p $PKG/bin + +cp $CWD/${PRGNAM}-${VERSION} $PKG/bin/$PRGNAM + +mkdir -p $PKG/install + +cat < $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 +/sbin/makepkg -l y -c n ${OUTPUT}/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txz