-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathbuild.sh
executable file
·79 lines (63 loc) · 1.57 KB
/
build.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
#!/bin/bash
set -e
readonly BASE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Only build arm on master
if [[ "${TRAVIS_BRANCH}" != "master" ]] && [[ "${BUILD_ARCH}" = arm* ]]; then
exit 0
fi
travis_wait() {
local timeout=110
local cmd="$@"
$cmd &
local cmd_pid=$!
travis_jigger $! $timeout $cmd &
local jigger_pid=$!
local result
{
wait $cmd_pid 2>/dev/null
result=$?
ps -p$jigger_pid &>/dev/null && kill $jigger_pid
}
echo -e "\nThe command $cmd exited with $result."
return $result
}
travis_jigger() {
# helper method for travis_wait()
local cmd_pid=$1
shift
local timeout=$1 # in minutes
shift
local count=0
# clear the line
echo -e "\n"
while [ $count -lt $timeout ]; do
count=$(($count + 1))
echo -ne "."
sleep 60
done
echo -e "\nTimeout (${timeout} minutes) reached. Terminating \"$@\"\n"
kill -9 $cmd_pid
}
case "$TRAVIS_OS_NAME" in
linux)
export SDL_VIDEODRIVER=dummy;
SCRIPT_NAME="build-linux.sh"
;;
osx)
if [[ "$BUILD_ARCH" = 32bit ]] || [[ "$BUILD_ARCH" = lldebug ]]; then
export CFLAGS="-arch i386";
export CC="cc -arch i386";
export VERSIONER_PYTHON_PREFER_32_BIT=yes;
fi
# set up PKG_CONFIG_PATH in order to use openssl installed via Homebrew
export PKG_CONFIG_PATH=$(brew --prefix)/opt/openssl/lib/pkgconfig
SCRIPT_NAME="build-macos.sh"
;;
esac
if [[ -n "${TEST_TYPE}" ]]; then
SCRIPT_NAME="test.sh"
fi
travis_wait "${BASE}/${SCRIPT_NAME}"
if [[ "${PLUGINS}" = *"database_plugin"* ]]; then
"${BASE}/test_database_integration.sh"
fi