2013-12-06 00:40:28 +00:00
|
|
|
#!/bin/sh
|
|
|
|
# Script to build git-annex on windows. Run by build.bat
|
|
|
|
|
|
|
|
set -e
|
2013-12-06 01:02:27 +00:00
|
|
|
set -x
|
2013-12-06 00:40:28 +00:00
|
|
|
|
2015-04-21 05:01:16 +00:00
|
|
|
# Path to the Haskell Platform. (As mingw sh sees it)
|
|
|
|
HP="/c/Program Files/Haskell Platform/2014.2.0.0"
|
2013-12-06 00:40:28 +00:00
|
|
|
|
2015-04-21 17:59:04 +00:00
|
|
|
PATH="$HP/bin:$HP/mingw/bin:$HP/lib/extralibs/bin:/c/Program Files/Git/cmd:/c/Program Files/NSIS:$PATH"
|
2013-12-06 00:40:28 +00:00
|
|
|
|
|
|
|
# Run a command with the cygwin environment available.
|
|
|
|
# However, programs not from cygwin are preferred.
|
|
|
|
withcyg () {
|
|
|
|
PATH="$PATH:/c/cygwin/bin" "$@"
|
|
|
|
}
|
2013-12-11 15:23:34 +00:00
|
|
|
withcygpreferred () {
|
|
|
|
PATH="/c/cygwin/bin:$PATH" "$@"
|
|
|
|
}
|
2013-12-06 00:40:28 +00:00
|
|
|
|
|
|
|
# Install haskell dependencies.
|
|
|
|
# cabal install is not run in cygwin, because we don't want configure scripts
|
|
|
|
# for haskell libraries to link them with the cygwin library.
|
2015-04-21 18:10:30 +00:00
|
|
|
if ! cabal install --only-dependencies; then
|
|
|
|
cabal update || true
|
|
|
|
cabal install --only-dependencies
|
|
|
|
fi
|
2013-12-06 00:40:28 +00:00
|
|
|
|
|
|
|
# Build git-annex
|
2013-12-07 01:12:47 +00:00
|
|
|
if [ ! -e "dist/setup-config" ]; then
|
|
|
|
withcyg cabal configure
|
|
|
|
fi
|
2013-12-09 19:38:57 +00:00
|
|
|
if ! withcyg cabal build; then
|
|
|
|
ghc --make Build/EvilLinker
|
|
|
|
withcyg Build/EvilLinker
|
|
|
|
fi
|
2013-12-10 04:45:21 +00:00
|
|
|
|
|
|
|
# Build the installer
|
|
|
|
cabal install nsis
|
|
|
|
ghc --make Build/NullSoftInstaller.hs
|
|
|
|
PATH="$PATH:/cygdrive/c/Program Files/NSIS"
|
2013-12-11 15:23:34 +00:00
|
|
|
# Want to include cygwin programs in bundle, not others, since
|
|
|
|
# it includes the cygwin libs that go with them.
|
|
|
|
withcygpreferred Build/NullSoftInstaller.exe
|