2013-05-17 15:38:29 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# This script is run by the jenkins autobuilder, in a mingw environment,
|
|
|
|
# to build git-annex for Windows.
|
|
|
|
|
|
|
|
set -x
|
|
|
|
set -e
|
|
|
|
|
2013-05-17 16:03:20 +00:00
|
|
|
HP="/c/Program Files (x86)/Haskell Platform/2012.4.0.0"
|
2013-05-17 16:31:19 +00:00
|
|
|
FLAGS="-Webapp -Assistant -XMPP"
|
2013-05-17 16:03:20 +00:00
|
|
|
|
2013-05-17 18:06:47 +00:00
|
|
|
PATH="$HP/bin:$HP/lib/extralibs/bin:/c/Program Files (x86)/NSIS:$PATH"
|
2013-05-17 15:38:29 +00:00
|
|
|
|
2013-05-17 20:56:00 +00:00
|
|
|
# Run a command with the cygwin environment available.
|
|
|
|
# However, programs not from cygwin are preferred.
|
|
|
|
withcyg () {
|
|
|
|
PATH="$PATH:/c/cygwin/bin" "$@"
|
2013-05-17 15:38:29 +00:00
|
|
|
}
|
|
|
|
|
2013-05-17 20:35:35 +00:00
|
|
|
# Don't allow build artifact from a past successfuly build to be extracted
|
|
|
|
# if we fail.
|
|
|
|
rm -f git-annex-installer.exe
|
|
|
|
|
2013-05-17 16:31:19 +00:00
|
|
|
# Install haskell dependencies.
|
2013-05-17 15:38:29 +00:00
|
|
|
# cabal install is not run in cygwin, because we don't want configure scripts
|
|
|
|
# for haskell libraries to link them with the cygwin library.
|
2013-05-17 17:10:41 +00:00
|
|
|
cabal update
|
|
|
|
|
|
|
|
rm -rf MissingH-1.2.0.0
|
|
|
|
cabal unpack MissingH
|
|
|
|
cd MissingH-1.2.0.0
|
2013-05-17 20:56:00 +00:00
|
|
|
withcyg patch -p1 <../standalone/windows/haskell-patches/MissingH_1.2.0.0-0001-hack-around-strange-build-problem-in-jenkins-autobui.patch
|
2013-05-17 17:16:21 +00:00
|
|
|
cabal install || true
|
2013-05-17 17:10:41 +00:00
|
|
|
cd ..
|
|
|
|
|
2013-05-17 15:38:29 +00:00
|
|
|
cabal install --only-dependencies -f"$FLAGS"
|
2013-05-17 16:31:19 +00:00
|
|
|
|
|
|
|
# Build git-annex
|
2013-05-17 20:56:00 +00:00
|
|
|
withcyg cabal configure -f"$FLAGS"
|
|
|
|
withcyg cabal build
|
2013-05-17 15:38:29 +00:00
|
|
|
|
|
|
|
# Build the installer
|
|
|
|
cabal install nsis
|
|
|
|
ghc --make Build/NullSoftInstaller.hs
|
2013-05-17 20:56:00 +00:00
|
|
|
withcyg Build/NullSoftInstaller.exe
|
2013-05-17 20:34:19 +00:00
|
|
|
|
|
|
|
# Test git-annex
|
2013-05-17 20:56:00 +00:00
|
|
|
withcyg dist/build/git-annex/git-annex.exe test
|