Commit 4c88fd7ce6a385fa313e93d4e1f594f29ccf1a36

Tony Kelman 2015-03-04T11:31:24

Add MinGW-w64 to matrix cache mingw-w64 downloads quiet curl and 7zip run appveyor steps in cmd for mingw

diff --git a/appveyor.yml b/appveyor.yml
index 5358bec..647ef16 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -13,6 +13,13 @@ environment:
     ARCH: 64
   - GENERATOR: "MSYS Makefiles"
     ARCH: 32
+  - GENERATOR: "MSYS Makefiles"
+    ARCH: i686 # this is for 32-bit MinGW-w64
+  - GENERATOR: "MSYS Makefiles"
+    ARCH: 64
+cache:
+- i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z
+- x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z
 build_script:
 - ps: |
     if ($env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:APPVEYOR_BUILD_NUMBER -ne ((Invoke-RestMethod `
@@ -24,8 +31,8 @@ build_script:
     if ($env:GENERATOR -ne "MSYS Makefiles") {
       cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON .. -G"$env:GENERATOR"
       cmake --build . --config RelWithDebInfo
-    } else {
-      C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh
     }
+- cmd: |
+    if "%GENERATOR%"=="MSYS Makefiles" (C:\MinGW\msys\1.0\bin\sh --login /c/projects/libgit2/script/appveyor-mingw.sh)
 test_script:
 - ps: ctest -V .
diff --git a/script/appveyor-mingw.sh b/script/appveyor-mingw.sh
index aaafa49..48e0bad 100755
--- a/script/appveyor-mingw.sh
+++ b/script/appveyor-mingw.sh
@@ -1,6 +1,23 @@
 #!/bin/sh
 set -e
-cd `dirname "$0"`/../build
-echo 'C:\MinGW\ /MinGW' > /etc/fstab
+cd `dirname "$0"`/..
+if [ "$ARCH" = "32" ]; then
+  echo 'C:\MinGW\ /MinGW' > /etc/fstab
+elif [ "$ARCH" = "i686" ]; then
+  f=i686-4.9.2-release-win32-sjlj-rt_v3-rev1.7z
+  if ! [ -e $f ]; then
+    curl -LsSO http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-win32/sjlj/$f
+  fi
+  7z x $f > /dev/null
+  mv mingw32 /MinGW
+else
+  f=x86_64-4.9.2-release-win32-seh-rt_v3-rev1.7z
+  if ! [ -e $f ]; then
+    curl -LsSO http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/4.9.2/threads-win32/seh/$f
+  fi
+  7z x $f > /dev/null
+  mv mingw64 /MinGW
+fi
+cd build
 cmake -D ENABLE_TRACE=ON -D BUILD_CLAR=ON .. -G"$GENERATOR"
 cmake --build . --config RelWithDebInfo