### ----------------------------------------------------
### -- SDL2
### -- Licenses: MIT
### -- Authors: Ahmad M. Zawawi
### -- File: .travis.yml
### ----------------------------------------------------
language: generic

os:
  - linux
  - osx

env:
  global:
    - export PATH="/opt/rakudo-pkg/bin:/opt/rakudo-pkg/share/perl6/site/bin:$PATH"
addons:
  apt:
    sources:
      - sourceline: 'deb https://dl.bintray.com/nxadm/rakudo-pkg-debs $(lsb_release -cs) main'
        key_url: 'http://keyserver.ubuntu.com/pks/lookup?search=0x379CE192D401AB61&op=get'
    packages:
      - rakudo-pkg

before_install:
    # Display OS name
  - echo $TRAVIS_OS_NAME

  # Debian-based libsdl2 installation
  # Fix weird unmet dependency when installing libsdl2-dev
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get -qq update                                 ; fi
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install libegl1-mesa-dev libgles2-mesa-dev ; fi
  - if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y libsdl2-dev                     ; fi

  # macOS rakudo-star and sdl2 installation
  - if [ "$TRAVIS_OS_NAME" == "osx"   ]; then brew update                              ; fi
  - if [ "$TRAVIS_OS_NAME" == "osx"   ]; then brew install rakudo-star sdl2 pkg-config ; fi

install:
  - zef install . && zef test . --verbose


