Skip to content
This repository was archived by the owner on Feb 3, 2022. It is now read-only.

Commit bb63ba0

Browse files
committed
Track changes in platform.sh
* windows-platform.sh * pick up some robustness fixes from platform.sh * add a few more sanity checks for Windows (easier to catch these before the long build starts and it then hits them)
1 parent 0e3e6a4 commit bb63ba0

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

windows-platform.sh

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ NSIS_BIN="/c/Program Files (x86)/NSIS"
1515

1616
HPTOOL=hptool/dist/build/hptool/hptool.exe
1717

18-
if [ \! \( -e $HPTOOL -a -x $HPTOOL \) ]
19-
then
18+
if ( cabal sandbox --help >/dev/null 2>&1 ) ; then
2019
if [ \! -d hptool/.cabal-sandbox ]
2120
then
2221
echo '***'
@@ -25,25 +24,39 @@ then
2524
cabal update
2625
(cd hptool; cabal sandbox init; cabal install --only-dependencies)
2726
fi
28-
29-
echo '***'
30-
echo '*** Building hptool'
31-
echo '***'
32-
(cd hptool; cabal build)
27+
else
28+
if ( cabal install --dry-run --only-dependencies | grep -q 'would be installed' ) ; then
29+
echo '=== pre-requisite packages for hptool are not installed'
30+
echo ' run the following:'
31+
echo ' cd hptool ; cabal install --only-dependencies'
32+
exit 1
33+
fi
3334
fi
3435

36+
echo '***'
37+
echo '*** Building hptool'
38+
echo '***'
39+
(cd hptool; cabal build)
40+
3541
CWD=`pwd`
3642
GHC_BINDIST=build/ghc-bindist/local
3743
MINGW=$GHC_BINDIST/mingw
3844

39-
# A clean, cruft-free PATH
45+
# A clean, well-lighted, cruft-free PATH
4046
export PATH=$CWD/$GHC_BINDIST/bin:$CWD/$MINGW/bin:$MSYS_BIN:$NSIS_BIN:$HASK_BIN
4147

4248
which cabal ||
4349
{ echo "Could not find cabal.exe on PATH!"; echo "PATH=$PATH"; exit 1; }
4450
which makensisw ||
4551
{ echo "Could not find makensisw.exe on PATH!"; echo "PATH=$PATH"; exit 1; }
4652

53+
echo "> cabal --version"
54+
cabal --version
55+
echo "> which haddock"
56+
which haddock
57+
echo "> haddock --version"
58+
haddock --version
59+
4760
# Make sure makensisw.exe is compiled with support for large strings
4861
# makensisw="/c/Program\ Files\ \(x86\)/NSIS/Orig/makensis //HDRINFO"
4962
nsis_max_strlen=`makensis //HDRINFO | grep 'NSIS_MAX_STRLEN' | awk '{ match($0, /NSIS_MAX_STRLEN=([0-9]+)/, x); if(x[1] != "") print x[1] }'`

0 commit comments

Comments
 (0)