language: cpp
matrix:
  include:
    - os: linux
      dist: trusty
      sudo: false
      compiler: gcc
    - os: osx
      compiler: clang
env:
      global:
           - secure: "pOICMBtfwljj450Vht1D2/XvtUm07edkbiUI0+PCnfuwiwBFJyqY919whZu+CrplQvkVS+RzvxT3wpgkVccflo0uvNJ7NwfKksRqrUKwTp59nGIwjUsnDjI3YkxOQyxIdIPsSm3bUxXVy/Jge0v6vzvbbPXKxyAxKsupnUBYOwM="
           - OMP_NUM_THREADS=4
           - VERBOSE=1
before_script:
  - mkdir -p  build
  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then (git clone git://github.com/erikd/libsndfile.git && cd libsndfile && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$HOME .. && make && make install); fi
script:
  - "[ ${COVERITY_SCAN_BRANCH} == 1 ] || (cd $TRAVIS_BUILD_DIR/build && cmake .. -DCMAKE_INCLUDE_PATH=$HOME/include -DCMAKE_LIBRARY_PATH=$HOME/lib -DBUILD_STATIC_LIBRARY=ON -DBUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=$HOME && make && make test && make regression && make csdtests)"
#  - echo -en "building tar package"
#  - make install 
#  - cd $HOME
#  - export PACKAGE_NAME=csound-$TRAVIS_OS_NAME-build
#  - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then cp -r $HOME/Library/Frameworks/ $HOME/lib; fi
#  - tar czf $PACKAGE_NAME.tgz ./bin ./lib ./include
###

addons:
      coverity_scan:
          project:
              name: "csound/csound"
              description: "A user-programmable and user-extensible sound processing language and software synthesizer"
          notification_email: CSOUND-DEV@listserv.heanet.ie
          build_command_prepend: "mkdir -p $TRAVIS_BUILD_DIR/build && cd $TRAVIS_BUILD_DIR/build && cmake .."
          build_command: "make -C $TRAVIS_BUILD_DIR/build"
          branch_pattern: coverity_scan
      apt:
          packages:
              - cmake
              - libsndfile1-dev
              - libasound2-dev
              - libjack-dev
              - portaudio19-dev
              - libportmidi-dev
              - libpulse-dev
              - swig
              - liblua5.1-0-dev
              - python-dev
              - puredata-dev
              - default-jdk
              - libfltk1.1-dev
              - libfluidsynth-dev
              - liblo-dev
              - fluid
              - ladspa-sdk
              - libpng-dev
              - dssi-dev
              - libstk0-dev
              - libgmm++-dev
              - bison
              - flex
              - libportsmf-dev
              - libeigen3-dev
              - libcunit1-dev
              - python-tk

notifications:
      email:
          recipients:
              - CSOUND-DEV@listserv.heanet.ie

#deploy:
#  overwrite: true
#  skip_cleanup: true
#  provider: releases
#  api_key:
#    secure: 
#  file: $HOME/csound-$TRAVIS_OS_NAME-build.tgz
#  on:
#    repo: csound/csound
#    branch: feature/realtime