language: objective-c
osx_image: xcode9.2

branches:
  only:
  - master

script:
- qmake mpc-qt.pro
- make -j2
- make install
- macdeployqt mpc-qt.app -libpath=/usr/local/lib/
- python macdeployqtfix/macdeployqtfix.py mpc-qt.app/Contents/MacOS/mpc-qt $(pkg-config --variable=prefix Qt5Gui) -v

before_install:
- brew update
- brew install pkgconfig
- brew install mpv
- brew install qt
- brew link qt --force
- brew install librsvg

install:
- git clone --branch v0.29.1 https://github.com/mpv-player/mpv.git
- cp mpv/libmpv/* $(pkg-config --variable=includedir mpv)/mpv/
- rm -rf mpv
- git clone https://github.com/arl/macdeployqtfix.git
- git fetch --unshallow
- ln -s /usr/local/opt/python/Frameworks/Python.framework /usr/local/opt/python/lib/

before_deploy:
- ls -al
- pip3 install dmgbuild
- dmgbuild -s make-release-mac.py "mpc-qt" mpc-qt.dmg

deploy:
  skip_cleanup: true
  on: master
  provider: bintray
  file: "bintray.json"
  user: alby128
  key:
    secure: "h1ZKUCkLilR6NDlrF73g1GHFFVCN2F8dDBnJNwiYaUPZT4znToZwZE8Qh2ukLaz2jjIr2d6fxN+jV1TLJPjq5v7HRsXEJZjy64Fp0OniO3SGpzEvnQZL+58RUwmQU0Y+VeBbDLmyu5wNrLbmXZnjeK1OcJYM1CV6qxHP+uQA5QCxkCqa4/MP5/rmpTRNu/iz0zQD1qSrqf0q61xCG+aJCnX6JhQvs4w1UXdU4Qy53OfAeI1kDq7Fwpoa+AxOMfXvnIy9Yo0igdi64s8e8klv+uaqJ/TvslFDslqbivNOZuXv1+wZCq+ac4npPtDMQZyWoBvMZ0U24LJ3e24en2OsRcQBXdaiTS1r4PAstVn7VjFWgbgzgGTBSKlqucGgxg0O3RsX+GiG1yHjsIJ9JF9AtBn9Awcy5NMJsOi9meLN+AgEOVtMIEVWDH8m5jMK+aCHYsm7tEBYcjFpTaYl3/t9EaPeqjKpOvUNSJDTfSnsuIXKp233GIiIDWbMXzLWCR8F1Ijk9FNTJqtJECpBpZOUiHkPN95NPxz98w0CW6rDYjJmZImNYpgflSQ4gzH2w3bfqgvJJqbrsa1imZqMzH+JrmlUFfmZAwNfPJOrKJbSUsZisH8CNvL4x4wHt7iOhZSsT6nO8idkDP0ukKpXJ0qbKluU2Fqfvl1nNIxRYFFkyQs="
