From 0e9e93e14e46031b1ad790aa4154be6bf1f51622 Mon Sep 17 00:00:00 2001 From: Vadim Markovtsev Date: Tue, 11 Oct 2016 23:52:47 +0200 Subject: [PATCH] [WIP] macOS Travis / #2553 --- .travis.linux | 26 ++++++++++++++++++++++++++ .travis.osx | 17 +++++++++++++++++ .travis.yml | 50 ++++++++++++++++++++------------------------------ CMakeLists.txt | 2 +- 4 files changed, 64 insertions(+), 31 deletions(-) create mode 100644 .travis.linux create mode 100644 .travis.osx diff --git a/.travis.linux b/.travis.linux new file mode 100644 index 000000000..fa0a8c70e --- /dev/null +++ b/.travis.linux @@ -0,0 +1,26 @@ +#!/bin/sh + +#new Clang +sudo add-apt-repository --yes ppa:h-rayflood/llvm + +#new SDL2 +sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots + +#new Qt +sudo add-apt-repository --yes ppa:beineri/opt-qt57-trusty + +#new CMake +sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x + +sudo apt-get update -qq + +sudo apt-get install -qq $SUPPORT +sudo apt-get install -qq $PACKAGE +sudo apt-get install -qq cmake libboost1.54-all-dev zlib1g-dev +sudo apt-get install -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev +sudo apt-get install -qq libavformat-dev libswscale-dev +sudo apt-get install -qq qt57declarative + +#setup compiler +source /opt/qt57/bin/qt57-env.sh +export CC=${REAL_CC} CXX=${REAL_CXX} \ No newline at end of file diff --git a/.travis.osx b/.travis.osx new file mode 100644 index 000000000..768c5c872 --- /dev/null +++ b/.travis.osx @@ -0,0 +1,17 @@ +#!/bin/sh + +# https://gist.github.com/vmarkovtsev/3f2dd98e56cb63098027 + +brew unlink boost +brew install boost smpeg2 innoextract libpng freetype sdl2 sdl2_ttf sdl2_image qt5 ffmpeg +brew install sdl2_mixer --with-smpeg2 +sudo sed -i.bak 's/106200/106900/g' /usr/local/Cellar/cmake/*/share/cmake/Modules/FindBoost.cmake + +export CMAKE_PREFIX_PATH="/usr/local/opt/qt5:$CMAKE_PREFIX_PATH" + +sparkle_version=$(curl -L https://github.com/sparkle-project/Sparkle/releases/latest | grep '' | sed -E 's|^.*([1-9]\.[0-9]+\.[0-9]+).*$|\1|g') +wget https://github.com/sparkle-project/Sparkle/releases/download/$sparkle_version/Sparkle-$sparkle_version.tar.bz2 +mkdir sparkle && cd sparkle +tar -xf ../Sparkle-*.tar.bz2 +sudo mv Sparkle.framework /Library/Frameworks/ +cd .. && rm -rf sparkle \ No newline at end of file diff --git a/.travis.yml b/.travis.yml index 9fee37497..3e870b9aa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,37 +1,22 @@ -sudo: required -dist: trusty language: cpp +os: + - linux + - osx +dist: trusty +sudo: required before_install: - #new Clang - - sudo add-apt-repository --yes ppa:h-rayflood/llvm - #new SDL2 - - sudo add-apt-repository --yes ppa:zoogie/sdl2-snapshots - #new Qt - - sudo add-apt-repository --yes ppa:beineri/opt-qt57-trusty - #new CMake - - sudo add-apt-repository --yes ppa:george-edison55/cmake-3.x - - - sudo apt-get update -qq - - - sudo apt-get install -qq $SUPPORT - - sudo apt-get install -qq $PACKAGE - - sudo apt-get install -qq cmake libboost1.54-all-dev zlib1g-dev - - sudo apt-get install -qq libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-ttf-dev - - sudo apt-get install -qq libavformat-dev libswscale-dev - - sudo apt-get install -qq qt57declarative - - #setup compiler - - source /opt/qt57/bin/qt57-env.sh - - export CC=${REAL_CC} CXX=${REAL_CXX} + - if [[ $TRAVIS_OS_NAME == 'linux' ]]; then . .travis.linux; fi + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then . .travis.osx; fi before_script: - mkdir build - cd build - - cmake .. + - cmake -G "Unix Makefiles" .. script: - - make + - if [[ $TRAVIS_OS_NAME == 'osx' ]]; then cd ..; xcodebuild -project osx/osx-vcmibuilder/vcmibuilder.xcodeproj/ -configuration Release CONFIGURATION_BUILD_DIR=..; cd build; fi + - make -j2 env: - ignore=this @@ -40,14 +25,19 @@ matrix: exclude: - env: ignore=this include: - - compiler: clang - env: REAL_CC=clang-3.4 REAL_CXX=clang++-3.4 PACKAGE=clang-3.4 SUPPORT=libstdc++-4.8-dev - - compiler: clang + - os: linux + compiler: clang + env: REAL_CC=clang-3.4 REAL_CXX=clang++-3.4 PACKAGE=clang-3.4 SUPPORT=libstdc++-4.8-dev + - os: linux + compiler: clang env: REAL_CC=clang-3.5 REAL_CXX=clang++-3.5 PACKAGE=clang-3.5 SUPPORT=libstdc++-4.8-dev - - compiler: clang + - os: linux + compiler: clang env: REAL_CC=clang-3.6 REAL_CXX=clang++-3.6 PACKAGE=clang-3.6 SUPPORT=libstdc++-4.8-dev - - compiler: gcc + - os: linux + compiler: gcc env: REAL_CC=gcc-4.8 REAL_CXX=g++-4.8 PACKAGE=g++-4.8 SUPPORT= + - os: osx notifications: email: diff --git a/CMakeLists.txt b/CMakeLists.txt index b9123cb75..22f42a3c1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -235,7 +235,7 @@ endif() # Installation section # ####################################### -# For apple this files will be already inside vcmiclient bundle +# For apple these files will be already inside vcmiclient bundle if (NOT APPLE) # copy whole directory but .svn control files install(DIRECTORY config DESTINATION ${DATA_DIR} PATTERN ".svn" EXCLUDE)