From efe253c94f165622caf9311284a7c35740742a6b Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Wed, 22 Jan 2020 15:56:10 -0500 Subject: macOS support --- .travis.yml | 47 +++++++++++++++++++++++++++++++---------------- appveyor.yml | 10 +++++----- appveyor/build.bat | 16 ---------------- scripts/appveyor.bat | 16 ++++++++++++++++ scripts/travis.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 102 insertions(+), 37 deletions(-) delete mode 100644 appveyor/build.bat create mode 100644 scripts/appveyor.bat create mode 100644 scripts/travis.sh diff --git a/.travis.yml b/.travis.yml index aafbbd1..2316d05 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,21 +1,23 @@ language: cpp +os: + - linux + - osx sudo: require -dist: trusty +dist: xenial +compiler: + - gcc +osx_image: xcode10.2 before_install: - - sudo apt-get install libtag1-dev qt5-qmake libqt5x11extras5-dev qt5-default qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev libgtk2.0-dev + - export STAGE=before_install + - ./travis.sh script: - - qmake - - make -j$(nproc) - - make install INSTALL_ROOT=appdir -j$(nproc) install ; find appdir/ - - wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" - - chmod a+x linuxdeployqt-continuous-x86_64.AppImage - - "./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -bundle-non-qt-libs" - - "./linuxdeployqt-continuous-x86_64.AppImage appdir/usr/share/applications/*.desktop -appimage" + - export STAGE=script + - ./travis.sh + after_success: - - find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq - - wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh - - bash upload.sh AleePlayer*.AppImage* + - export STAGE=after_success + - ./travis.sh - wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh - chmod +x send.sh - ./send.sh success $WEBHOOK_URL @@ -23,10 +25,23 @@ after_failure: - wget https://raw.githubusercontent.com/k3rn31p4nic/travis-ci-discord-webhook/master/send.sh - chmod +x send.sh - ./send.sh failure $WEBHOOK_URL - -compiler: - - gcc -dist: xenial + + +addons: + homebrew: + taps: + - kde-mac/kde + packages: + - qt5 + - gstreamer + - gst-plugins-good + - gst-plugins-bad + - gst-plugins-ugly + - cmake + - libmusicbrainz + - taglib + - kf5-extra-cmake-modules + update: true branches: except: diff --git a/appveyor.yml b/appveyor.yml index bf9acb2..e4d7951 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -17,7 +17,7 @@ environment: build_script: - cmd: >- - appveyor\build.bat + scripts\appveyor.bat test: off artifacts: @@ -29,10 +29,10 @@ before_deploy: - ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/deploy.ps1')) -deploy_script: -- ps: >- +#deploy_script: +#- ps: >- - Start-FileDownload 'https://github.com/probonopd/uploadtool/raw/master/upload.sh' +# Start-FileDownload 'https://github.com/probonopd/uploadtool/raw/master/upload.sh' - sh -c "TRAVIS_BRANCH=$env:APPVEYOR_REPO_BRANCH TRAVIS_COMMIT=$env:APPVEYOR_REPO_BRANCH ./upload.sh /c/projects/AleePlayer/AleePlayer-Windows.zip 2>/dev/null" +# sh -c "TRAVIS_BRANCH=$env:APPVEYOR_REPO_BRANCH TRAVIS_COMMIT=$env:APPVEYOR_REPO_BRANCH ./upload.sh /c/projects/AleePlayer/AleePlayer-Windows.zip 2>/dev/null" diff --git a/appveyor/build.bat b/appveyor/build.bat deleted file mode 100644 index 7d3c32f..0000000 --- a/appveyor/build.bat +++ /dev/null @@ -1,16 +0,0 @@ -if "%APPVEYOR_REPO_TAG_NAME%"=="continuous" ( - - exit 1 - -) - -set QTDIR=C:\Qt\5.12\msvc2017_64 -set PATH=%PATH%;%QTDIR%\bin -call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" - -qmake AleePlayer.pro "CONFIG+=release" -nmake release -mkdir deploy -copy release\AleePlayer.exe deploy -cd deploy -windeployqt AleePlayer.exe -multimedia diff --git a/scripts/appveyor.bat b/scripts/appveyor.bat new file mode 100644 index 0000000..7d3c32f --- /dev/null +++ b/scripts/appveyor.bat @@ -0,0 +1,16 @@ +if "%APPVEYOR_REPO_TAG_NAME%"=="continuous" ( + + exit 1 + +) + +set QTDIR=C:\Qt\5.12\msvc2017_64 +set PATH=%PATH%;%QTDIR%\bin +call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat" + +qmake AleePlayer.pro "CONFIG+=release" +nmake release +mkdir deploy +copy release\AleePlayer.exe deploy +cd deploy +windeployqt AleePlayer.exe -multimedia diff --git a/scripts/travis.sh b/scripts/travis.sh new file mode 100644 index 0000000..457848f --- /dev/null +++ b/scripts/travis.sh @@ -0,0 +1,50 @@ +if [ $STAGE = "script" ]; then + if [ $TRAVIS_OS_NAME = "linux" ]; then + echo "[TRAVIS] Running qmake" + qmake + echo "[TRAVIS] Building project" + make + echo "[TRAVIS] Installing into appdir" + make install INSTALL_ROOT=~/appdir + echo "[TRAVIS] Getting linuxdeployqt" + wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" + chmod a+x linuxdeployqt-continuous-x86_64.AppImage + echo "[TRAVIS] Building AppImage" + ./linuxdeployqt-continuous-x86_64.AppImage ~/appdir/usr/share/applications/*.desktop -appimage + else + echo "[TRAVIS] Building for macOS" + export PATH="/usr/local/opt/qt/bin:$PATH" + export PKG_CONFIG_PATH="/usr/local/opt/libffi/lib/pkgconfig" + export CURRENT_BREW_QT_VERSION="5.13.0" + export CURRENT_BREW_GSTREAMER_VERSION="1.16.0_1" + cd .. + mkdir "build-aleeplayer" + cd "build-aleeplayer" + echo "[TRAVIS] Running qmake" + qmake "INCLUDEPATH += /usr/local/opt/qt/include" "LIBS += -L/usr/local/opt/qt/lib" ../AleePlayer/AleePlayer.pro + echo "[TRAVIS] Building project" + make + echo "[TRAVIS] Deploying Qt Libraries" + macdeployqt AleePlayer.app + + fi +elif [ $STAGE = "before_install" ]; then + if [ $TRAVIS_OS_NAME = "linux" ]; then + sudo apt-get install libtag1-dev qt5-qmake libqt5x11extras5-dev qt5-default qttools5-dev-tools libqt5svg5-dev qtmultimedia5-dev libgtk2.0-dev + else + echo "[TRAVIS] Preparing to build for macOS" + fi +elif [ $STAGE = "after_success" ]; then + if [ $TRAVIS_OS_NAME = "linux" ]; then + echo "[TRAVIS] Publishing AppImage" + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + cp AleePlayer*.AppImage AleePlayer-linux.AppImage + cp AleePlayer*.AppImage.zsync AleePlayer-linux.AppImage.zsync + bash upload.sh AleePlayer-linux.AppImage* + else + echo "[TRAVIS] Publishing Disk Image" + cd ~ + wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh + bash upload.sh AleePlayer-macOS.dmg + fi +fi -- cgit v1.2.3