From 737b5ae04ae623f3481b3dbd367aba0bb24f154d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Philipp=20H=C3=B6rist?= <philipp@hoerist.com>
Date: Thu, 25 Jan 2018 18:36:12 +0100
Subject: [PATCH] Fix Windows build

---
 appveyor.yml | 35 +++++++++++++++--------------------
 win/_base.sh |  2 --
 win/build.sh |  8 --------
 3 files changed, 15 insertions(+), 30 deletions(-)

diff --git a/appveyor.yml b/appveyor.yml
index e359406925..1750d46d67 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,7 +1,6 @@
 environment:
-
   matrix:
-    - MSYS: "C:\\msys64\\mingw32.exe"
+    - MSYS: C:/msys64/mingw32
 
 branches:
   only:
@@ -15,24 +14,20 @@ clone_depth: 1
 install:
 
   - ps: |
-      function bash($command) {
-        Write-Host $command -NoNewline
-        cmd /c start /wait C:\msys64\usr\bin\sh.exe --login -c $command
-        Write-Host " - OK" -ForegroundColor Green
-      }
-
-      bash 'pacman -Sy --noconfirm git'
-      bash 'git clone C:/projects/gajim C:/msys64/home/appveyor/gajim'
-  
-  - cmd: '%MSYS% C:/msys64/home/appveyor/gajim/win/build.sh'
-  # Ugly workaround, because i found no way to tell when mingw32.exe returns
-  - cmd: timeout 1100
-
-  # Push Installer Exe
-  - ps: $env:TIME_STRING=(get-date -UFormat "%Y-%m-%d").ToString()
-  - ps: $env:BUILDROOT="C:\msys64\home\appveyor\gajim\win\_build_root"
-  - ps: Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-Master-$($env:TIME_STRING).exe"
-  - ps: Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-Master-$($env:TIME_STRING).exe"
+        $env:MSYSTEM="MINGW32"
+        $env:TIME_STRING=(get-date -UFormat "%Y-%m-%d").ToString()
+        $env:BUILDROOT="C:\msys64\home\appveyor\gajim\win\_build_root"
+
+        function bash($command) {
+          Write-Host $command -NoNewline
+          C:\msys64\usr\bin\sh.exe --login -c $command
+        }
+
+        bash 'pacman -Sy --noconfirm git'
+        bash 'git clone C:/projects/gajim C:/msys64/home/appveyor/gajim'
+        bash 'C:/msys64/home/appveyor/gajim/win/build.sh'
+        Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim.exe" -FileName "Gajim-Master-$($env:TIME_STRING).exe"
+        Push-AppveyorArtifact "$($env:BUILDROOT)/Gajim-Portable.exe" -FileName "Gajim-Portable-Master-$($env:TIME_STRING).exe"
 
 build: off
 
diff --git a/win/_base.sh b/win/_base.sh
index 14bddb8052..adfaf27d91 100644
--- a/win/_base.sh
+++ b/win/_base.sh
@@ -164,9 +164,7 @@ function cleanup_install {
         mingw-w64-"${ARCH}"-"${PYTHON_ID}"-pip mingw-w64-"${ARCH}"-ncurses || true
     build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tk || true
     build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-tcl || true
-    build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gnome-common || true
     build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-gsl || true
-    build_pacman --noconfirm -Rdd mingw-w64-"${ARCH}"-libvpx || true
 
     #delete translations we don't support
     for d in "${MINGW_ROOT}"/share/locale/*/LC_MESSAGES; do
diff --git a/win/build.sh b/win/build.sh
index 61e3e44200..3b1dad3928 100644
--- a/win/build.sh
+++ b/win/build.sh
@@ -12,14 +12,6 @@ source "$DIR"/_base.sh
 function main {
     local GIT_TAG=${1:-"master"}
 
-    [[ -d "${BUILD_ROOT}" ]] && (echo "${BUILD_ROOT} already exists"; exit 1)
-
-    # started from the wrong env -> switch
-    if [ $(echo "$MSYSTEM" | tr '[A-Z]' '[a-z]') != "$MINGW" ]; then
-        "/${MINGW}.exe" "$0"
-        exit $?
-    fi
-
     install_pre_deps
     create_root
     install_deps
-- 
GitLab