From 4d3c134b4aa0f250d0beaa57988d07a2cbff9b13 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 5 Dec 2013 20:40:28 -0400 Subject: [PATCH] windows build foo --- build.bat | 1 + doc/install/Windows.mdwn | 7 ++++--- standalone/windows/build-simple.sh | 31 ++++++++++++++++++++++++++++++ 3 files changed, 36 insertions(+), 3 deletions(-) create mode 100644 build.bat create mode 100644 standalone/windows/build-simple.sh diff --git a/build.bat b/build.bat new file mode 100644 index 0000000000..66a7e1f06d --- /dev/null +++ b/build.bat @@ -0,0 +1 @@ +C:\MINGW\MSYS\1.0\BIN\SH.EXE standalone/windows/build-simple.sh diff --git a/doc/install/Windows.mdwn b/doc/install/Windows.mdwn index 74017d6996..edfbb0234c 100644 --- a/doc/install/Windows.mdwn +++ b/doc/install/Windows.mdwn @@ -29,6 +29,7 @@ the Haskell Platform, Mingw, and Cygwin. Use Cygwin to install gcc, rsync, git, wget, ssh, and gnupg. To build the git-annex installer, you also need to install the NulSoft installer system. -There is a shell script `standalone/windows/build.sh` that can be -used to build git-annex. Note that this shell script cannot be run -in Cygwin; run it with the Mingw sh. + cabal update + cabal unpack git-annex -d gitannex + cd gitannex + build diff --git a/standalone/windows/build-simple.sh b/standalone/windows/build-simple.sh new file mode 100644 index 0000000000..93dfa2952f --- /dev/null +++ b/standalone/windows/build-simple.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Script to build git-annex on windows. Run by build.bat + +set -e + +# Path to the Haskell Platform. +HP="/c/Program Files (x86)/Haskell Platform/2012.4.0.0" + +PATH="$HP/bin:$HP/lib/extralibs/bin:/c/Program Files (x86)/NSIS:$PATH" + +# Run a command with the cygwin environment available. +# However, programs not from cygwin are preferred. +withcyg () { + PATH="$PATH:/c/cygwin/bin" "$@" +} + +# 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. +cabal install --only-dependencies || true + +# Build git-annex +withcyg cabal configure +withcyg cabal build || true + +# Works around link failure https://ghc.haskell.org/trac/ghc/ticket/8596 +# using a response file. +rm -f build.log gcc.opt +withcyg cabal build --ghc-options='-v -keep-tmp-files' > build.log 2>&1 +grep '"dist\\build\\git-annex\\git-annex.exe"' build.log | sed -e 's/^"[^"]*" //' -e 's/\\/\//g' > gcc.opt +"$HP/mingw/bin/gcc.exe" @gcc.opt