forked from jpd002/Play-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.sh
172 lines (162 loc) · 7.27 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
163
164
165
166
167
168
169
170
171
172
#/bin/bash
travis_before_install()
{
if [ "$TARGET_OS" = "Linux" ]; then
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
if [ "$TARGET_ARCH" = "ARM64" ]; then
sudo apt update -qq
sudo apt install -y gcc-9 g++-9 qtbase5-dev libcurl4-openssl-dev libgl1-mesa-dev libglu1-mesa-dev libalut-dev libevdev-dev libgles2-mesa-dev
else
wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage"
chmod a+x linuxdeployqt*.AppImage
wget -c "https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/AppRun-patched-x86_64" -O AppRun
chmod a+x AppRun
wget -c "https://github.com/RPCS3/AppImageKit-checkrt/releases/download/continuous2/exec-x86_64.so" -O exec.so
sudo add-apt-repository --yes ppa:beineri/opt-qt-5.12.3-xenial
sudo apt update -qq
sudo apt install -qq qt512base gcc-9 g++-9 libgl1-mesa-dev libglu1-mesa-dev libalut-dev libevdev-dev
fi
elif [ "$TARGET_OS" = "Linux_Clang_Format" ]; then
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository --yes "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-6.0 main"
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y clang-format-6.0
elif [ "$TARGET_OS" = "OSX" ]; then
brew update
brew install qt5
npm install -g appdmg
elif [ "$TARGET_OS" = "IOS" ]; then
brew update
brew install dpkg
elif [ "$TARGET_OS" = "Android" ]; then
echo y | sdkmanager 'ndk;20.0.5594570'
echo y | sdkmanager 'cmake;3.10.2.4988404'
fi;
git submodule update -q --init --recursive
}
travis_script()
{
if [ "$TARGET_OS" = "Android" ]; then
if [ "$BUILD_LIBRETRO" = "yes" ]; then
CMAKE_PATH=/usr/local/android-sdk/cmake/3.10.2.4988404
export PATH=${CMAKE_PATH}/bin:$PATH
export NINJA_EXE=${CMAKE_PATH}/bin/ninja
export ANDROID_NDK=/usr/local/android-sdk/ndk/20.0.5594570
export ANDROID_TOOLCHAIN_FILE=${ANDROID_NDK}/build/cmake/android.toolchain.cmake
pushd build_retro
bash android_build.sh
popd
else
pushd build_android
./gradlew
./gradlew assembleRelease
popd
fi
elif [ "$TARGET_OS" = "Linux_Clang_Format" ]; then
set +e
find ./Source/ ./tools/ -iname *.h -o -iname *.cpp -o -iname *.m -iname *.mm | xargs clang-format-6.0 -i
git config --global user.name "Clang-Format"
git config --global user.email "Clang-Format"
git commit -am"Clang-format";
if [ $? -eq 0 ]; then
url=$(git format-patch -1 HEAD --stdout | nc termbin.com 9999)
echo "generated clang-format patch can be found at: $url"
echo "you can pipe patch directly using the following command:";
echo "curl $url | git apply -v"
echo "then manually commit and push the changes"
exit -1;
fi
exit 0;
else
mkdir build
pushd build
if [ "$TARGET_OS" = "Linux" ]; then
if [ "$CXX" = "g++" ]; then export CXX="g++-9" CC="gcc-9"; fi
source /opt/qt512/bin/qt512-env.sh || true
export PATH=$PATH:/opt/qt512/lib/cmake
cmake .. -G"$BUILD_TYPE" -DCMAKE_INSTALL_PREFIX=./appdir/usr -DBUILD_LIBRETRO_CORE=yes;
cmake --build .
ctest
cmake --build . --target install
if [ "$TARGET_ARCH" = "x86_64" ]; then
mkdir -p appdir/usr/optional/
mkdir -p appdir/usr/optional/libstdc++/
cp /usr/lib/*-linux-gnu/libstdc++.so.6 ./appdir/usr/optional/libstdc++/
cp ../AppRun ./appdir/AppRun
cp ../exec.so ./appdir/usr/optional/exec.so
printf "#include <memory>\nint main(){std::make_exception_ptr(0);}" | $CXX -x c++ -o ./appdir/usr/optional/checker -
mkdir -p appdir/usr/share/doc/libc6/
echo "" > appdir/usr/share/doc/libc6/copyright
# AppImage Creation
unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH;
export VERSION="${TRAVIS_COMMIT:0:8}"
../linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -bundle-non-qt-libs -unsupported-allow-new-glibc -qmake=`which qmake`
../linuxdeployqt*.AppImage ./appdir/usr/share/applications/*.desktop -appimage -unsupported-allow-new-glibc -qmake=`which qmake`
fi
elif [ "$TARGET_OS" = "OSX" ]; then
export CMAKE_PREFIX_PATH="$(brew --prefix qt5)"
cmake .. -G"$BUILD_TYPE" -DBUILD_LIBRETRO_CORE=yes
cmake --build . --config Release
ctest -C Release
$(brew --prefix qt5)/bin/macdeployqt Source/ui_qt/Release/Play.app
appdmg ../installer_macosx/spec.json Play.dmg
elif [ "$TARGET_OS" = "IOS" ]; then
cmake .. -G"$BUILD_TYPE" -DCMAKE_TOOLCHAIN_FILE=../deps/Dependencies/cmake-ios/ios.cmake -DTARGET_IOS=ON -DBUILD_PSFPLAYER=ON -DBUILD_LIBRETRO_CORE=yes
cmake --build . --config Release
codesign -s "-" Source/ui_ios/Release-iphoneos/Play.app
pushd ..
pushd installer_ios
./build_cydia.sh
./build_ipa.sh
popd
popd
fi;
popd
fi;
}
travis_before_deploy()
{
export SHORT_HASH="${TRAVIS_COMMIT:0:8}"
mkdir deploy
pushd deploy
mkdir $SHORT_HASH
pushd $SHORT_HASH
if [ -z "$ANDROID_KEYSTORE_PASS" ]; then
return
fi;
if [ "$TARGET_OS" = "Linux" ]; then
if [ "$TARGET_ARCH" = "x86_64" ]; then
cp ../../build/Play*.AppImage .
cp ../../build/Source/ui_libretro/play_libretro.so play_libretro_linux-x86_64.so
else
cp ../../build/Source/ui_libretro/play_libretro.so play_libretro_linux-ARM64.so
fi;
fi;
if [ "$TARGET_OS" = "Android" ]; then
if [ "$BUILD_LIBRETRO" = "yes" ]; then
cp ../../build_retro/play_* .
ABI_LIST="arm64-v8a armeabi-v7a x86 x86_64"
else
cp ../../build_android/build/outputs/apk/release/Play-release-unsigned.apk .
export ANDROID_BUILD_TOOLS=$ANDROID_HOME/build-tools/28.0.3
$ANDROID_BUILD_TOOLS/zipalign -v -p 4 Play-release-unsigned.apk Play-release.apk
$ANDROID_BUILD_TOOLS/apksigner sign --ks ../../installer_android/deploy.keystore --ks-key-alias deploy --ks-pass env:ANDROID_KEYSTORE_PASS --key-pass env:ANDROID_KEYSTORE_PASS Play-release.apk
fi
fi;
if [ "$TARGET_OS" = "OSX" ]; then
cp ../../build/Play.dmg .
cp ../../build/Source/ui_libretro/Release/play_libretro.dylib play_libretro_macOS-x86_64.dylib
fi;
if [ "$TARGET_OS" = "IOS" ]; then
cp ../../installer_ios/Play.ipa .
cp ../../installer_ios/Play.deb .
cp ../../installer_ios/Packages.bz2 .
cp ../../build/Source/ui_libretro/Release/play_libretro.dylib play_libretro_iOS-FAT.dylib
fi;
popd
popd
}
set -e
set -x
$1;