.travis.yml
changeset 11748 4a68030ee852
parent 11662 97a4188fc99e
child 11749 5d66eace5b81
--- a/.travis.yml	Wed Apr 27 18:08:48 2016 +0200
+++ b/.travis.yml	Wed Apr 27 15:08:43 2016 -0400
@@ -1,46 +1,49 @@
 language: c
+sudo: false
 os:
   - linux
   - osx
+
 branches:
   only:
     master
+
 compiler:
   - gcc
   - clang
+
 env:
   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Release"
   - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug"
   - BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1"
   - BUILD_ARGS="-DNOSERVER=1 -DNOVIDEOREC=1 -DNOPNG=1"
   - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0 -DPHYSFS_SYSTEM=0"
+
 matrix:
   include:
   - language: objective-c
+    sudo: required
     os: osx
-    compiler:
-    env: BUILD_ARGS="IOS" SDL_LIB_PATH="$TRAVIS_BUILD_DIR/../Library"
+    compiler: clang
+    env: TRAVIS_OS_NAME="ios" SDL_LIB_PATH="$TRAVIS_BUILD_DIR/../Library"
     osx_image: xcode7.2
-    sudo: required
+
 before_install: |
-  if [ "$BUILD_ARGS" == "IOS" ]; then
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
+    sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
+    sudo apt-get update -qq
+  elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
+    brew update --all
+  elif [ "$TRAVIS_OS_NAME" == "ios" ]; then
     hg clone http://hg.libsdl.org/SDL $SDL_LIB_PATH/SDL/
     hg clone http://hg.libsdl.org/SDL_image $SDL_LIB_PATH/SDL_image/
     hg clone http://hg.libsdl.org/SDL_net $SDL_LIB_PATH/SDL_net/
     hg clone http://hg.libsdl.org/SDL_ttf $SDL_LIB_PATH/SDL_ttf/
     hg clone http://hg.libsdl.org/SDL_mixer $SDL_LIB_PATH/SDL_mixer/
-  elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
-    sudo add-apt-repository -y ppa:zoogie/sdl2-snapshots
-    sudo apt-get update -qq
-  elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
-    brew update --all
   fi
+
 install: |
-  if [ "$BUILD_ARGS" == "IOS" ]; then
-    # FPC 3.0.0 required for using FPC 3.0.1 which contains rtl for ios
-    sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.0.intel-macosx.dmg
-    sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.1.intel-macosx.cross.ios.dmg
-  elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
     sudo apt-get install debhelper cmake dpkg-dev libqt4-dev qt4-qmake libphysfs-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-net-dev bzip2 ghc libghc-mtl-dev libghc-parsec3-dev libghc-bytestring-show-dev libghc-vector-dev libghc-zlib-dev libghc-random-dev libghc-stm-dev libghc-network-dev libghc-dataenc-dev libghc-hslogger-dev libghc-utf8-string-dev libghc-sha-dev libghc-entropy-dev liblua5.1-0-dev imagemagick fpc fp-compiler fp-units-misc libpng-dev fp-units-gfx libavcodec-dev libavformat-dev libglew1.6-dev
   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
     brew install fpc glew qt physfs lua51 sdl2 sdl2_image sdl2_net sdl2_ttf ffmpeg ghc cabal-install
@@ -55,31 +58,38 @@
       cabal install --only-dependencies tools/pas2c/pas2c.cabal
     fi
     # avoid installing Sparkle, add default unit path
-    export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1 -DCMAKE_Pascal_FLAGS=-Fu/usr/local/lib/fpc/$(fpc -iW)/units/x86_64-darwin/*/"
+    export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1"
+  elif [ "$TRAVIS_OS_NAME" == "ios" ]; then
+    # FPC 3.0.0 required for using FPC 3.0.1 which contains rtl for ios
+    sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.0.intel-macosx.dmg
+    sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/fpc/dist/3.0.0/i386-macosx/fpc-3.0.1.intel-macosx.cross.ios.dmg
   fi
+
 before_script: |
-  if [ "$BUILD_ARGS" == "IOS" ]; then
-    # More or less stable hw iOS version can be compiled with FPC 3.1.1, btw there are no (easy?) way to build it from sources,
+  if [ "$TRAVIS_OS_NAME" == "ios" ]; then
+    # More or less stable hw iOS version can be compiled with FPC 3.1.1,
+    # but there are no (easy?) way to build it from sources,
     # so we just temporary switch Xcode project to use FPC 3.0.1
     git apply tools/fix_fpc_ios_build_patch.diff
     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme UpdateDataFolder build
   else
     mkdir build && cd build && cmake $BUILD_ARGS ..
   fi
+
 script: |
-  if [ "$BUILD_ARGS" == "IOS" ]; then
+  if [ "$TRAVIS_OS_NAME" == "ios" ]; then
     xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme Hedgewars -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
   else
     make VERBOSE=1
   fi
+
 after_success: |
-  if [ "$BUILD_ARGS" == "IOS" ]; then
-    :
-  elif [ "$TRAVIS_OS_NAME" == "linux" ]; then
+  if [ "$TRAVIS_OS_NAME" == "linux" ]; then
     make test_verbose
   elif [ "$TRAVIS_OS_NAME" == "osx" ]; then
     make install
   fi
+
 notifications:
   email: false
   irc: