# Freetype GL - A C OpenGL Freetype engine
#
# Distributed under the OSI-approved BSD 2-Clause License.  See accompanying
# file `LICENSE` for more details.
language: c
dist: trusty
compiler:
  - gcc
before_install:
# GLFW requires a working X11 display and makefont uses GLFW.
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
install:
# Update system
  - sudo apt-get update -qq
# Install dependencies
  - sudo apt-get install -qq cmake g++-4.8 gcc-4.8 libglew-dev libfreetype6-dev doxygen libharfbuzz-dev libxmu-dev libxi-dev libxrandr-dev libxinerama-dev libxcursor-dev
# Prepare manual installation of dependencies
  - mkdir TRAVIS_TMP/ && cd TRAVIS_TMP
# GLFW 3.1.1 install
  - wget -O glfw-3.2.1.zip https://github.com/glfw/glfw/archive/3.2.1.zip
  - unzip glfw-3.2.1.zip
  - cd glfw-3.2.1
  - cmake -DBUILD_SHARED_LIBS=ON -DGLFW_BUILD_EXAMPLES=OFF -DGLFW_BUILD_TESTS=OFF -DGLFW_BUILD_DOCS=OFF -DCMAKE_INSTALL_PREFIX=/usr -DLIB_SUFFIX=/x86_64-linux-gnu
  - make
  - sudo make install
  - cd ..
# AntTweakBar install
  - wget -O AntTweakBar_116.zip http://sourceforge.net/projects/anttweakbar/files/latest/download?source=dlp
  - unzip AntTweakBar_116.zip
  - cd AntTweakBar/src
# And as it uses C++ ... we need to link with g++, but this Makefile's version doesn't !
# So we modify the makefile with sed !
  - sed -i "s/LINK     	= gcc/LINK     	= g++/" Makefile
  - make
  - sudo mv ../lib/libAntTweakBar.so /usr/lib/
  - sudo mv ../lib/libAntTweakBar.so.1 /usr/lib/
  - sudo mv ../include/* /usr/include/
  - cd ../../
  - rm -rf AntTweakBar_116.zip
  - rm -rf AntTweakBar
#
  - cd ..
before_script:
  - cmake -Dfreetype-gl_BUILD_HARFBUZZ=ON . && make
script:
  - ctest --output-on-failure
