File: travis.sh

package info (click to toggle)
pcsx2 1.6.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 28,424 kB
  • sloc: cpp: 299,797; ansic: 23,973; lisp: 2,689; asm: 908; perl: 852; sh: 789; xml: 116; makefile: 60
file content (156 lines) | stat: -rwxr-xr-x 3,648 bytes parent folder | download
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
#!/bin/sh

set -ex

# Disabled for now
clang_syntax_check() {
	if [ "${CXX}" = "clang++" ]; then
        ./linux_various/check_format.sh
	fi
}

linux_32_before_install() {
	# Build worker is 64-bit only by default it seems.
	sudo dpkg --add-architecture i386

	sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test

	# Compilers
	if [ "${CXX}" = "clang++" ]; then
		#sudo apt-key adv --fetch-keys http://apt.llvm.org/llvm-snapshot.gpg.key
		#sudo add-apt-repository -y "deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-${VERSION} main"
		#COMPILER_PACKAGE="g++-8-multilib clang-format-${VERSION}"
		COMPILER_PACKAGE="g++-8-multilib"
	fi
	if [ "${CXX}" = "g++" ]; then
		COMPILER_PACKAGE="g++-${VERSION}-multilib"
	fi

	sudo apt-get -qq update

	# The 64-bit versions of the first 7 dependencies are part of the initial
	# build image. libgtk2.0-dev:i386 and libsdl2-dev:i386 require the 32-bit
	# versions of the dependencies, and the 2 versions conflict. So those
	# dependencies must be explicitly installed.
	# Sometimes it complains about Python so we install that too.
	sudo apt-get -y install \
		gir1.2-freedesktop:i386 \
		gir1.2-gdkpixbuf-2.0:i386 \
		gir1.2-glib-2.0:i386 \
		libcairo2-dev:i386 \
		libegl1-mesa-dev:i386 \
		libgdk-pixbuf2.0-dev:i386 \
		libgirepository-1.0-1:i386 \
		libglib2.0-dev:i386 \
		libaio-dev:i386 \
		libasound2-dev:i386 \
		libgl1-mesa-dev:i386 \
		libglu1-mesa-dev:i386 \
		libgtk2.0-dev:i386 \
		liblzma-dev:i386 \
		libharfbuzz-dev:i386 \
		libpango1.0-dev:i386 \
		libpng12-dev:i386 \
		libsdl2-dev:i386 \
		libsoundtouch-dev:i386 \
		libwxgtk3.0-dev:i386 \
		libxext-dev:i386 \
		libxft-dev:i386 \
		portaudio19-dev:i386 \
		python:i386 \
		zlib1g-dev:i386 \
		libxml2-dev:i386 \
		libpcap0.8-dev:i386 \
		${COMPILER_PACKAGE}

	# Manually add ccache symlinks for clang
	if [ "${CXX}" = "clang++" ]; then
		sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CXX}
		sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CC}
	fi
}

linux_32_script() {
	mkdir build
	cd build

	# Prevents warning spam
	if [ "${CXX}" = "clang++" ]; then
		export CCACHE_CPP2=yes
		export CC=${CC} CXX=${CXX}
	else
		export CC=${CC}-${VERSION} CXX=${CXX}-${VERSION}
	fi
	cmake \
		-DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_REPLAY_LOADERS=TRUE \
		-DCMAKE_BUILD_PO=FALSE \
		..

	# Documentation says 1.5 cores, so 2 or 3 threads should work ok.
	make -j3 install
}


linux_64_before_install() {
	# Compilers
	if [ "${CXX}" = "g++" ]; then
		sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
		COMPILER_PACKAGE="g++-${VERSION}"
	fi

	sudo apt-get -qq update

	# libgl1-mesa-dev, liblzma-dev, libxext-dev, zlib1g-dev already installed on
	# build worker, I put these here in case the build image changes.
	sudo apt-get -y install \
		libaio-dev \
		libasound2-dev \
		libegl1-mesa-dev \
		libgtk2.0-dev \
		libpng12-dev \
		libsdl2-dev \
		libsoundtouch-dev \
		libwxgtk3.0-dev \
		portaudio19-dev \
		libxml2-dev \
		libpcap0.8-dev \
		${COMPILER_PACKAGE}
}


linux_64_script() {
	mkdir build
	cd build

	export CC=${CC}-${VERSION} CXX=${CXX}-${VERSION}
	cmake \
		-DCMAKE_BUILD_TYPE=Devel \
		-DBUILD_REPLAY_LOADERS=TRUE \
		-DCMAKE_BUILD_PO=FALSE \
		..

	# Documentation says 1.5 cores, so 2 or 3 threads should work ok.
	make -j3 install
}

linux_after_success() {
	ccache -s
}

# Just in case I do manual testing and accidentally insert "rm -rf /"
case "${1}" in
before_install|script)
	${TRAVIS_OS_NAME}_${BITS}_${1}
	;;
before_script)
#    clang_syntax_check
    ;;
after_success)
	${TRAVIS_OS_NAME}_${1}
	;;
*)
	echo "Unknown command" && false
	;;
esac