Merge pull request #90 from gizmo98/patch-2
[libretro-ppsspp.git] / .travis.sh
blob4123e457294acfb50d3400f5acce725bf8666a07
1 #/bin/bash
3 NDK_VER=android-ndk-r10d
5 download_extract() {
6 aria2c -x 16 $1 -o $2
7 tar -xf $2
10 # This is used for the Android NDK.
11 download_extract_xz() {
12 aria2c --file-allocation=none --timeout=120 --retry-wait=5 --max-tries=20 -Z -c $1 -o $2
13 stat -c 'ATTEMPT 1 - %s' $2
14 md5sum $2
15 # This resumes the download, in case it failed.
16 aria2c --file-allocation=none --timeout=120 --retry-wait=5 --max-tries=20 -Z -c $1 -o $2
17 stat -c 'ATTEMPT 2 - %s' $2
18 md5sum $2
20 # Keep some output going during the extract, so the build doesn't timeout.
21 pv $2 | xz -vd | tar -x
24 travis_before_install() {
25 git submodule update --init --recursive
27 if [ ! "$TRAVIS_OS_NAME" = "osx" ]; then
28 sudo apt-get update -qq
29 sudo apt-get install software-properties-common aria2 pv build-essential libgl1-mesa-dev libglu1-mesa-dev -qq
31 if [ "$CMAKE" = "TRUE" ]; then
32 sudo apt-get install lib32stdc++6 lib32z1 lib32z1-dev cmake -qq
37 travis_install() {
38 # Ubuntu Linux + GCC 4.8
39 if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
40 # For libsdl2-dev.
41 sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y
42 if [ "$CXX" = "g++" ]; then
43 sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
45 if [ "$QT" = "TRUE" ]; then
46 sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
49 sudo apt-get update
50 sudo apt-get install libsdl2-dev -qq
51 if [ "$CXX" = "g++" ]; then
52 sudo apt-get install g++-4.8 -qq
55 if [ "$QT" = "TRUE" ]; then
56 sudo apt-get install -qq qt5-qmake qtmultimedia5-dev qtsystems5-dev qtbase5-dev qtdeclarative5-dev qttools5-dev-tools libqt5webkit5-dev libsqlite3-dev qt5-default
60 # Android NDK + GCC 4.8
61 if [ "$PPSSPP_BUILD_TYPE" = "Android" ]; then
62 free -m
63 sudo apt-get install ant -qq
64 download_extract_xz http://hdkr.co/${NDK_VER}-x86_64.tar.xz ${NDK_VER}-x86_64.tar.xz
67 # Blackberry NDK: 10.3.0.440 + GCC: 4.8.2
68 if [ "$PPSSPP_BUILD_TYPE" = "Blackberry" ]; then
69 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
70 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
71 sed -i 's/-g../&-4.8.2/g' Blackberry/bb.toolchain.cmake
74 # Symbian NDK: Belle + GCC: 4.8.3
75 if [ "$PPSSPP_BUILD_TYPE" = "Symbian" ]; then
76 sudo apt-get install lib32stdc++6 lib32bz2-1.0 -qq
77 download_extract https://github.com/xsacha/SymbianGCC/releases/download/4.8.3/gcc4.8.3_x86-64.tar.bz2 compiler.tar.bz2
78 download_extract https://github.com/xsacha/SymbianGCC/releases/download/4.8.3/ndk-new.tar.bz2 ndk.tar.bz2
79 export EPOCROOT=$(pwd)/SDKs/SymbianSR1Qt474/ SBS_GCCE483BIN=$(pwd)/gcc4.8.3_x86-64/bin
80 cp ffmpeg/symbian/armv6/lib/* $EPOCROOT/epoc32/release/armv5/urel/
84 travis_script() {
85 # Compile PPSSPP
86 if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
87 if [ "$CXX" = "g++" ]; then
88 export CXX="g++-4.8" CC="gcc-4.8"
91 if [ "$QT" = "TRUE" ]; then
92 ./b.sh --qt
93 else
94 ./b.sh --headless
97 if [ "$PPSSPP_BUILD_TYPE" = "Android" ]; then
98 export ANDROID_HOME=$(pwd)/${NDK_VER} NDK=$(pwd)/${NDK_VER}
99 if [[ "$CXX" = *clang* ]]; then
100 export NDK_TOOLCHAIN_VERSION=clang
103 pushd android
104 ./ab.sh -j1
105 popd
107 if [ "$PPSSPP_BUILD_TYPE" = "Blackberry" ]; then
108 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"
110 ./b.sh --release --no-package
112 if [ "$PPSSPP_BUILD_TYPE" = "Symbian" ]; then
113 export EPOCROOT=$(pwd)/SDKs/SymbianSR1Qt474/ SBS_GCCE483BIN=$(pwd)/gcc4.8.3_x86-64/bin
114 PATH=$SBS_GCCE483BIN:$(pwd)/tools/sbs/bin:$EPOCROOT/epoc32/tools:$EPOCROOT/bin:$(pwd)/tools/sbs/linux-x86_64-libc2_15/bin:$PATH
115 QMAKE_ARGS="CONFIG+=no_assets" ./b.sh --debug --no-package
117 if [ "$PPSSPP_BUILD_TYPE" = "iOS" ]; then
118 ./b.sh --ios
119 pushd build
120 xcodebuild -configuration Release
121 popd build
125 travis_after_success() {
126 if [ "$PPSSPP_BUILD_TYPE" = "Linux" ]; then
127 ./test.py
131 set -e
132 set -x