From cfaf5b49cacd65bcba8e9b3057f3b202ef3b9343 Mon Sep 17 00:00:00 2001 From: Eduard Braun Date: Sun, 11 Jun 2017 16:08:31 +0200 Subject: CI on Windows using AppVeyor and MSYS2 --- appveyor.sh | 38 ++++++++++++++++++++++++++++++++++++++ appveyor.yml | 22 ++++++++++++++++++++++ msys2installdeps.sh | 20 ++++++++++++++------ 3 files changed, 74 insertions(+), 6 deletions(-) create mode 100644 appveyor.sh create mode 100644 appveyor.yml diff --git a/appveyor.sh b/appveyor.sh new file mode 100644 index 000000000..26d75571a --- /dev/null +++ b/appveyor.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" +mkdir build +cd build + + + +# Write an empty fonts.conf to speed up fc-cache +export FONTCONFIG_FILE=/dummy-fonts.conf +cat >"$FONTCONFIG_FILE" < + + +EOF + + + +# update/install dependecies +pacman -Suu --needed --noconfirm --noprogressbar +pacman -S $MINGW_PACKAGE_PREFIX-ccache --needed --noconfirm --noprogressbar +source ../msys2installdeps.sh + +# configure +ccache --max-size=200M +cmake .. -G Ninja -DCMAKE_C_COMPILER_LAUNCHER="ccache" -DCMAKE_CXX_COMPILER_LAUNCHER="ccache" + +# build +ccache --zero-stats +ninja +ccache --show-stats +ninja install + +# test +inkscape/inkscape.exe -V + +# package +7z a inkscape.7z inkscape diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 000000000..dd484b49e --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,22 @@ +version: '{branch}-{build}' + +branches: + only: + - master + +clone_depth: 10 + +environment: + matrix: + - MSYSTEM: MINGW64 + - MSYSTEM: MINGW32 + +build_script: + - C:\msys64\usr\bin\pacman -Syuu --needed --noconfirm --noprogressbar + - C:\msys64\usr\bin\bash --login -c "$(cygpath ${APPVEYOR_BUILD_FOLDER})/appveyor.sh" + +artifacts: + - path: build\inkscape.7z + +cache: + - C:\msys64\home\appveyor\.ccache diff --git a/msys2installdeps.sh b/msys2installdeps.sh index fd46e455c..e05411ea3 100755 --- a/msys2installdeps.sh +++ b/msys2installdeps.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# ------------------------------------------------------------------------------ -# This script installs all dependecies required for building Inkscape with MSYS2 +# ------------------------------------------------------------------------------- +# This script installs all dependencies required for building Inkscape with MSYS2 # execute it once on an MSYS shell, i.e. # - use the "MSYS2 MSYS" shortcut in the start menu or # - run "msys2.exe" in MSYS2's installation folder @@ -8,12 +8,20 @@ # MSYS2 and installed libraries can be updated later by executing # pacman -Syu --ignore=mingw-w64-*-imagemagick # in an MSYS shell -# ------------------------------------------------------------------------------ +# ------------------------------------------------------------------------------- # select if you want to build 32-bit (i686), 64-bit (x86_64), or both -#ARCH=mingw-w64-i686 -#ARCH=mingw-w64-x86_64 -ARCH={mingw-w64-i686,mingw-w64-x86_64} +case "$MSYSTEM" in + MINGW32) + ARCH=mingw-w64-i686 + ;; + MINGW64) + ARCH=mingw-w64-x86_64 + ;; + *) + ARCH={mingw-w64-i686,mingw-w64-x86_64} + ;; +esac # sync package databases pacman -Sy -- cgit v1.2.3