From 826c1e6842c556d9b832dc17c5365d3995065a52 Mon Sep 17 00:00:00 2001 From: Niclas Hofmann Date: Thu, 30 Jun 2022 13:49:56 +0200 Subject: [PATCH] haskell: update ghc to 9.2.2 and add pandoc Christmas is there. Pandoc is now in the haskell pkg. Also some useful libraries are added. There is already a version 9.2.3 of the ghc but that is not compatible with the hls. Therefore I decided to take 9.2.2. --- haskell-9.2.2-0.build.sh | 58 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100755 haskell-9.2.2-0.build.sh diff --git a/haskell-9.2.2-0.build.sh b/haskell-9.2.2-0.build.sh new file mode 100755 index 0000000..eed9ae5 --- /dev/null +++ b/haskell-9.2.2-0.build.sh @@ -0,0 +1,58 @@ +#! /bin/bash + +PKG=haskell +VERSION=9.2.2 +BUILD=0 + +GHCUP_VERSION=0.1.17.8 +CABAL_VERSION=3.6.2.0 +HLS_VERSION=1.7.0.0 + +PREFIX=/pkg/$PKG-$VERSION-$BUILD +if [ -n "$TESTING" ]; then PREFIX=/dev/shm/$PKG-$VERSION-$BUILD ; fi + +set -xe +umask 022 + +BUILD_TMPDIR=/dev/shm/$PKG-$VERSION-$BUILD.build.tmp +test -d $BUILD_TMPDIR && ( chmod -R u+rwx $BUILD_TMPDIR || true ; rm -rf $BUILD_TMPDIR ) +mkdir -p $BUILD_TMPDIR/home +export TMPDIR=$BUILD_TMPDIR +export HOME=$BUILD_TMPDIR/home + +exec $PREFIX/profile <<-EOF + PATH=$PREFIX/bin:\$PATH + export LD_LIBRARY_PATH=$PREFIX/lib\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} + if [ -d $PREFIX/.compatlibs ]; then export LD_LIBRARY_PATH=$PREFIX/.compatlibs\${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH} ; fi +EOF +. $PREFIX/profile + +export MAKEFLAGS="-j $(nproc)" + +cd $PREFIX + +# https://www.haskell.org/platform/linux.html#linux-generic: +# The recommended way to install the components of the generic platform is using ghcup to install ghc and cabal-install +# and following the instructions at haskellstack.org to install stack + +# https://www.haskell.org/ghcup/: +# if you don't like curl | sh, see other installation method +# ---> https://gitlab.haskell.org/haskell/ghcup-hs#manual-install + +mkdir -p $PREFIX/bin +test -e $PREFIX/bin/ghcup || wget -O $PREFIX/bin/ghcup https://downloads.haskell.org/~ghcup/$GHCUP_VERSION/x86_64-linux-ghcup-$GHCUP_VERSION +chmod +x $PREFIX/bin/ghcup + +# ghcup list shows available and recomended versions + +ghcup install ghc $VERSION -i $PREFIX --force +ghcup install cabal $CABAL_VERSION -i $PREFIX/bin --force +ghcup install hls $HLS_VERSION -i $PREFIX --force + +cabal update +cabal install pandoc primes rio --prefix=$PREFIX --installdir=$PREFIX/bin --install-method=copy --libdir=$PREFIX/lib --flags=embed_data_files + +exit