summaryrefslogtreecommitdiff
path: root/standalone/windows/build-simple.sh
blob: 65be712718c17d23157013e9374ffdce1f86a8c8 (plain)
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
# Script to build git-annex on windows. Run by build.bat

set -e
set -x

PATH="/c/Program Files/Git/cmd:/c/Program Files/NSIS:$PATH"

# Run a command with the cygwin environment available.
# However, programs not from cygwin are preferred.
withcyg () {
	PATH="$PATH:/c/cygwin/bin" "$@"
}
withcygpreferred () {
	PATH="/c/cygwin/bin:$PATH" "$@"
}

# 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.
if ! cabal install --only-dependencies; then
	cabal update || true
	cabal install --only-dependencies
fi

# Build git-annex
if [ ! -e "dist/setup-config" ]; then
	withcyg cabal configure
fi
if ! withcyg cabal build; then
	ghc --make Build/EvilLinker -fno-warn-tabs
	withcyg Build/EvilLinker
fi

# Build the installer
cabal install nsis
ghc --make Build/NullSoftInstaller.hs -fno-warn-tabs
PATH="$PATH:/cygdrive/c/Program Files/NSIS" Build/NullSoftInstaller.exe