forked from nick8325/quickcheck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-all
executable file
·68 lines (55 loc) · 1.27 KB
/
build-all
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/bin/zsh
set -e
status() {
echo $*
echo $* >&2
}
last-word() {
last=
for i in $*; do
last=$i
done
print $last
}
find-package() {
last-word $(sed '/using$/{N;s/\n/ /}' $tmp|grep "using $1")
}
build-quickcheck() {
kind=$1
flags=$2
status -n "$kind: "
rm -rf dist
if $runhaskell Setup.lhs configure -w $ghc $flags --user -v > $tmp; then
grep 'Flags\|using' $tmp >&2
else
status 'Failed!'
< $tmp >&2
return
fi
if $runhaskell Setup.lhs build >&2; then
status "OK, $(find-package base) $(find-package extensible-exceptions) $(find-package tf-random) $(find-package transformers)"
else
status 'Failed!'
fi
print >&2
}
exec 2>log
export tmp=$(mktemp)
if (( $# > 0 )); then
ghcdirs=$*
else
ghcdirs="/opt/ghc-*/bin /usr/bin"
fi
for ghcdir in ${~=ghcdirs}; do
export ghc=$ghcdir/ghc
version=$(last-word $($ghc --version))
if [[ $version = 6.8.3 ]] || [[ $version = 6.10.4 ]]; then
export runhaskell=/opt/ghc-6.12.3/bin/runhaskell
else
export runhaskell=$ghcdir/runhaskell
fi
status "==> GHC $version"
cabal install -w $ghc --only-dependencies >& /dev/null || true
build-quickcheck "No options"
status
done