You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

30 lines
841 B

#!/usr/bin/env bash
# bin/compile BUILD_DIR CACHE_DIR
set -e
source scripts/functions
BUILD_DIR=$1
CACHE_DIR=$2
## CHECK BUILDPACK_GHC_BASE_URL is set
if [ "$BUILDPACK_GHC_BASE_URL" != "" ]; then
arch=$(uname -m)
ghcver=$GHC_BOOTSTRAP_VERSION
bsdir=$CACHE_DIR/bootstrap
ghcurl="$BUILDPACK_GHC_BASE_URL/$ghcver/ghc-$ghcver-$arch-unknown-linux.tar.bz2"
echo "Info: bootstrap directory: ${bsdir}";
echo "Info: bootstrap URL: $ghcurl";
if [ -f "$bsdir.completed" ]; then
echo "Info: already downloaded GHC bootstrap version ${ghcver}";
else
echo "Info: downloading GHC $ghcver form $ghcurl";
$(downloadAndExtract $bsdir $ghcurl);
$(configureMakeInstall $bsdir/ghc-$ghcver $BUILD_DIR/bootstrap/ghc-$ghcver);
touch $bsdir.completed
fi;
else
echo "Error: please set BUILDPACK_GHC_BASE_URL";
exit 1;
fi