Skip to content

Commit

Permalink
AppVeyor: Add MSYS2 and Cygwin
Browse files Browse the repository at this point in the history
  • Loading branch information
k-takata committed Aug 8, 2015
1 parent 5b61749 commit 3d108cd
Show file tree
Hide file tree
Showing 4 changed files with 186 additions and 70 deletions.
17 changes: 13 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
version: 1.0.{build}

environment:
global:
MSYS2_BASEVER: 20150512

matrix:
- compiler: msbuild
- compiler: msvc
- compiler: mingw
#- compiler: msbuild
#- compiler: msvc
#- compiler: mingw
#- compiler: msys2
# MSYS2_ARCH: x86_64
- compiler: cygwin

build_script:
- 'win32\appveyor.bat'
- 'win32\appveyor-build.bat'

test_script:
- 'win32\appveyor-test.bat'
106 changes: 106 additions & 0 deletions win32/appveyor-build.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
@echo off
:: Batch file for building ctags on AppVeyor

if %compiler%==msbuild goto msbuild
if %compiler%==msvc goto msvc
if %compiler%==mingw goto mingw
if %compiler%==msys2 goto msys2
if %compiler%==cygwin goto cygwin
exit 1

:msbuild
:: Using VC12 with msbuild

:: Build ctags with msbuild, iconv disabled
cd %APPVEYOR_BUILD_FOLDER%\win32
@echo on
msbuild ctags_vs2013.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" /p:Configuration=Release
:: Check if it works
Release\ctags --version

@echo off
goto :eof


:msvc
:: Using VC12 with nmake
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x86
set "INCLUDE=%INCLUDE%;C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Include"

:: Build libiconv (MSVC port)
git clone -q --branch=master https://github.com/koron/libiconv.git C:\projects\libiconv
cd C:\projects\libiconv\msvc10
nmake NODEBUG=1 NOMSVCRT=1

:: Setup libiconv
cd C:\projects
mkdir iconv\include
mkdir iconv\lib
copy libiconv\msvc10\iconv.h iconv\include > nul
copy libiconv\msvc10\iconv.lib iconv\lib > nul
copy libiconv\msvc10\iconv.dll ctags > nul

:: Build ctags with nmake, iconv enabled
@echo on
cd %APPVEYOR_BUILD_FOLDER%
nmake -f mk_mvc.mak WITH_ICONV=yes ICONV_DIR=C:\projects\iconv
:: Check if it works
ctags --version

@echo off
goto :eof


:mingw
:: Using MinGW without autotools
path C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%path%
@echo on
make -f mk_mingw.mak
ctags --version

@echo off
goto :eof


:msys2
:: Using MSYS2
@echo on
appveyor DownloadFile "http://kent.dl.sourceforge.net/project/msys2/Base/%MSYS2_ARCH%/msys2-base-%MSYS2_ARCH%-%MSYS2_BASEVER%.tar.xz" -FileName "msys2.tar.xz"
c:\cygwin\bin\xz -dc msys2.tar.xz | c:\cygwin\bin\tar xf -

set MSYSTEM=MINGW64
PATH %APPVEYOR_BUILD_FOLDER%\msys64\%MSYSTEM%\bin;%APPVEYOR_BUILD_FOLDER%\msys64\usr\bin;%PATH%
set CHERE_INVOKING=yes
msys64\usr\bin\bash -lc ""
:: Install and update necessary packages
msys64\usr\bin\bash -lc "for i in {1..3}; do pacman --noconfirm --needed -Sy bash pacman pacman-mirrors msys2-runtime && break || sleep 15; done"
msys64\usr\bin\bash -lc "for i in {1..3}; do pacman --noconfirm -Su mingw-w64-%MSYS2_ARCH%-{gcc,libiconv} automake autoconf make && break || sleep 15; done"

msys64\usr\bin\bash -lc "autoreconf -vfi"
:: Patching configure.
:: Workaround for "./configure: line 557: 0: Bad file descriptor"
perl -i".bak" -pe "s/^test -n \".DJDIR\"/#$&/" configure
msys64\usr\bin\bash -lc "./configure --enable-iconv && make"
.\ctags --version
msys64\usr\bin\bash -lc "make check"

@echo off
goto :eof


:cygwin
:: Using Cygwin
@echo on
PATH c:\cygwin\bin;%PATH%
set CHERE_INVOKING=yes
c:\cygwin\bin\bash -lc ""
c:\cygwin\bin\bash -lc "autoreconf -vfi"
:: Patching configure.
:: Workaround for "./configure: line 557: 0: Bad file descriptor"
c:\cygwin\bin\perl -i".bak" -pe "s/^test -n \".DJDIR\"/#$&/" configure
c:\cygwin\bin\bash -lc "./configure --enable-iconv && make"
.\ctags --version
c:\cygwin\bin\bash -lc "make check"

@echo off
goto :eof
67 changes: 67 additions & 0 deletions win32/appveyor-test.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
@echo off
:: Batch file for testing ctags on AppVeyor

if %compiler%==msbuild goto msbuild
if %compiler%==msvc goto msvc
if %compiler%==mingw goto mingw
if %compiler%==msys2 goto msys2
if %compiler%==cygwin goto cygwin
exit 1

:msbuild
:: Using VC12 with msbuild
cd win32
@echo on
:: Check if it works
Release\ctags --version || exit 1

@echo off
goto :eof


:msvc
:: Using VC12 with nmake
@echo on
:: Check if it works
.\ctags --version || exit 1

@echo off
goto :eof


:mingw
:: Using MinGW without autotools
path C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%path%
@echo on
:: Check if it works
.\ctags --version || exit 1

@echo off
goto :eof


:msys2
:: Using MSYS2
@echo on
PATH %APPVEYOR_BUILD_FOLDER%\msys64\mingw64\bin;%APPVEYOR_BUILD_FOLDER%\msys64\usr\bin;%PATH%
set CHERE_INVOKING=yes
set MSYSTEM=MINGW64
:: Check if it works
.\ctags --version || exit 1
msys64\usr\bin\bash -lc "make check"

@echo off
goto :eof


:cygwin
:: Using Cygwin
@echo on
PATH c:\cygwin\bin;%PATH%
set CHERE_INVOKING=yes
:: Check if it works
.\ctags --version
c:\cygwin\bin\bash -lc "make check"

@echo off
goto :eof
66 changes: 0 additions & 66 deletions win32/appveyor.bat

This file was deleted.

0 comments on commit 3d108cd

Please sign in to comment.