Update Travis configuration to use new mingw docker

This commit is contained in:
Michał Janiszewski 2017-04-16 08:50:44 +02:00
parent 0d4dd5849a
commit ada2569412
2 changed files with 24 additions and 137 deletions

View File

@ -20,46 +20,6 @@ if [[ ! -d build ]]; then
mkdir -p build
fi
if [[ $TARGET != "ubuntu_i686" && $TARGET != "docker32" && $SYSTEM != "Darwin" ]]; then
sha256sum=c71bb6b488376853252a00f3ed216e09d645f71357ea76b9b55c56e40b4f44ca
libVFile="./libversion"
libdir="./lib"
currentversion=0
needsdownload="true"
if [ -f $libVFile ]; then
while read line; do
currentversion=$line
continue
done < $libVFile
fi
if [ "z$currentversion" == "z$sha256sum" ]; then
needsdownload="false"
fi
if [ ! -d $libdir ]; then
needsdownload="true"
fi
if [[ "$needsdownload" = "true" ]]; then
echo "Found library had sha256sum $currentversion, expected $sha256sum"
echo "New libraries need to be downloaded. Clearing cache and calling ./install.sh"
rm -rf ./lib
if [[ -f $cachedir/orctlibs.zip ]]; then
rm -rf $cachedir/orctlibs.zip
fi
if [[ -d /usr/local/cross-tools/orctlibs ]]; then
sudo rm -rf /usr/local/cross-tools/orctlibs
fi
if [[ -d $cachedir/orctlibs ]]; then
rm -rf $cachedir/orctlibs
fi
scripts/linux/install.sh
fi
# if [[ $TARGET != "linux" && $TARGET != "docker32" && $SYSTEM != "Darwin" ]]; then
fi
pushd build
echo OPENRCT2_CMAKE_OPTS = $OPENRCT2_CMAKE_OPTS
if [[ $TARGET == "docker32" ]]
@ -96,7 +56,7 @@ pushd build
chmod a+rwx $(pwd)
chmod g+s $(pwd)
# CMAKE and MAKE opts from environment
docker run -v /usr/local/cross-tools/:/usr/local/cross-tools/ -v $PARENT:$PARENT -w $PARENT/build -i -t openrct2/openrct2:mingw bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS"
docker run -v $PARENT:$PARENT -w $PARENT/build -i -t openrct2/openrct2:mingw-arch bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && make $OPENRCT_MAKE_OPTS"
else
echo "Unkown target $TARGET"
exit 1

View File

