From 3b255d7364b2631d07cf1cc2856a30808c705930 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 23 Oct 2020 14:59:27 +0200 Subject: [PATCH] Add haskell-8.10.2 Add package which installs Haskell 8.10.1, cabal 3.2.0.0 and hls (haskell-language-server) 0.5.1 using ghcup [1] We need libtinfo.so.6 at build time for ghcup and at run time for haskell. The installed libncursesw.so is (hopefully) ABI compatible, so add it to the package. [1] https://gitlab.haskell.org/haskell/ghcup-hs --- haskell-8.10.2-0.build.sh | 65 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100755 haskell-8.10.2-0.build.sh diff --git a/haskell-8.10.2-0.build.sh b/haskell-8.10.2-0.build.sh new file mode 100755 index 0000000..cfd5012 --- /dev/null +++ b/haskell-8.10.2-0.build.sh @@ -0,0 +1,65 @@ +#! /bin/bash + +PKG=haskell +VERSION=8.10.2 +BUILD=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:$PREFIX/.ghcup/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)" + +BUILDDIR=$PREFIX/build + +mkdir -p $BUILDDIR +cd $BUILDDIR + +# 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/0.1.11/x86_64-linux-ghcup-0.1.11 +chmod +x $PREFIX/bin/ghcup + +mkdir -p $PREFIX/lib +cp /usr/lib/libncursesw.so $PREFIX/lib/ +ln -sf libncursesw.so $PREFIX/lib/libtinfo.so.6 + +export GHCUP_INSTALL_BASE_PREFIX=$PREFIX + +# ghcup list shows available and recomended versions + +ghcup install ghc $VERSION +ghcup set ghc $VERSION + +ghcup install cabal 3.2.0.0 +ghcup set cabal 3.2.0.0 + +ghcup install hls 0.5.1 +ghcup set hls 0.5.1 + +exit