#!/bin/bash # Script to perform a manual install of GHC generic Linux version # to a specific directory. # The script will also build cabal-install into this same location. # The goal here is to end up with a usable base Haskell toolchain # for distros that do not provide new enough versions of these things. set -e # These can be overridden by setting environment variables : ${GHC_VERSION:=7.10.2} : ${ARCH:=x86_64} # Optionally: i386 : ${DISTRO:=deb7} # Optionally: centos66 : ${CABAL_VERSION:=1.22.6.0} : ${PREFIX:=/} # Optionally: /opt/haskell # Temporary location where source downloading and builds will occur buildDir=$(mktemp --directory --tmpdir ghc-install.XXXX) ghcPkgDb="${buildDir}/packages.conf.d" ghcArchive="ghc-${GHC_VERSION}-${ARCH}-unknown-linux-${DISTRO}.tar.xz" cabalArchivePrefix="cabal-install-${CABAL_VERSION}" cabalArchive="${cabalArchivePrefix}.tar.gz" cat <