Add GitLab CI
[ghc.git] / .gitlab / darwin-init.sh
1 #!/bin/bash
2
3 set -e
4
5 toolchain=`pwd`/toolchain
6 PATH="$toolchain/bin:$PATH"
7
8 if [ -d "`pwd`/cabal-cache" ]; then
9 cp -Rf cabal-cache $HOME/.cabal
10 fi
11
12 if [ ! -e $toolchain/bin/ghc ]; then
13 mkdir -p tmp
14 cd tmp
15 curl https://downloads.haskell.org/~ghc/$GHC_VERSION/ghc-$GHC_VERSION-x86_64-apple-darwin.tar.xz | tar -xJ
16 cd ghc-$GHC_VERSION
17 ./configure --prefix=$toolchain
18 make install
19 cd ../..
20 rm -Rf tmp
21 fi
22
23 if [ ! -e $toolchain/bin/cabal ]; then
24 cabal_tarball="https://www.haskell.org/cabal/release/cabal-install-2.2.0.0/cabal-install-2.2.0.0-x86_64-apple-darwin-sierra.tar.gz"
25 curl $cabal_tarball | tar -xz
26 mv cabal $toolchain/bin
27 fi
28
29 if [ ! -e $toolchain/bin/happy ]; then
30 cabal update
31 cabal new-install happy --symlink-bindir=$toolchain/bin
32 fi
33
34 if [ ! -e $toolchain/bin/alex ]; then
35 cabal update
36 cabal new-install alex --symlink-bindir=$toolchain/bin
37 fi
38