forked from 07th-mod/ponscripter-fork
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_before_install.sh
66 lines (59 loc) · 2.88 KB
/
.travis_before_install.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
set -e
if [ -z "$STEAMLESS" ] && [ -z "$SSH_KEY" ]; then
echo "Can't get steam API without SSH key, skipping"
exit 0
fi
case "$TRAVIS_OS_NAME" in
linux)
sudo apt-get update -qq
sudo apt-get install -y libasound2-dev ;;
windows)
choco install -y zip unzip ;;
esac
if [ -n "$SSH_KEY" ]; then
echo "${SSH_KEY}" | base64 --decode > key
chmod 600 key
fi
if [ -z "$STEAMLESS" ] && [ -n "$SSH_KEY" ]; then
export STEAM="-steam"
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
export STEAM_RUNTIME_HOST_ARCH=$(dpkg --print-architecture)
export STEAM_RUNTIME_ROOT="$(pwd)/steam/runtime/amd64"
export STEAM_RUNTIME_TARGET_ARCH=amd64
export PATH="$(pwd)/steam/bin:$PATH"
fi
# Steam SDK
scp -o StrictHostKeyChecking=no -i key "${DOWNLOAD_SERVER}/steamworks_sdk_129a.zip" . 2>/dev/null
unzip -d src/extlib/src/steam-sdk/ steamworks_sdk_129a.zip
mv src/extlib/src/steam-sdk/sdk/* src/extlib/src/steam-sdk/
fi
if [ "$TRAVIS_OS_NAME" == "linux" ]; then
sudo apt-get install -y chrpath libbz2-dev libvorbis-dev libfreetype6-dev libsdl2-image-dev libsdl2-mixer-dev libsdl2-dev libgles2-mesa-dev libglu1-mesa-dev
if [ -z "$STEAMLESS" ] && [ -n "$SSH_KEY" ]; then
# For i386 steam builds, we build x86_64
# sudo dpkg --add-architecture i386
# sudo apt-get update -qq
# sudo apt-get install -y libbz2-dev:i386 libfreetype6-dev:i386 libsdl2-mixer-dev:i386 libsdl2-image-dev:i386 libsdl2-dev:i386 libpulse-dev:i386 libavahi-client-dev:i386 libgles2-mesa-dev:i386 libglu1-mesa-dev:i386 libgl1-mesa-dev:i386 libpng-dev:i386
# Steam build environment
mkdir steam
for file in "http://media.steampowered.com/client/runtime/steam-runtime-sdk_latest.tar.xz" "http://media.steampowered.com/client/runtime/x-tools-amd64-i386_latest.tar.xz" "http://media.steampowered.com/client/runtime/x-tools-amd64-amd64_latest.tar.xz"; do
echo "Downloading $file"
curl "$file" | tar -xJf - --strip-components=1 -C steam
done
mkdir steam/runtime
echo "Downloading http://media.steampowered.com/client/runtime/steam-runtime-dev-release_latest.tar.xz"
curl "http://media.steampowered.com/client/runtime/steam-runtime-dev-release_latest.tar.xz" | tar -xJf - --strip-components=1 -C steam/runtime
fi
elif [ "$TRAVIS_OS_NAME" == "windows" ]; then
[[ ! -f C:/tools/msys64/msys2_shell.cmd ]] && rm -rf C:/tools/msys64
choco upgrade --no-progress -y msys2
export msys2='cmd //C RefreshEnv.cmd '
export msys2+='& set MSYS=winsymlinks:nativestrict '
export msys2+='& C:\\tools\\msys64\\msys2_shell.cmd -defterm -no-start'
export mingw64="$msys2 -mingw64 -full-path -here -c "\"\$@"\" --"
export mingw32="$msys2 -mingw32 -full-path -here -c "\"\$@"\" --"
export msys2+=" -msys2 -c "\"\$@"\" --"
$msys2 pacman --sync --noconfirm --needed mingw-w64-i686-gcc make autoconf automake-wrapper
## Install more MSYS2 packages from https://packages.msys2.org/base here
taskkill //IM gpg-agent.exe //F || true # https://travis-ci.community/t/4967
fi