2015-11-26 11:22:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -ex
|
|
|
|
|
2016-01-17 10:53:27 +00:00
|
|
|
linux_32_before_install() {
|
2015-11-26 11:22:21 +00:00
|
|
|
# Build worker is 64-bit only by default it seems.
|
|
|
|
sudo dpkg --add-architecture i386
|
|
|
|
|
2016-02-11 20:38:07 +00:00
|
|
|
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
|
|
|
|
2015-11-26 11:22:21 +00:00
|
|
|
# Compilers
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
sudo apt-key adv --fetch-keys http://llvm.org/apt/llvm-snapshot.gpg.key
|
|
|
|
sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-${VERSION} main"
|
2016-02-11 20:38:07 +00:00
|
|
|
# g++-4.9-multilib is necessary for compiler dependencies. 4.8 currently
|
|
|
|
# has dependency issues, but 4.9 from the toolchain repo seems to work
|
|
|
|
# fine, so let's just use that.
|
|
|
|
COMPILER_PACKAGE="clang-${VERSION} g++-4.9-multilib"
|
2015-11-26 11:22:21 +00:00
|
|
|
fi
|
|
|
|
if [ "${CXX}" = "g++" ]; then
|
|
|
|
COMPILER_PACKAGE="g++-${VERSION}-multilib"
|
|
|
|
fi
|
|
|
|
|
2016-03-03 22:21:44 +00:00
|
|
|
# apt-get update fails because Chrome is 64-bit only.
|
|
|
|
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
|
|
|
|
|
2015-11-26 11:22:21 +00:00
|
|
|
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.
|
2016-05-16 22:44:10 +00:00
|
|
|
sudo apt-get -y install \
|
2015-11-26 11:22:21 +00:00
|
|
|
gir1.2-freedesktop:i386 \
|
|
|
|
gir1.2-gdkpixbuf-2.0:i386 \
|
|
|
|
gir1.2-glib-2.0:i386 \
|
|
|
|
libcairo2-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 \
|
|
|
|
libgtk2.0-dev:i386 \
|
|
|
|
liblzma-dev:i386 \
|
|
|
|
libpng12-dev:i386 \
|
|
|
|
libsdl2-dev:i386 \
|
|
|
|
libsoundtouch-dev:i386 \
|
|
|
|
libwxgtk3.0-dev:i386 \
|
|
|
|
libxext-dev:i386 \
|
|
|
|
portaudio19-dev:i386 \
|
|
|
|
zlib1g-dev:i386 \
|
|
|
|
${COMPILER_PACKAGE}
|
2016-05-16 22:44:10 +00:00
|
|
|
|
|
|
|
# Manually add ccache symlinks for clang
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CXX}-${VERSION}
|
|
|
|
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CC}-${VERSION}
|
|
|
|
fi
|
2015-11-26 11:22:21 +00:00
|
|
|
}
|
|
|
|
|
2016-01-17 10:53:27 +00:00
|
|
|
linux_32_script() {
|
2015-11-26 11:22:21 +00:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
2016-05-16 22:44:10 +00:00
|
|
|
# Prevents warning spam
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
export CCACHE_CPP2=yes
|
|
|
|
fi
|
2015-11-26 11:22:21 +00:00
|
|
|
export CC=${CC}-${VERSION} CXX=${CXX}-${VERSION}
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2016-01-17 10:53:27 +00:00
|
|
|
|
|
|
|
linux_64_before_install() {
|
|
|
|
# Compilers
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
sudo apt-key adv --fetch-keys http://llvm.org/apt/llvm-snapshot.gpg.key
|
|
|
|
sudo add-apt-repository -y "deb http://llvm.org/apt/trusty/ llvm-toolchain-trusty-${VERSION} main"
|
|
|
|
COMPILER_PACKAGE="clang-${VERSION}"
|
|
|
|
fi
|
|
|
|
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.
|
2016-05-16 22:44:10 +00:00
|
|
|
sudo apt-get -y install \
|
2016-01-17 10:53:27 +00:00
|
|
|
libaio-dev \
|
|
|
|
libasound2-dev \
|
|
|
|
libgtk2.0-dev \
|
|
|
|
libpng12-dev \
|
|
|
|
libsdl2-dev \
|
|
|
|
libsoundtouch-dev \
|
|
|
|
libwxgtk3.0-dev \
|
|
|
|
portaudio19-dev \
|
|
|
|
${COMPILER_PACKAGE}
|
2016-05-16 22:44:10 +00:00
|
|
|
|
|
|
|
# Manually add ccache symlinks for clang
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CXX}-${VERSION}
|
|
|
|
sudo ln -sf ../../bin/ccache /usr/lib/ccache/${CC}-${VERSION}
|
|
|
|
fi
|
2016-01-17 10:53:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
linux_64_script() {
|
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
|
2016-05-16 22:44:10 +00:00
|
|
|
# Prevents warning spam
|
|
|
|
if [ "${CXX}" = "clang++" ]; then
|
|
|
|
export CCACHE_CPP2=yes
|
|
|
|
fi
|
2016-01-17 10:53:27 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2016-05-16 22:44:10 +00:00
|
|
|
linux_after_success() {
|
|
|
|
ccache -s
|
|
|
|
}
|
|
|
|
|
2015-11-26 11:22:21 +00:00
|
|
|
# Just in case I do manual testing and accidentally insert "rm -rf /"
|
|
|
|
case "${1}" in
|
|
|
|
before_install|script)
|
2016-01-17 10:53:27 +00:00
|
|
|
${TRAVIS_OS_NAME}_${BITS}_${1}
|
2015-11-26 11:22:21 +00:00
|
|
|
;;
|
2016-05-16 22:44:10 +00:00
|
|
|
after_success)
|
|
|
|
${TRAVIS_OS_NAME}_${1}
|
|
|
|
;;
|
2015-11-26 11:22:21 +00:00
|
|
|
*)
|
|
|
|
echo "Unknown command" && false
|
|
|
|
;;
|
|
|
|
esac
|