forked from mmatyas/supermariowar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
204 lines (180 loc) · 6.13 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
language: cpp
sudo: required
dist: xenial
branches:
only:
- master
matrix:
include:
# Linux desktop builds
- name: "Linux + GCC + SDL 1.2"
compiler: gcc
env: BUILD=native SMW_USE_SDL2=false
- name: "Linux + GCC + SDL 2"
compiler: gcc
env: BUILD=native SMW_USE_SDL2=true
- name: "Linux + Clang + SDL 1.2"
compiler: clang
env: BUILD=native SMW_USE_SDL2=false
- name: "Linux + Clang + SDL 2"
compiler: clang
env: BUILD=native SMW_USE_SDL2=true
# MinGW cross
- name: "MinGW"
dist: bionic
env: BUILD=mingw SMW_USE_SDL2=true
# OSX SDL1.2 build
- name: "macOS + SDL 1.2"
os: osx
env: BUILD=native SMW_USE_SDL2=false
compiler: clang
before_script:
- brew update
- brew install sdl sdl_image sdl_mixer
# OSX SDL2 build
- name: "macOS + SDL 2"
os: osx
env: BUILD=native SMW_USE_SDL2=true
compiler: clang
before_script:
- brew update
- brew install sdl2 sdl2_image sdl2_mixer
# Emscripten
- name: "Emscripten"
env: BUILD=emscripten
# Android builds
- name: "Android ARM"
language: android
env: BUILD=android ABILIST='armeabi armeabi-v7a arm64-v8a'
- name: "Android Intel"
language: android
env: BUILD=android ABILIST='x86 x86_64'
- name: "Android MIPS"
language: android
env: BUILD=android ABILIST='mips mips64'
before_script:
# Native (Linux, OSX)
- if [[ "$BUILD" == "native" && "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -qq update &&
sudo apt-get install -y
cmake
clang
default-jre
g++
libsdl1.2-dev
libsdl-image1.2-dev
libsdl-mixer1.2-dev
libsdl2-dev
libsdl2-image-dev
libsdl2-mixer-dev
libegl1-mesa-dev
libgles2-mesa-dev
; fi
- if [[ "$BUILD" == "native" ]]; then $CXX --version; fi
- if [[ "$BUILD" == "native" ]]; then cmake --version; fi
- if [[ "$BUILD" == "native" && "$SMW_USE_SDL2" == "false" ]]; then sdl-config --version; fi
- if [[ "$BUILD" == "native" && "$SMW_USE_SDL2" == "true" ]]; then sdl2-config --version; fi
# MinGW cross
- if [[ "$BUILD" == "mingw" && "$TRAVIS_OS_NAME" == "linux" ]]; then
sudo apt-get -qq update &&
sudo apt-get install -y
cmake
g++-mingw-w64-i686
; fi
- if [[ "$BUILD" == "mingw" && "$TRAVIS_OS_NAME" == "linux" ]]; then
export SDL2DIR=/ &&
curl -L https://github.com/mmatyas/supermariowar/releases/download/v2.0-beta.0/i686-w64-mingw32.tar.xz | tar xJf - -C /tmp/
; fi
- if [[ "$BUILD" == "mingw" && "$TRAVIS_OS_NAME" == "linux" ]]; then $CXX --version; fi
- if [[ "$BUILD" == "mingw" && "$TRAVIS_OS_NAME" == "linux" ]]; then cmake --version; fi
# Emscripten
- if [[ "$BUILD" == "emscripten" && "$TRAVIS_OS_NAME" == "linux" ]]; then
git clone https://github.com/emscripten-core/emsdk.git --depth=1;
cd emsdk;
./emsdk install 1.39.5;
./emsdk activate 1.39.5;
source ./emsdk_env.sh;
cd ..;
fi
- if [[ "$BUILD" == "emscripten" && "$TRAVIS_OS_NAME" == "linux" ]]; then emcc -v; fi
# Android SDK + NDK
- if [[ "$BUILD" == "android" ]]; then
sudo apt-get -qq update &&
sudo apt-get install -y
ant
expect
lib32bz2-1.0
lib32gcc1
lib32ncurses5
lib32stdc++6
lib32z1
openjdk-7-jdk
; fi
- if [[ "$BUILD" == "android" ]]; then
cd ..;
wget http://dl.google.com/android/ndk/android-ndk-r10e-linux-x86_64.bin;
chmod +x ./android-ndk-r10e-linux-x86_64.bin;
./android-ndk-r10e-linux-x86_64.bin > /dev/null;
export PATH=$PATH:$(pwd)/android-ndk-r10e;
fi
script:
- if [[ "$BUILD" == "native" ]]; then mkdir build && cd build; fi
- if [[ "$BUILD" == "native" && "$SMW_USE_SDL2" == "false" ]]; then
cmake -D USE_SDL2_LIBS:BOOL=OFF .. &&
make &&
cd ..;
fi
- if [[ "$BUILD" == "native" && "$SMW_USE_SDL2" == "true" ]]; then
cmake -D USE_SDL2_LIBS:BOOL=ON .. &&
make &&
cd ..;
fi
- if [[ "$BUILD" == "native" && "$SMW_USE_SDL2" == "true" && "$TRAVIS_COMPILER" == "gcc" ]]; then
export deploydir="supermariowar_$(date +%F)_linux" &&
mkdir "$deploydir" &&
cp docs/readme-v1.8.html build/Binaries/Release/{smw,smw-leveledit,smw-worldedit,smw-server} "${deploydir}/";
fi
# MinGW
- if [[ "$BUILD" == "mingw" && "$SMW_USE_SDL2" == "true" ]]; then
mkdir build && cd build &&
cmake -DCMAKE_TOOLCHAIN_FILE=../.travis/mingw_toolchain.cmake -DUSE_SDL2_LIBS=ON .. &&
make &&
cd ..;
fi
- if [[ "$BUILD" == "mingw" && "$SMW_USE_SDL2" == "true" ]]; then
export deploydir="supermariowar_$(date +%F)_windows" &&
mkdir "$deploydir" &&
cp docs/readme-v1.8.html "${deploydir}/" &&
cp /tmp/i686-w64-mingw32/bin/lib{modplug-1,mpg123-0,ogg-0,opus-0,opusfile-0,png16-16,vorbis-0,vorbisfile-3}.dll "${deploydir}/" &&
cp /tmp/i686-w64-mingw32/bin/{SDL2,SDL2_image,SDL2_mixer,zlib1}.dll "${deploydir}/" &&
cp build/Binaries/Release/{smw,smw-leveledit,smw-worldedit,smw-server}.exe "${deploydir}/";
fi
# Android
- if [[ "$BUILD" == "android" ]]; then
git clone --depth=1 https://github.com/mmatyas/supermariowar-android.git;
mv supermariowar supermariowar-android/;
cd supermariowar-android;
./build.sh --abi=$ABILIST;
fi
# Emscripten
- if [[ "$BUILD" == "emscripten" ]]; then
cd dependencies;
curl -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz | tar xzf -;
cd ..;
sed -i 's|if (BUILD_STATIC_LIBS)|if (BUILD_STATIC_LIBS)\ninclude_directories(dependencies/SDL2_mixer-2.0.4)|' CMakeLists.txt;
unzip data.zip > /dev/null;
mkdir build_js && cd build_js;
emconfigure cmake .. -DNO_NETWORK=1 -DDISABLE_SYSLIB_CHECKS=1 -DUSE_SDL2_LIBS=1;
emmake make smw;
fi
# Deploy
- if [[ -n "$deploydir" ]]; then
unzip -q data.zip -d "${deploydir}/" &&
zip -r "${deploydir}.zip" "${deploydir}" &&
wget -c https://github.com/mmatyas/uploadtool/raw/master/upload.sh &&
bash ./upload.sh "${deploydir}.zip";
fi
android:
components:
- build-tools-23.0.1
- android-15