# Not building with API because piqi does not compile on windows

platform:
  - x86

environment:
  CYG_ROOT: C:/cygwin
  CYG_BASH: '%CYG_ROOT%/bin/bash -lc'

install:
  - '%CYG_ROOT%\setup-x86.exe -qnNdO -R %CYG_ROOT% -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P rsync -P patch -P diffutils -P unzip -P m4 -P mingw64-x86_64-gcc-core -P mingw64-x86_64-gtk2.0'
  - '%CYG_BASH% "curl -fsSL -o opam64.tar.xz https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.1/opam64.tar.xz"'
  - '%CYG_BASH% "tar -xf opam64.tar.xz"'
  - '%CYG_BASH% "opam64/install.sh"'
  - '%CYG_BASH% "opam init -a mingw https://github.com/fdopen/opam-repository-mingw.git --comp 4.05.0+mingw64c --switch 4.05.0+mingw64c"'
  - '%CYG_BASH% "eval `opam config env`"'
  - '%CYG_BASH% "opam install -y depext depext-cygwinports"'
  - 'set PATH=%PATH%;/usr/x86_64-w64-mingw32/sys-root/mingw/bin'
  - 'set OPAMYES=1'
  - '%CYG_BASH% "opam install camlp5 ocamlfind"'

build_script:
  - '%CYG_BASH% "cd ${APPVEYOR_BUILD_FOLDER} && ./configure && make && make distrib && make clean"'
