aboutsummaryrefslogtreecommitdiff
path: root/scripts/ci/install-stack.sh
blob: 7be2700e508fb2d86f81b3561f3917f8ac917bda (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

BINDIR="$1"; shift

cabal v2-install \
      --symlink-bindir="$BINDIR" \
      --constraint "network < 3" \
      --package-env=/dev/null \
      hpack || exit 1

stack_dir="$(mktemp --tmpdir -d "install-stack.XXXXXXXXX")"
trap 'rm -rf '"$stack_dir" 0 2 15

git clone \
    --depth=1 \
    --branch=stable \
    https://github.com/commercialhaskell/stack "$stack_dir"  || exit 1

(
	cd "$stack_dir"
	"$BINDIR/hpack"
	cabal v2-install \
	      --symlink-bindir="$BINDIR" \
	      --constraint "Cabal == 2.4.0.1" \
	      --constraint "network < 3" . \
	      --package-env=/dev/null || exit 1
) || exit 1