forked from haskell/haskell-platform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplatform.sh
executable file
·38 lines (32 loc) · 902 Bytes
/
platform.sh
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
#!/bin/sh
set -e
HPTOOL=hptool/dist/build/hptool/hptool
HPTOOL_ALT=hptool/.cabal-sandbox/bin/hptool
if ( cabal sandbox --help >/dev/null 2>&1 ) ; then
if [ \! -d hptool/.cabal-sandbox ]
then
echo '***'
echo '*** Setting up sandbox for hptool'
echo '***'
cabal update
(cd hptool; cabal sandbox init; cabal install --only-dependencies)
fi
else
if ( cabal install --dry-run --only-dependencies | grep -q 'would be installed' ) ; then
echo '=== pre-requisite packages for hptool are not installed'
echo ' run the following:'
echo ' cd hptool ; cabal install --only-dependencies'
exit 1
fi
fi
echo '***'
echo '*** Building hptool'
echo '***'
(cd hptool; cabal build)
if [ "$HPTOOL_ALT" -nt "$HPTOOL" ] ; then
HPTOOL="$HPTOOL_ALT"
fi
echo '***'
echo '*** Running hptool'
echo '***'
exec $HPTOOL "$@"