mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 00:03:11 +01:00
Update Travis configuration to use new mingw docker
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user