@@ -10,11 +10,20 @@
1010# instructions, see:
1111# http://www.stackage.org/install
1212
13−set -exu
13+set -exuo pipefail
1414
1515mkdir /home/stackage -p
1616
1717export DEBIAN_FRONTEND=noninteractive
18+
19+# Get curl
20+apt-get update
21+apt-get install -y curl
22+
23+# Get Stack and GHC
24+curl -sSL https://get.haskellstack.org/ | sh -s - -d /usr/bin
25+stack setup --resolver ghc-$GHCVER
26+
1827apt-get update
1928apt-get install -y software-properties-common
2029
@@ -25,7 +34,7 @@ add-apt-repository -y --keyserver hkp://keyserver.ubuntu.com:80 'deb http://down
2534add-apt-repository -y --keyserver hkp://keyserver.ubuntu.com:80 'deb http://download.mono-project.com/repo/debian wheezy-apache24-compat main'
2635add-apt-repository -y --keyserver hkp://keyserver.ubuntu.com:80 'deb http://download.mono-project.com/repo/debian wheezy-libjpeg62-compat main'
2736
28−GHCVER=8.6.3
37+GHCVER=8.6.4
2938
3039apt-get update
3140apt-get install -y \
@@ -164,11 +173,6 @@ ACCEPT_EULA=Y apt-get install msodbcsql17 -y
164173
165174locale-gen en_US.UTF-8
166175
167−curl -sSL https://get.haskellstack.org/ | sh
168−
169−# Put documentation where we expect it
170−mv /opt/ghc/$GHCVER/share/doc/ghc-$GHCVER/ /opt/ghc/$GHCVER/share/doc/ghc
171−
172176# llvm-5.0 for GHC (separate since it needs wget)
173177wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - \
174178 && add-apt-repository "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-5.0 main" \
@@ -304,3 +308,7 @@ export CLANG_PURE_LLVM_INCLUDE_DIR=/usr/lib/llvm-3.9/include;
304308# finally run:
305309ldconfig
306310# EOF: don't build anything below this line
311+
312+# Cleanup
313+apt-get clean
314+rm -rf /var/lib/apt/lists/*