From 1c77f360dd64fc7f5398a42c61cc8a33e25bed94 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Trouche?= Date: Mon, 28 May 2018 21:48:08 +0200 Subject: [PATCH] First test for AppVeyor's MSYS2 build --- appveyor.yml | 30 ++++++++++++++++++++++++++++++ goffice/math/go-math.h | 8 +++++++- share/appveyor-build.sh | 29 +++++++++++++++++++++++++++++ share/appveyor-install.sh | 24 ++++++++++++++++++++++++ 4 files changed, 90 insertions(+), 1 deletion(-) create mode 100644 appveyor.yml create mode 100644 share/appveyor-build.sh create mode 100644 share/appveyor-install.sh diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..95caa0241 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,30 @@ +version: 1.0.{build} +image: Visual Studio 2017 +clone_folder: c:\projects\src +# Do not build on tags +skip_tags: true +init: +- cmd: >- + c:\msys64\usr\bin\bash -lc "echo MSYSTEM=%MSYSTEM% > /appveyor.environment" +environment: + matrix: + - MSYSTEM: MINGW32 + - MSYSTEM: MINGW64 +install: +- cmd: >- + c:\msys64\usr\bin\bash -lc "cd /c/projects/src/share && ./appveyor-install.sh" + +build_script: +- cmd: c:\msys64\usr\bin\bash -lc "cd /c/projects/src/share && ./appveyor-build.sh" + +deploy: +- provider: GitHub + release: v$(appveyor_build_version) + auth_token: + secure: sZu+i3QuPeW93JlxEBOJ7E1WYsAZQtIsOHVjzftLxkBvBKX/9Akt4GRYUdQWK3/Z + artifact: goffice + draft: false + prerelease: true + on: + branch: + - msys2 diff --git a/goffice/math/go-math.h b/goffice/math/go-math.h index e7d7f2271..7e34ec0a1 100644 --- a/goffice/math/go-math.h +++ b/goffice/math/go-math.h @@ -112,10 +112,16 @@ long double modfl (long double x, long double *iptr); #endif -#ifdef _MSC_VER +/* testing GOFFICE_WITH_WINREG to check if we are using Windows (MSYS2) */ +#if _MSC_VER #define isnan _isnan #endif + #if (GOFFICE_WITH_WINREG==1) + # define isnanl _isnan + #endif + + /* ------------------------------------------------------------------------- */ G_END_DECLS diff --git a/share/appveyor-build.sh b/share/appveyor-build.sh new file mode 100644 index 000000000..d0e21af82 --- /dev/null +++ b/share/appveyor-build.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +source /appveyor.environment +export MSYSTEM + +cd /c/projects/src +./autogen.sh + +./configure --prefix /inst/ + +v=$(grep goffice_full_version config.h | cut -f2 -d '"') +v="$v-$(date +'%Y.%m.%d-%H')" +powershell.exe -command "Update-AppveyorBuild -Version \"$v\"" +echo "Version=$v" + +make -j 2 +make install + +if [ $MSYSTEM = "MINGW32" ]; then + bits="32bit" +else + bits="64bit" +fi + +fn="goffice-$bits-$v-archive.zip" + +zip -9r $fn /inst/* + +powershell.exe -command "Push-AppveyorArtifact \"$fn\" -DeploymentName \"goffice\"" diff --git a/share/appveyor-install.sh b/share/appveyor-install.sh new file mode 100644 index 000000000..dcbad2859 --- /dev/null +++ b/share/appveyor-install.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +source /appveyor.environment +export MSYSTEM + +if test "$MSYSTEM"x == "MINGW64"x; then + i_pkg_postfix="w64-x86_64" +else + i_pkg_postfix="w64-i686" +fi + +pacman -S --noconfirm glib2 +pacman -S --noconfirm zip +pacman -S --noconfirm glib2-devel +# pacman -S --noconfirm mingw-w64-glib-networking +# pacman -S --noconfirm mingw-w64-gdk-pixbuf2 +pacman -S --noconfirm mingw-$i_pkg_postfix-gtkmm3 +pacman -S --noconfirm mingw-$i_pkg_postfix-libgsf +pacman -S --noconfirm mingw-$i_pkg_postfix-libxml2 +pacman -S --noconfirm mingw-$i_pkg_postfix-pango +pacman -S --noconfirm mingw-$i_pkg_postfix-pangocairo +pacman -S --noconfirm mingw-$i_pkg_postfix-cairo +pacman -S --noconfirm mingw-$i_pkg_postfix-libxslt +pacman -S --noconfirm gtk-doc