mirror of https://github.com/OpenRCT2/OpenRCT2.git
Script improvements (#14452)
shebang: Move parameters from set. Add newline after for consistency. curl: Add -f; Prevents output on error. Use -O where applicable; -o with the same filename as the URL is pointless. Add -S after -s: Makes curl still error despite being silent. build-symbols: Add zip fallback. get-discord-rpc: Move git clone parameters before repository for readability. Use --depth 1 to speed up cloning. install-nsis: Use ProgramData environment variable. build-appimage-docker.sh: Add -e to docker run. Run script directly. build-appimage.sh: Make if more consistent. Remove unused Travis scripts. setenv: unset instead of blanking variables. vstool.cmd: Use ProgramFiles(x86) environment variable.
This commit is contained in:
parent
1b64fc871b
commit
3188865313
|
@ -3605,7 +3605,7 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "version=\"1.0.20\"\nzipname=\"objects.zip\"\nliburl=\"https://github.com/OpenRCT2/objects/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/object\" || ! -e \"${SRCROOT}/objectsversion\" || $(head -n 1 \"${SRCROOT}/objectsversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/object\" ]]; then rm -r \"${SRCROOT}/data/object\"; fi\nmkdir -p \"${SRCROOT}/data/object\"\n\ncurl -L -o \"${SRCROOT}/data/object/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/object\" \"${SRCROOT}/data/object/$zipname\"\nrm \"${SRCROOT}/data/object/$zipname\"\n\necho $version > \"${SRCROOT}/objectsversion\"\nfi\n";
|
shellScript = "version=\"1.0.20\"\nzipname=\"objects.zip\"\nliburl=\"https://github.com/OpenRCT2/objects/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/object\" || ! -e \"${SRCROOT}/objectsversion\" || $(head -n 1 \"${SRCROOT}/objectsversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/object\" ]]; then rm -r \"${SRCROOT}/data/object\"; fi\nmkdir -p \"${SRCROOT}/data/object\"\n\ncurl -fLo \"${SRCROOT}/data/object/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/object\" \"${SRCROOT}/data/object/$zipname\"\nrm \"${SRCROOT}/data/object/$zipname\"\n\necho $version > \"${SRCROOT}/objectsversion\"\nfi\n";
|
||||||
};
|
};
|
||||||
C68B2D471EC790710020651C /* Download Libraries */ = {
|
C68B2D471EC790710020651C /* Download Libraries */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
@ -3619,7 +3619,7 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "version=\"28\"\nzipname=\"openrct2-libs-v28-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -L -o \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n";
|
shellScript = "version=\"28\"\nzipname=\"openrct2-libs-v28-x64-macos-dylibs.zip\"\nliburl=\"https://github.com/OpenRCT2/Dependencies/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/libxc\" || ! -e \"${SRCROOT}/libversion\" || $(head -n 1 \"${SRCROOT}/libversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/libxc\" ]]; then rm -r \"${SRCROOT}/libxc\"; fi\nmkdir \"${SRCROOT}/libxc\"\n\ncurl -fLo \"${SRCROOT}/libxc/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/libxc\" \"${SRCROOT}/libxc/$zipname\"\nrm \"${SRCROOT}/libxc/$zipname\"\n\necho $version > \"${SRCROOT}/libversion\"\nfi\n";
|
||||||
};
|
};
|
||||||
D42C09D21C254F4E00309751 /* Build g2.dat */ = {
|
D42C09D21C254F4E00309751 /* Build g2.dat */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
@ -3666,7 +3666,7 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "version=\"0.1.2c\"\nzipname=\"title-sequences.zip\"\nliburl=\"https://github.com/OpenRCT2/title-sequences/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/sequence\" || ! -e \"${SRCROOT}/sequencesversion\" || $(head -n 1 \"${SRCROOT}/sequencesversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/sequence\" ]]; then rm -r \"${SRCROOT}/data/sequence\"; fi\nmkdir -p \"${SRCROOT}/data/sequence\"\n\ncurl -L -o \"${SRCROOT}/data/sequence/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/sequence\" \"${SRCROOT}/data/sequence/$zipname\"\nrm \"${SRCROOT}/data/sequence/$zipname\"\n\necho $version > \"${SRCROOT}/sequencesversion\"\nfi\n";
|
shellScript = "version=\"0.1.2c\"\nzipname=\"title-sequences.zip\"\nliburl=\"https://github.com/OpenRCT2/title-sequences/releases/download/v$version/$zipname\"\n\n[[ ! -d \"${SRCROOT}/data/sequence\" || ! -e \"${SRCROOT}/sequencesversion\" || $(head -n 1 \"${SRCROOT}/sequencesversion\") != $version ]]\noutdated=$?\n\nif [[ $outdated -eq 0 ]]; then\nif [[ -d \"${SRCROOT}/data/sequence\" ]]; then rm -r \"${SRCROOT}/data/sequence\"; fi\nmkdir -p \"${SRCROOT}/data/sequence\"\n\ncurl -fLo \"${SRCROOT}/data/sequence/$zipname\" \"$liburl\"\nunzip -uaq -d \"${SRCROOT}/data/sequence\" \"${SRCROOT}/data/sequence/$zipname\"\nrm \"${SRCROOT}/data/sequence/$zipname\"\n\necho $version > \"${SRCROOT}/sequencesversion\"\nfi\n";
|
||||||
};
|
};
|
||||||
F76C809F1EC4DB0300FA49E2 /* Get Git Variables */ = {
|
F76C809F1EC4DB0300FA49E2 /* Get Git Variables */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
|
||||||
# Ensure we are in root directory
|
# Ensure we are in root directory
|
||||||
if [[ $(uname) == "Darwin" ]]; then
|
if [[ $(uname) == "Darwin" ]]; then
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
|
||||||
echo -e "\033[0;36mBuilding AppImage for OpenRCT2...\033[0m"
|
echo -e "\033[0;36mBuilding AppImage for OpenRCT2...\033[0m"
|
||||||
|
|
||||||
|
@ -8,7 +7,7 @@ basedir="$(readlink -f `dirname $0`/..)"
|
||||||
cd $basedir
|
cd $basedir
|
||||||
|
|
||||||
linuxdeploy=/tmp/linuxdeploy-x86_64.AppImage
|
linuxdeploy=/tmp/linuxdeploy-x86_64.AppImage
|
||||||
curl -Lo $linuxdeploy https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
curl -fLo $linuxdeploy https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
chmod +x $linuxdeploy
|
chmod +x $linuxdeploy
|
||||||
pushd bin
|
pushd bin
|
||||||
$linuxdeploy --appimage-extract-and-run --appdir install/ --output appimage --desktop-file install/usr/share/applications/openrct2.desktop
|
$linuxdeploy --appimage-extract-and-run --appdir install/ --output appimage --desktop-file install/usr/share/applications/openrct2.desktop
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
if [[ "$#" -gt 2 || "$1" == "-h" ]]; then
|
if [[ "$#" -gt 2 || "$1" == "-h" ]]; then
|
||||||
echo 'Create a Windows installer for OpenRCT2'
|
echo 'Create a Windows installer for OpenRCT2'
|
||||||
echo ''
|
echo ''
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
|
||||||
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
|
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
|
||||||
# Create a Windows symbols archive for OpenRCT2
|
# Create a Windows symbols archive for OpenRCT2
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
# Check 7z or zip is available
|
||||||
|
if [ -x "$(command -v 7z)" ]; then
|
||||||
|
archiver="7z a"
|
||||||
|
elif [ -x "$(command -v zip)" ]; then
|
||||||
|
archiver=zip
|
||||||
|
else
|
||||||
|
echo -e >&2 "\033[0;7z and zip not found\033[0m"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Create a Windows symbols archive for OpenRCT2
|
# Create a Windows symbols archive for OpenRCT2
|
||||||
basedir="$(readlink -f `dirname $0`/..)"
|
basedir="$(readlink -f `dirname $0`/..)"
|
||||||
|
@ -7,17 +16,11 @@ cd $basedir/bin
|
||||||
|
|
||||||
destination=../artifacts/openrct2-symbols-$CONFIGURATION-$PLATFORM.zip
|
destination=../artifacts/openrct2-symbols-$CONFIGURATION-$PLATFORM.zip
|
||||||
|
|
||||||
# Check 7z is available
|
|
||||||
if ! [ -x "$(command -v 7z)" ]; then
|
|
||||||
echo -e >&2 "\033[0;7z not found\033[0m"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo -e "\033[0;36mCreating symbols archive for OpenRCT2...\033[0m"
|
echo -e "\033[0;36mCreating symbols archive for OpenRCT2...\033[0m"
|
||||||
if [[ -f $destination ]]; then
|
if [[ -f $destination ]]; then
|
||||||
rm $destination
|
rm $destination
|
||||||
fi
|
fi
|
||||||
7z a $destination openrct2.exe openrct2.com openrct2-win.pdb
|
$archiver $destination openrct2.exe openrct2.com openrct2-win.pdb
|
||||||
|
|
||||||
destination=$(cygpath -w $(readlink -f $destination))
|
destination=$(cygpath -w $(readlink -f $destination))
|
||||||
printf '\033[0;32m%s\033[0m\n' "${destination} created successfully"
|
printf '\033[0;32m%s\033[0m\n' "${destination} created successfully"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/sh
|
#!/bin/sh -e
|
||||||
set -e
|
|
||||||
|
|
||||||
readlink_bin='readlink'
|
readlink_bin='readlink'
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
if [[ $(uname) == "Linux" ]]; then
|
if [[ $(uname) == "Linux" ]]; then
|
||||||
basedir="$(readlink -f `dirname $0`/..)"
|
basedir="$(readlink -f `dirname $0`/..)"
|
||||||
elif [[ $(uname) == "Darwin" ]]; then
|
elif [[ $(uname) == "Darwin" ]]; then
|
||||||
|
@ -10,5 +10,5 @@ else
|
||||||
fi
|
fi
|
||||||
cd $basedir
|
cd $basedir
|
||||||
|
|
||||||
git clone https://github.com/discordapp/discord-rpc -b v3.4.0
|
git clone --depth 1 -b v3.4.0 https://github.com/discordapp/discord-rpc
|
||||||
git clone https://github.com/janisozaur/rapidjson discord-rpc/thirdparty/rapidjson -b patch-1
|
git clone --depth 1 -b patch-1 https://github.com/janisozaur/rapidjson discord-rpc/thirdparty/rapidjson
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
if [[ "$#" -ne 0 && "$#" -ne 2 ]]; then
|
if [[ "$#" -ne 0 && "$#" -ne 2 ]]; then
|
||||||
echo 'Install a portable version of NSIS which can build the OpenRCT2 Windows installer.'
|
echo 'Install a portable version of NSIS which can build the OpenRCT2 Windows installer.'
|
||||||
echo ''
|
echo ''
|
||||||
|
@ -11,7 +11,7 @@ fi
|
||||||
|
|
||||||
if [[ "$1" == "-d" ]]; then
|
if [[ "$1" == "-d" ]]; then
|
||||||
echo -e "\033[0;36mDownloading prebuilt NSIS from GitHub...\033[0m"
|
echo -e "\033[0;36mDownloading prebuilt NSIS from GitHub...\033[0m"
|
||||||
curl -sLo nsis.zip "https://github.com/OpenRCT2/Dependencies/releases/download/v20/nsis.zip"
|
curl -sSfLO "https://github.com/OpenRCT2/Dependencies/releases/download/v20/nsis.zip"
|
||||||
7z -bd -y "-o$2" x nsis.zip
|
7z -bd -y "-o$2" x nsis.zip
|
||||||
rm nsis.zip
|
rm nsis.zip
|
||||||
echo -e "\033[0;32mNSIS downloaded, add "$2/bin" to PATH\033[0m"
|
echo -e "\033[0;32mNSIS downloaded, add "$2/bin" to PATH\033[0m"
|
||||||
|
@ -19,7 +19,7 @@ if [[ "$1" == "-d" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Download NSIS with chocolatey and then download extra plugins
|
# Download NSIS with chocolatey and then download extra plugins
|
||||||
nsisdir="C:/ProgramData/chocolatey/lib/nsis.portable"
|
nsisdir="$ProgramData/chocolatey/lib/nsis.portable"
|
||||||
if [[ -d $nsisdir ]]
|
if [[ -d $nsisdir ]]
|
||||||
then
|
then
|
||||||
echo -e "\033[0;36mNSIS already installed.\033[0m"
|
echo -e "\033[0;36mNSIS already installed.\033[0m"
|
||||||
|
@ -30,13 +30,13 @@ echo -e "\033[0;36mDownloading NSIS from chocolatey...\033[0m"
|
||||||
cinst nsis.portable --version=3.01-beta1
|
cinst nsis.portable --version=3.01-beta1
|
||||||
|
|
||||||
echo -e "\033[0;36mDownloading KillProcDLL for NSIS...\033[0m"
|
echo -e "\033[0;36mDownloading KillProcDLL for NSIS...\033[0m"
|
||||||
curl -sLo nsisxtra.zip "http://nsis.sourceforge.net/mediawiki/images/5/53/KillProcDll%26FindProcDll.zip"
|
curl -sSfLo nsisxtra.zip "http://nsis.sourceforge.net/mediawiki/images/5/53/KillProcDll%26FindProcDll.zip"
|
||||||
7z x nsisxtra.zip
|
7z x nsisxtra.zip
|
||||||
cp FindProcDLL.dll "$nsisdir/tools/nsis-3.0b1/Plugins/x86-ansi"
|
cp FindProcDLL.dll "$nsisdir/tools/nsis-3.0b1/Plugins/x86-ansi"
|
||||||
|
|
||||||
echo -e "\033[0;36mDownloading UAC plugin for NSIS...\033[0m"
|
echo -e "\033[0;36mDownloading UAC plugin for NSIS...\033[0m"
|
||||||
curl -sLo uac.zip "http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip"
|
curl -sSfLO "http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip"
|
||||||
7z x uac.zip
|
7z x UAC.zip
|
||||||
cp UAC.nsh "$nsisdir/tools/nsis-3.0b1/Include"
|
cp UAC.nsh "$nsisdir/tools/nsis-3.0b1/Include"
|
||||||
cp -r Plugins "$nsisdir/tools/nsis-3.0b1"
|
cp -r Plugins "$nsisdir/tools/nsis-3.0b1"
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,10 @@
|
||||||
#! /bin/bash
|
#!/bin/bash -ex
|
||||||
|
|
||||||
set -ex
|
|
||||||
|
|
||||||
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
|
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
|
||||||
|
|
||||||
docker run --rm -it -e NO_CLEANUP=1 -e CI=1 --device /dev/fuse:mrw -v $(readlink -f .):/ws openrct2/openrct2:ubuntu_amd64 bash -xc "
|
docker run --rm -it -e NO_CLEANUP=1 -e CI=1 --device /dev/fuse:mrw -v $(readlink -f .):/ws openrct2/openrct2:ubuntu_amd64 bash -exc "
|
||||||
cd /ws
|
cd /ws
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y wget libcairo2
|
apt-get install -y wget libcairo2
|
||||||
bash -xe scripts/linux/build-appimage.sh
|
scripts/linux/build-appimage.sh
|
||||||
"
|
"
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
#! /bin/bash
|
#!/bin/bash -ex
|
||||||
|
|
||||||
set -e
|
|
||||||
set -x
|
|
||||||
|
|
||||||
# use RAM disk if possible
|
# use RAM disk if possible
|
||||||
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
|
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
|
||||||
|
@ -18,7 +15,7 @@ cleanup () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
[ "$NO_CLEANUP" == "" ] && trap cleanup EXIT
|
if [ "$NO_CLEANUP" == "" ] && trap cleanup EXIT
|
||||||
|
|
||||||
# store repo root as variable
|
# store repo root as variable
|
||||||
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
|
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
|
||||||
|
|
|
@ -1,87 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
if [[ $TRAVIS != "true" ]]
|
|
||||||
then
|
|
||||||
echo This script is only meant to be run on Travis-CI.
|
|
||||||
echo Please use CMake to build the project.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cachedir=.cache
|
|
||||||
mkdir -p $cachedir
|
|
||||||
|
|
||||||
ci_env=`bash <(curl -s https://codecov.io/env)`
|
|
||||||
|
|
||||||
# Sets default target to "linux", if none specified
|
|
||||||
TARGET=${TARGET-linux}
|
|
||||||
|
|
||||||
if [[ ! -d build ]]; then
|
|
||||||
mkdir -p build
|
|
||||||
fi
|
|
||||||
|
|
||||||
PARENT=$(readlink -f ./)
|
|
||||||
chmod -R a+rwX "$(pwd)"
|
|
||||||
chmod -R g+s "$(pwd)"
|
|
||||||
|
|
||||||
pushd build
|
|
||||||
echo OPENRCT2_CMAKE_OPTS = "$OPENRCT2_CMAKE_OPTS"
|
|
||||||
if [[ $TARGET == "docker64" ]]
|
|
||||||
then
|
|
||||||
# CMAKE and MAKE opts from environment
|
|
||||||
docker run $ci_env -e CCACHE_DIR=/ccache -v $HOME/.ccache:/ccache -v "$PARENT":"$PARENT" -w "$PARENT"/build -i -t openrct2/openrct2:64bit-only bash -c "export PATH=/usr/lib/ccache/bin:\$PATH LD_PRELOAD=/usr/lib/libSegFault.so && ccache --show-stats > ccache_before && cmake ../ -DWITH_TESTS=on $OPENRCT2_CMAKE_OPTS && ninja all install $OPENRCT2_MAKE_OPTS && ccache --show-stats > ccache_after && ( diff -U100 ccache_before ccache_after || true ) && ./openrct2-cli scan-objects && ctest --output-on-failure && cd .. && bash <(curl -s https://codecov.io/bash) 2>\&1 | grep -v \"has arcs\""
|
|
||||||
elif [[ $TARGET == "ubuntu_i686" ]]
|
|
||||||
then
|
|
||||||
# CMAKE and MAKE opts from environment
|
|
||||||
docker run $ci_env -e CCACHE_DIR=/ccache -v $HOME/.ccache:/ccache -v "$PARENT":"$PARENT" -w "$PARENT"/build -i -t openrct2/openrct2:ubuntu_i686 bash -c "export PATH=/usr/lib/ccache:\$PATH && ccache --show-stats > ccache_before && cmake ../ -DWITH_TESTS=on $OPENRCT2_CMAKE_OPTS && ninja all testpaint install $OPENRCT2_MAKE_OPTS && ccache --show-stats > ccache_after && ( diff -U100 ccache_before ccache_after || true ) && LD_PRELOAD=/lib/i386-linux-gnu/libSegFault.so ./openrct2-cli scan-objects && LD_PRELOAD=/lib/i386-linux-gnu/libSegFault.so ctest --output-on-failure && ( LD_PRELOAD=/lib/i386-linux-gnu/libSegFault.so ./testpaint --quiet || if [[ \$? -eq 1 ]] ; then echo Allowing failed tests to pass ; else echo here ; false; fi ) && cd .. && bash <(curl -s https://codecov.io/bash)"
|
|
||||||
elif [[ $TARGET == "ubuntu_amd64" ]]
|
|
||||||
then
|
|
||||||
# CMAKE and MAKE opts from environment
|
|
||||||
docker run $ci_env -e CCACHE_DIR=/ccache -v $HOME/.ccache:/ccache -v "$PARENT":"$PARENT" -w "$PARENT"/build -i -t openrct2/openrct2:ubuntu_amd64 bash -c "export PATH=/usr/lib/ccache:\$PATH LD_PRELOAD=/lib/x86_64-linux-gnu/libSegFault.so && ccache --show-stats > ccache_before && cmake ../ -DWITH_TESTS=on $OPENRCT2_CMAKE_OPTS && ninja $OPENRCT2_MAKE_OPTS install && ccache --show-stats > ccache_after && ( diff -U100 ccache_before ccache_after || true ) && ./openrct2-cli scan-objects && ctest --output-on-failure && cd .. && bash <(curl -s https://codecov.io/bash)"
|
|
||||||
elif [[ $TARGET == "windows" ]]
|
|
||||||
then
|
|
||||||
# CMAKE and MAKE opts from environment
|
|
||||||
docker run -v "$PARENT":"$PARENT" -w "$PARENT"/build -i -t openrct2/openrct2:mingw-arch bash -c "cmake ../ $OPENRCT2_CMAKE_OPTS && ninja $OPENRCT2_MAKE_OPTS"
|
|
||||||
else
|
|
||||||
echo "Unknown target $TARGET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
popd
|
|
||||||
|
|
||||||
if [[ $TARGET == "windows" ]]; then
|
|
||||||
if [[ ! -h openrct2.dll ]]; then
|
|
||||||
ln -s build/openrct2.dll openrct2.dll
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -h build/data ]]; then
|
|
||||||
ln -s ../data build/data
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $TARGET == "ubuntu_i686" ]]; then
|
|
||||||
if [[ ! -h openrct2 ]]; then
|
|
||||||
ln -s build/openrct2 openrct2
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "$DISABLE_G2_BUILD" ]]; then
|
|
||||||
echo Building: g2.dat
|
|
||||||
pushd build
|
|
||||||
ninja g2
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $TARGET == "windows" ]]; then
|
|
||||||
if [[ -t 1 ]]; then
|
|
||||||
echo -e "\nDone! Run OpenRCT2 by typing:\n\n\033[95mwine openrct2.exe\n\033[0m"
|
|
||||||
else
|
|
||||||
echo -e "\nDone! Run OpenRCT2 by typing:\n\nwine openrct2.exe\n"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [[ -t 1 ]]; then
|
|
||||||
echo -e "\nDone! Run OpenRCT2 by typing:\n\n\033[95m./openrct2\n\033[0m"
|
|
||||||
else
|
|
||||||
echo -e "\nDone! Run OpenRCT2 by typing:\n\n./openrct2\n"
|
|
||||||
fi
|
|
||||||
fi
|
|
|
@ -1,17 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -ev
|
|
||||||
|
|
||||||
if [[ $TRAVIS != "true" ]]
|
|
||||||
then
|
|
||||||
echo This script is only meant to be run on Travis-CI.
|
|
||||||
echo Please use CMake to build the project.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
sudo rm -rf /usr/local/cross-tools/i686-w64-mingw32
|
|
||||||
sudo rm -rf /usr/local/cross-tools/orcalibs
|
|
||||||
sudo rm -rf /usr/local/cross-tools/orctlibs
|
|
||||||
rm -rf .cache
|
|
||||||
rm -rf build
|
|
|
@ -1,132 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
if [[ $TRAVIS != "true" ]]
|
|
||||||
then
|
|
||||||
echo This script is only meant to be run on Travis-CI.
|
|
||||||
echo Please use CMake to build the project.
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
cachedir=.cache
|
|
||||||
if [[ $(uname -s) == "Darwin" ]]; then
|
|
||||||
liburl=https://openrct2.io/files/orctlibs-osx.zip
|
|
||||||
else
|
|
||||||
liburl=https://openrct2.io/files/orctlibs.zip
|
|
||||||
fi
|
|
||||||
mkdir -p "$cachedir"
|
|
||||||
|
|
||||||
# Sets default target to "ubuntu_amd64", if none specified
|
|
||||||
TARGET=${TARGET-ubuntu_amd64}
|
|
||||||
|
|
||||||
function has_cmd {
|
|
||||||
command -v "$1" >/dev/null 2>&1
|
|
||||||
}
|
|
||||||
|
|
||||||
function calculate_sha256 {
|
|
||||||
if has_cmd "shasum"; then
|
|
||||||
command shasum -a 256 "$1" | cut -f1 -d" "
|
|
||||||
elif has_cmd "sha256sum"; then
|
|
||||||
command sha256sum "$1" | cut -f1 -d" "
|
|
||||||
else
|
|
||||||
echo "Please install either sha256sum or shasum to continue"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function download {
|
|
||||||
if has_cmd "curl"; then
|
|
||||||
curl -L -o "$2" "$1"
|
|
||||||
elif has_cmd "wget"; then
|
|
||||||
wget -O "$2" "$1"
|
|
||||||
else
|
|
||||||
echo "Please install either wget or curl to continue"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function download_libs {
|
|
||||||
if [[ ! -f $cachedir/orctlibs.zip ]]; then
|
|
||||||
download $liburl $cachedir/orctlibs.zip;
|
|
||||||
fi
|
|
||||||
if [[ ! -d $cachedir/orctlibs ]]; then
|
|
||||||
mkdir -p $cachedir/orctlibs
|
|
||||||
pushd $cachedir/orctlibs
|
|
||||||
unzip -uaq ../orctlibs.zip
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function mac_os_install_mingw_32 {
|
|
||||||
local mingw_name="mingw-w32-bin_i686-darwin"
|
|
||||||
local mingw_tar="${mingw_name}_20130531.tar.bz2"
|
|
||||||
local mingw_path="/usr/local/$mingw_name"
|
|
||||||
|
|
||||||
if [[ ! -f "$cachedir/$mingw_tar" ]]; then
|
|
||||||
download "https://downloads.sourceforge.net/project/mingw-w64/Toolchains targetting Win32/Automated Builds/$mingw_tar" "$cachedir/$mingw_tar"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ ! -d "$mingw_path" ]]; then
|
|
||||||
echo "Extracting contents of $mingw_tar to $mingw_path"
|
|
||||||
echo "Don't forget to add $mingw_path/bin to your PATH variable!"
|
|
||||||
|
|
||||||
mkdir "$mingw_path"
|
|
||||||
tar -xyf "$cachedir/$mingw_tar" -C "$mingw_path"
|
|
||||||
|
|
||||||
pushd "$mingw_path"
|
|
||||||
find . -type d -exec chmod 755 {} \;
|
|
||||||
popd
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "HOST = $(uname)"
|
|
||||||
echo "TARGET = $TARGET"
|
|
||||||
|
|
||||||
if [[ "$(uname)" == "Darwin" ]]; then
|
|
||||||
if ! has_cmd "brew"; then
|
|
||||||
echo "Homebrew is not installed, or brew is not in your \$PATH"
|
|
||||||
echo "install instructions: http://brew.sh/"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
brew install cmake
|
|
||||||
|
|
||||||
if [[ $TARGET == "windows" ]]; then
|
|
||||||
brew install wine
|
|
||||||
mac_os_install_mingw_32
|
|
||||||
else
|
|
||||||
brew install jansson sdl2 speex --universal
|
|
||||||
fi
|
|
||||||
elif [[ $(uname) == "Linux" ]]; then
|
|
||||||
# Clone discord-rpc for Discord's Rich Presence support
|
|
||||||
# Use tagged release to prevent upstream changes from breaking our code
|
|
||||||
git clone https://github.com/IntelOrca/discord-rpc -b fix/134-iothreadholder
|
|
||||||
# Use rapidjson with a hack for GCC 8, while awaiting a fix upstream:
|
|
||||||
# https://github.com/Tencent/rapidjson/issues/1205
|
|
||||||
git clone https://github.com/janisozaur/rapidjson discord-rpc/thirdparty/rapidjson -b patch-1
|
|
||||||
# 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
|
|
||||||
;;
|
|
||||||
"docker64")
|
|
||||||
docker pull openrct2/openrct2:64bit-only
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "unkown target $TARGET"
|
|
||||||
exit 1
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
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
|
|
||||||
# $(uname -s) == "Darwin"
|
|
||||||
fi
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
"""A wrapper script around clang-format, suitable for linting multiple files
|
"""A wrapper script around clang-format, suitable for linting multiple files
|
||||||
and to use for continuous integration.
|
and to use for continuous integration.
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
|
||||||
# Ensure we are in root directory
|
# Ensure we are in root directory
|
||||||
basedir="$(readlink -f `dirname $0`/..)"
|
basedir="$(readlink -f `dirname $0`/..)"
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
|
|
||||||
# Ensure we are in root directory
|
# Ensure we are in root directory
|
||||||
if [[ $(uname) == "Darwin" ]]; then
|
if [[ $(uname) == "Darwin" ]]; then
|
||||||
|
|
|
@ -22,10 +22,10 @@ get_build_number()
|
||||||
export OPENRCT2_BUILD=$(get_build_number)
|
export OPENRCT2_BUILD=$(get_build_number)
|
||||||
|
|
||||||
# Get the name of the branch and decide whether we should push the build to openrct2.org
|
# Get the name of the branch and decide whether we should push the build to openrct2.org
|
||||||
export OPENRCT2_TAG=
|
unset OPENRCT2_TAG
|
||||||
export OPENRCT2_PUSH=
|
unset OPENRCT2_PUSH
|
||||||
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
if [[ $GITHUB_REF == refs/tags/* ]]; then
|
||||||
export OPENRCT2_BRANCH=
|
unset OPENRCT2_BRANCH
|
||||||
export OPENRCT2_TAG=true
|
export OPENRCT2_TAG=true
|
||||||
export OPENRCT2_PUSH=true
|
export OPENRCT2_PUSH=true
|
||||||
else
|
else
|
||||||
|
@ -35,13 +35,13 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "$OPENRCT2_ORG_TOKEN" == "" ]]; then
|
if [[ "$OPENRCT2_ORG_TOKEN" == "" ]]; then
|
||||||
export OPENRCT2_PUSH=
|
unset OPENRCT2_PUSH
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Get the short SHA1
|
# Get the short SHA1
|
||||||
export OPENRCT2_SHA1=$GITHUB_SHA
|
export OPENRCT2_SHA1=$GITHUB_SHA
|
||||||
export OPENRCT2_SHA1_SHORT=${OPENRCT2_SHA1:0:7}
|
export OPENRCT2_SHA1_SHORT=${OPENRCT2_SHA1:0:7}
|
||||||
export OPENRCT2_VERSION_EXTRA=
|
unset OPENRCT2_VERSION_EXTRA
|
||||||
if [[ "$OPENRCT2_TAG" != "true" ]]; then
|
if [[ "$OPENRCT2_TAG" != "true" ]]; then
|
||||||
export OPENRCT2_VERSION_EXTRA=$OPENRCT2_BRANCH-$OPENRCT2_SHA1_SHORT
|
export OPENRCT2_VERSION_EXTRA=$OPENRCT2_BRANCH-$OPENRCT2_SHA1_SHORT
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env php
|
#!/usr/bin/env php
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
exec('grep -E "(RCT2_ADDRESS|RCT2_GLOBAL)[\(\s]+(0x[0-9a-zA-Z]+|[A-Z0-9_]+)" -r -o .', $lines);
|
exec('grep -E "(RCT2_ADDRESS|RCT2_GLOBAL)[\(\s]+(0x[0-9a-zA-Z]+|[A-Z0-9_]+)" -r -o .', $lines);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
if [[ "$#" -ne 1 ]]; then
|
if [[ "$#" -ne 1 ]]; then
|
||||||
echo 'Upload OpenRCT2 debug symbols to https://backtrace.io.'
|
echo 'Upload OpenRCT2 debug symbols to https://backtrace.io.'
|
||||||
echo ''
|
echo ''
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/bash
|
#!/bin/bash -e
|
||||||
set -e
|
|
||||||
if [[ "$#" -ne 4 && "$#" -ne 5 ]]; then
|
if [[ "$#" -ne 4 && "$#" -ne 5 ]]; then
|
||||||
echo 'Upload an OpenRCT2 build to openrct2.org.'
|
echo 'Upload an OpenRCT2 build to openrct2.org.'
|
||||||
echo ''
|
echo ''
|
||||||
|
|
|
@ -1,2 +1,3 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
vstool.cmd $@
|
vstool.cmd $@
|
||||||
|
|
|
@ -3,9 +3,9 @@
|
||||||
rem Invokes a tool within a Visual Studio prompt
|
rem Invokes a tool within a Visual Studio prompt
|
||||||
rem Uses %PLATFORM% to set architecture of prompt
|
rem Uses %PLATFORM% to set architecture of prompt
|
||||||
|
|
||||||
set "vspath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise"
|
set "vspath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Enterprise"
|
||||||
if exist "%vspath%" goto found
|
if exist "%vspath%" goto found
|
||||||
set "vspath=C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
|
set "vspath=%ProgramFiles(x86)%\Microsoft Visual Studio\2019\Community"
|
||||||
if exist "%vspath%" goto found
|
if exist "%vspath%" goto found
|
||||||
|
|
||||||
:notfound
|
:notfound
|
||||||
|
|
Loading…
Reference in New Issue