@ -50,36 +50,6 @@ function download {
fi
}
function download_sdl {
if [[ ! -f $cachedir/SDL2-devel-${SDL2_PV}-mingw.tar.gz ]]; then
download http://libsdl.org/release/SDL2-devel-${SDL2_PV}-mingw.tar.gz $cachedir/SDL2-devel-${SDL2_PV}-mingw.tar.gz;
fi
if [[ ! -f $cachedir/SDL2_ttf-devel-${SDL2_TTF_PV}-mingw.tar.gz ]]; then
download https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-devel-${SDL2_TTF_PV}-mingw.tar.gz $cachedir/SDL2_ttf-devel-${SDL2_TTF_PV}-mingw.tar.gz;
fi
if [[ ! -d $cachedir/SDL2-${SDL2_PV} ]]; then
pushd $cachedir
tar -xzf SDL2-devel-${SDL2_PV}-mingw.tar.gz
popd
fi
if [[ ! -d $cachedir/SDL2_ttf-${SDL2_TTF_PV} ]]; then
pushd $cachedir
tar -xzf SDL2_ttf-devel-${SDL2_TTF_PV}-mingw.tar.gz
popd
fi
# Apply platform patch
mingw_patch=libsdl2-mingw-2.0.3-fix-platform-detection-for-mingw.patch
if [[ ! -f $cachedir/$mingw_patch ]]; then
download "https://github.com/anyc/anyc-overlay/raw/master/media-libs/libsdl2-mingw/files/$mingw_patch" $cachedir/$mingw_patch;
# XXX not sure how to make this idempotent.
pushd $cachedir/SDL2-${SDL2_PV}/i686-w64-mingw32/include/SDL2/
echo "Applying patch."
patch -p2 < ../../../../$mingw_patch
popd
fi
}
function download_libs {
if [[ ! -f $cachedir/orctlibs.zip ]]; then
download $liburl $cachedir/orctlibs.zip;
@ -92,35 +62,6 @@ function download_libs {
fi
}
function install_cross_tools {
if [[ ! -d /usr/local/cross-tools ]]; then
sudo mkdir -p /usr/local/cross-tools
fi
if [[ ! -d /usr/local/cross-tools/i686-w64-mingw32 ]]; then
sudo cp -r $cachedir/SDL2-${SDL2_PV}/i686-w64-mingw32 /usr/local/cross-tools/
sudo cp -r $cachedir/SDL2_ttf-${SDL2_TTF_PV}/i686-w64-mingw32 /usr/local/cross-tools/
fi
if [[ ! -d /usr/local/cross-tools/orctlibs ]]; then
sudo mkdir -p /usr/local/cross-tools/orctlibs
sudo cp -rf $cachedir/orctlibs/glob/* /usr/local/cross-tools/orctlibs/.
fi
}
function install_pkg_config {
if [[ ! -f $cachedir/i686-w64-mingw32-pkg-config ]]; then
# If this fails to work because of newlines, be sure you are running this
# script with Bash, and not sh. We should really move this to a separate
# file.
echo -e "#!/bin/sh\nexport PKG_CONFIG_PATH=/usr/local/cross-tools/i686-w64-mingw32/lib/pkgconfig:/usr/local/cross-tools/orctlibs/lib/pkgconfig\npkg-config \$@" > $cachedir/i686-w64-mingw32-pkg-config;
fi
chmod +x $cachedir/i686-w64-mingw32-pkg-config
sudo cp $cachedir/i686-w64-mingw32-pkg-config /usr/local/bin/
ls -al /usr/local/bin | grep pkg-config
cat /usr/local/bin/i686-w64-mingw32-pkg-config
}
function mac_os_install_mingw_32 {
local mingw_name="mingw-w32-bin_i686-darwin"
local mingw_tar="${mingw_name}_20130531.tar.bz2"
@ -162,47 +103,33 @@ if [[ "$(uname)" == "Darwin" ]]; then
brew install jansson sdl2 sdl2_ttf speex --universal
fi
elif [[ $(uname) == "Linux" ]]; then
if [[ -z "$TRAVIS" ]]; then
sudo apt-get install -y binutils-mingw-w64-i686 gcc-mingw-w64-i686 g++-mingw-w64-i686 cmake
if [[ -z "$DISABLE_G2_BUILD" ]]; then
sudo apt-get install -y wine
fi
else
# prevent build.sh from re-doing all the steps again
case "$TARGET" in
"ubuntu_i686")
docker pull openrct2/openrct2:ubuntu_i686
;;
"ubuntu_amd64")
docker pull openrct2/openrct2:ubuntu_amd64
;;
"windows")
docker pull openrct2/openrct2:mingw
;;
"docker32")
docker pull openrct2/openrct2:32bit-only
;;
"docker64")
docker pull openrct2/openrct2:64bit-only
;;
*)
echo "unkown target $TARGET"
exit 1
esac
fi
# prevent build.sh from re-doing all the steps again
case "$TARGET" in
"ubuntu_i686")
docker pull openrct2/openrct2:ubuntu_i686
;;
"ubuntu_amd64")
docker pull openrct2/openrct2:ubuntu_amd64
;;
"windows")
docker pull openrct2/openrct2:mingw-arch
;;
"docker32")
docker pull openrct2/openrct2:32bit-only
;;
"docker64")
docker pull openrct2/openrct2:64bit-only
;;
*)
echo "unkown target $TARGET"
exit 1
esac
fi
if [[ $TARGET == "windows" || $(uname -s) == "Darwin" ]]; then
if [[ $(uname -s) == "Darwin" ]]; then
download_libs
calculate_sha256 "$cachedir/orctlibs.zip" > "$libVFile"
echo "Downloaded library with sha256sum: $(cat "$libVFile")"
# Local libs are required for all targets
# $TARGET == "windows" || $(uname -s) == "Darwin"
fi
if [[ $TARGET == "windows" ]]; then
download_sdl
install_cross_tools
install_pkg_config
# $TARGET == "windows"
# $(uname -s) == "Darwin"
fi