gitlab-ci: Implement head.hackage jobs
[ghc.git] / .gitlab / win32-init.sh
1 #!/bin/bash
2
3 set -e
4
5 toolchain=`pwd`/toolchain
6 PATH="$toolchain/bin:/mingw64/bin:$PATH"
7
8 if [ -d "`pwd`/cabal-cache" ]; then
9 cp -Rf cabal-cache $APPDATA/cabal
10 fi
11
12 if [ ! -e $toolchain/bin/ghc ]; then
13 curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-unknown-mingw32.tar.xz | tar -xJ
14 mv ghc-$GHC_VERSION toolchain
15 fi
16
17 if [ ! -e $toolchain/bin/cabal ]; then
18 curl https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-i386-unknown-mingw32.zip > /tmp/cabal.zip
19 unzip /tmp/cabal.zip
20 mv cabal.exe $toolchain/bin
21 fi
22
23 if [ ! -e $toolchain/bin/happy ]; then
24 cabal update
25 cabal install happy
26 cp $APPDATA/cabal/bin/happy $toolchain/bin
27 fi
28
29 if [ ! -e $toolchain/bin/alex ]; then
30 cabal update
31 cabal install alex
32 cp $APPDATA/cabal/bin/alex $toolchain/bin
33 fi
34