This repository has been archived by the owner on Mar 30, 2020. It is now read-only.
forked from hrydgard/ppsspp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.sh
162 lines (136 loc) · 5.11 KB
/
.travis.sh
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
#/bin/bash
export USE_CCACHE=1
export NDK_CCACHE=ccache
NDK_VER=android-ndk-r12b
download_extract() {
aria2c -x 16 $1 -o $2
tar -xf $2
}
# This is used for the Android NDK.
download_extract_zip() {
aria2c --file-allocation=none --timeout=120 --retry-wait=5 --max-tries=20 -Z -c $1 -o $2
# This resumes the download, in case it failed.
aria2c --file-allocation=none --timeout=120 --retry-wait=5 --max-tries=20 -Z -c $1 -o $2
unzip $2 2>&1 | pv > /dev/null
}
travis_before_install() {
git submodule update --init --recursive
if [ ! "$TRAVIS_OS_NAME" = "osx" ]; then
sudo apt-get update -qq
sudo apt-get install software-properties-common aria2 pv build-essential libgl1-mesa-dev libglu1-mesa-dev -qq
if [ "$CMAKE" = "TRUE" ]; then
sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev cmake -qq
fi
fi
}
setup_ccache_script() {
if [ ! -e "$1" ]; then
mkdir "$1"
fi
echo "#!/bin/bash" > "$1/$3"
echo "ccache $2/$3 \$*" >> "$1/$3"
chmod +x "$1/$3"
}
travis_install() {
# Ubuntu Linux + GCC 4.8
if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
# For libsdl2-dev.
sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y
if [ "$CXX" = "g++" ]; then
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
fi
if [ "$QT" = "TRUE" ]; then
sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
fi
sudo apt-get update
sudo apt-get install libsdl2-dev -qq
if [ "$CXX" = "g++" ]; then
sudo apt-get install g++-4.8 -qq
fi
if [ "$QT" = "TRUE" ]; then
sudo apt-get install -qq qt5-qmake qtmultimedia5-dev qtsystems5-dev qtbase5-dev qtdeclarative5-dev qttools5-dev-tools libqt5webkit5-dev libsqlite3-dev qt5-default
fi
fi
# Android NDK + GCC 4.8
if [ "$PPSSPP_BUILD_TYPE" = "Android" ]; then
free -m
sudo apt-get install ant -qq
download_extract_zip http://dl.google.com/android/repository/${NDK_VER}-linux-x86_64.zip ${NDK_VER}-linux-x86_64.zip
fi
# Blackberry NDK: 10.3.0.440 + GCC: 4.8.2
if [ "$PPSSPP_BUILD_TYPE" = "Blackberry" ]; then
download_extract http://downloads.blackberry.com/upr/developers/update/bbndk/10_3_beta/ndktarget_10.3.0.440/ndktargetrepo_10.3.0.440/packages/bbndk.linux.libraries.10.3.0.440.tar.gz libs.tar.gz
download_extract http://downloads.blackberry.com/upr/developers/update/bbndk/10_3_beta/ndktarget_10.3.0.440/ndktargetrepo_10.3.0.440/packages/bbndk.linux.tools.10.3.0.2702.tar.gz tools.tar.gz
sed -i 's/-g../&-4.8.2/g' Blackberry/bb.toolchain.cmake
fi
# Symbian NDK: Belle + GCC: 4.8.3
if [ "$PPSSPP_BUILD_TYPE" = "Symbian" ]; then
sudo apt-get install lib32stdc++6 lib32bz2-1.0 -qq
download_extract https://github.com/xsacha/SymbianGCC/releases/download/4.8.3/gcc4.8.3_x86-64.tar.bz2 compiler.tar.bz2
download_extract https://github.com/xsacha/SymbianGCC/releases/download/4.8.3/ndk-new.tar.bz2 ndk.tar.bz2
setup_ccache_script $(pwd)/gcce-ccache $(pwd)/gcc4.8.3_x86-64/bin arm-none-symbianelf-gcc-4.8.3
setup_ccache_script $(pwd)/gcce-ccache $(pwd)/gcc4.8.3_x86-64/bin arm-none-symbianelf-gcc
setup_ccache_script $(pwd)/gcce-ccache $(pwd)/gcc4.8.3_x86-64/bin arm-none-symbianelf-g++
setup_ccache_script $(pwd)/gcce-ccache $(pwd)/gcc4.8.3_x86-64/bin arm-none-symbianelf-c++
ln -s $(pwd)/gcc4.8.3_x86-64/bin/arm-none-symbianelf-{strip,strings,size,readelf,ranlib,objdump,objcopy,nm,ld,gprof,gcov,gcc-ranlib,gcc-nm,gcc-ar,elfedit,cpp,c++filt,as,ar,addr2line} $(pwd)/gcce-ccache
export EPOCROOT=$(pwd)/SDKs/SymbianSR1Qt474/ SBS_GCCE483BIN="$(pwd)/gcce-ccache"
cp ffmpeg/symbian/armv6/lib/* $EPOCROOT/epoc32/release/armv5/urel/
fi
# Ensure we're using ccache
if [[ "$CXX" = "clang" && "$CC" == "clang" ]]; then
export CXX="ccache clang" CC="ccache clang"
fi
if [[ "$PPSSPP_BUILD_TYPE" == "Linux" && "$CXX" == "g++" ]]; then
# Also use gcc 4.8, instead of whatever default version.
export CXX="ccache g++-4.8" CC="ccache gcc-4.8"
fi
if [[ "$CXX" != *ccache* ]]; then
export CXX="ccache $CXX"
fi
if [[ "$CC" != *ccache* ]]; then
export CC="ccache $CC"
fi
}
travis_script() {
# Compile PPSSPP
if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
if [ "$QT" = "TRUE" ]; then
./b.sh --qt
else
./b.sh --headless
fi
fi
if [ "$PPSSPP_BUILD_TYPE" = "Android" ]; then
export ANDROID_HOME=$(pwd)/${NDK_VER} NDK=$(pwd)/${NDK_VER}
if [[ "$CXX" = *clang* ]]; then
export NDK_TOOLCHAIN_VERSION=clang
fi
pushd android
./ab.sh -j2 APP_ABI=$APP_ABI
popd
fi
if [ "$PPSSPP_BUILD_TYPE" = "Blackberry" ]; then
export QNX_TARGET="$(pwd)/target_10_3_0_440/qnx6" QNX_HOST="$(pwd)/host_10_3_0_2702/linux/x86" && PATH="$QNX_HOST/usr/bin:$PATH"
./b.sh --release --no-package
fi
if [ "$PPSSPP_BUILD_TYPE" = "Symbian" ]; then
export EPOCROOT=$(pwd)/SDKs/SymbianSR1Qt474/ SBS_GCCE483BIN="$(pwd)/gcce-ccache"
PATH=$SBS_GCCE483BIN:$(pwd)/gcc4.8.3_x86-64/bin:$(pwd)/tools/sbs/bin:$EPOCROOT/epoc32/tools:$EPOCROOT/bin:$(pwd)/tools/sbs/linux-x86_64-libc2_15/bin:$PATH
QMAKE_ARGS="CONFIG+=no_assets" ./b.sh --debug --no-package
fi
if [ "$PPSSPP_BUILD_TYPE" = "iOS" ]; then
./b.sh --ios
pushd build
xcodebuild -configuration Release
popd build
fi
}
travis_after_success() {
ccache -s
if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
./test.py
fi
}
set -e
set -x
$1;