Merge pull request #9898 from haskell/mergify/bp/3.12/pr-9865
[cabal.git] / .gitlab / ghcup.sh
blob98a8b433b793172b239a61f27322d9339dd9ebdc
1 export GHCUP_INSTALL_BASE_PREFIX="$CI_PROJECT_DIR/toolchain"
3 case "$(uname)" in
4 MSYS_*|MINGW*)
5 GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/ghcup/bin"
6 ;;
7 *)
8 GHCUP_BINDIR="${GHCUP_INSTALL_BASE_PREFIX}/.ghcup/bin"
9 ;;
10 esac
12 mkdir -p "$GHCUP_BINDIR"
13 export PATH="$GHCUP_BINDIR:$PATH"
15 export BOOTSTRAP_HASKELL_NONINTERACTIVE=1
16 export BOOTSTRAP_HASKELL_GHC_VERSION=$GHC_VERSION
17 export BOOTSTRAP_HASKELL_CABAL_VERSION=$CABAL_INSTALL_VERSION
18 export BOOTSTRAP_HASKELL_ADJUST_CABAL_CONFIG=yes
19 # We don't use stack, and it isn't available on i386-deb9
20 export BOOTSTRAP_HASKELL_INSTALL_NO_STACK=yes
22 # for some reason the subshell doesn't pick up the arm64 environment on darwin
23 # and starts installing x86_64 GHC
24 case "$(uname -s)" in
25 "Darwin"|"darwin")
26 case "$(/usr/bin/arch)" in
27 aarch64|arm64|armv8l)
28 curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | arch -arm64 /bin/bash
31 curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
33 esac
36 curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
38 esac