|
1 sudo: required |
|
2 dist: xenial |
|
3 language: c |
|
4 sudo: true |
|
5 os: |
|
6 - linux |
|
7 - osx |
|
8 |
|
9 branches: |
|
10 only: |
|
11 master |
|
12 |
|
13 compiler: |
|
14 - gcc |
|
15 - clang |
|
16 |
|
17 matrix: |
|
18 exclude: |
|
19 - os: osx |
|
20 compiler: gcc |
|
21 |
|
22 env: |
|
23 - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Release" |
|
24 - BUILD_ARGS="-DCMAKE_BUILD_TYPE=Debug" |
|
25 - BUILD_ARGS="-DNOSERVER=1 -DGL2=1 -DNOPNG=1" |
|
26 - BUILD_ARGS="-DNOSERVER=1 -DLUA_SYSTEM=0" |
|
27 |
|
28 matrix: |
|
29 include: |
|
30 - language: c |
|
31 os: linux |
|
32 compiler: clang |
|
33 env: BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1" |
|
34 - language: c |
|
35 os: osx |
|
36 compiler: clang |
|
37 env: BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1" |
|
38 - language: c |
|
39 os: linux |
|
40 compiler: clang |
|
41 env: BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1 -DGL2=1" |
|
42 - language: c |
|
43 os: osx |
|
44 compiler: clang |
|
45 env: BUILD_ARGS="-DNOSERVER=1 -DBUILD_ENGINE_C=1 -DGL2=1" |
|
46 - language: objective-c |
|
47 sudo: required |
|
48 os: osx |
|
49 compiler: clang |
|
50 env: TRAVIS_OS_NAME="ios" SDL_LIB_PATH="$TRAVIS_BUILD_DIR/../Library" |
|
51 osx_image: xcode7.2 |
|
52 |
|
53 before_install: | |
|
54 if [ "$TRAVIS_OS_NAME" == "linux" ]; then |
|
55 sudo apt-get update -qq |
|
56 elif [ "$TRAVIS_OS_NAME" == "osx" ]; then |
|
57 brew update |
|
58 elif [ "$TRAVIS_OS_NAME" == "ios" ]; then |
|
59 hg clone http://hg.libsdl.org/SDL $SDL_LIB_PATH/SDL/ |
|
60 hg clone http://hg.libsdl.org/SDL_image $SDL_LIB_PATH/SDL_image/ |
|
61 hg clone http://hg.libsdl.org/SDL_net $SDL_LIB_PATH/SDL_net/ |
|
62 hg clone http://hg.libsdl.org/SDL_ttf $SDL_LIB_PATH/SDL_ttf/ |
|
63 hg clone http://hg.libsdl.org/SDL_mixer $SDL_LIB_PATH/SDL_mixer/ |
|
64 fi |
|
65 |
|
66 install: | |
|
67 if [ "$TRAVIS_OS_NAME" == "linux" ]; then |
|
68 sudo apt-get install -y debhelper cmake dpkg-dev qtbase5-dev qtbase5-private-dev qttools5-dev-tools qttools5-dev libsdl2-dev libsdl2-ttf-dev libsdl2-mixer-dev libsdl2-image-dev libsdl2-net-dev bzip2 ghc libghc-mtl-dev libghc-vector-dev libghc-zlib-dev libghc-random-dev libghc-network-dev libghc-sandi-dev libghc-hslogger-dev libghc-utf8-string-dev libghc-sha-dev libghc-entropy-dev libghc-regex-tdfa-dev libghc-aeson-dev libghc-yaml-dev libghc-text-dev liblua5.1-0-dev fpc fp-compiler fp-units-misc libpng-dev fp-units-gfx libavcodec-dev libavformat-dev libglew1.6-dev |
|
69 |
|
70 # for xenial last availible version of libphysfs is 2.0.x, but we need >= 3.0 |
|
71 # so... building from sources! |
|
72 wget https://icculus.org/physfs/downloads/physfs-3.0.1.tar.bz2 |
|
73 tar -xjf physfs-3.0.1.tar.bz2 |
|
74 mkdir physfs-3.0.1-build |
|
75 pushd physfs-3.0.1-build |
|
76 cmake ../physfs-3.0.1 |
|
77 make |
|
78 sudo make install |
|
79 popd |
|
80 elif [ "$TRAVIS_OS_NAME" == "osx" ]; then |
|
81 brew install qt5 |
|
82 brew install fpc glew physfs lua51 sdl2 sdl2_image sdl2_net sdl2_ttf ffmpeg ghc cabal-install |
|
83 brew install sdl2_mixer |
|
84 # use cabal install haskell deps, pas2c ones are covered by server |
|
85 if [[ "$BUILD_ARGS" != *"NOSERVER"* ]]; then |
|
86 cabal update |
|
87 cabal install --only-dependencies gameServer/hedgewars-server.cabal |
|
88 fi |
|
89 if [[ "$BUILD_ARGS" == *"BUILD_ENGINE_C"* ]]; then |
|
90 cabal update |
|
91 cabal install --only-dependencies tools/pas2c/pas2c.cabal |
|
92 fi |
|
93 # avoid installing Sparkle, add default unit path |
|
94 export BUILD_ARGS="$BUILD_ARGS -DNOAUTOUPDATE=1" |
|
95 elif [ "$TRAVIS_OS_NAME" == "ios" ]; then |
|
96 # FPC 3.0.0 required for using FPC 3.0.1 which contains rtl for ios |
|
97 sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/mirrors/fpc/dist/3.0.0/i386-macosx/fpc-3.0.0.intel-macosx.dmg |
|
98 sudo bash tools/dmg_pkg_install.sh ftp://freepascal.stack.nl/pub/mirrors/fpc/dist/3.0.0/i386-macosx/fpc-3.0.1.intel-macosx.cross.ios.dmg |
|
99 fi |
|
100 |
|
101 before_script: | |
|
102 if [ "$TRAVIS_OS_NAME" == "ios" ]; then |
|
103 # More or less stable hw iOS version can be compiled with FPC 3.1.1, |
|
104 # but there are no (easy?) way to build it from sources, |
|
105 # so we just temporary switch Xcode project to use FPC 3.0.1 |
|
106 git apply tools/fix_fpc_ios_build_patch.diff |
|
107 xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme UpdateDataFolder build |
|
108 else |
|
109 mkdir build && cd build && cmake $BUILD_ARGS .. |
|
110 fi |
|
111 |
|
112 script: | |
|
113 if [ "$TRAVIS_OS_NAME" == "ios" ]; then |
|
114 xctool -project ./project_files/HedgewarsMobile/Hedgewars.xcodeproj -scheme Hedgewars -configuration Release build CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO |
|
115 else |
|
116 make VERBOSE=1 |
|
117 fi |
|
118 |
|
119 after_success: | |
|
120 if [ "$TRAVIS_OS_NAME" == "linux" ]; then |
|
121 make test_verbose |
|
122 elif [ "$TRAVIS_OS_NAME" == "osx" ]; then |
|
123 make install |
|
124 fi |
|
125 |
|
126 notifications: |
|
127 email: false |
|
128 irc: |
|
129 channels: |
|
130 - "chat.freenode.net#hedgewars" |
|
131 template: |
|
132 - "hw-build #%{build_number} (%{commit} by %{author}): %{message}" |
|
133 - "See details at %{build_url}" |
|
134 on_success: change |
|
135 on_failure: always |
|
136 skip_join: false |