1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-29 09:44:52 +01:00

Add Linux portable to GitHub CI (#10612)

This commit is contained in:
Ted John
2020-01-24 11:46:12 +00:00
committed by GitHub
parent 5be2604f27
commit eab255c4bf
11 changed files with 210 additions and 114 deletions

View File

@@ -5,22 +5,33 @@ set -e
basedir="$(readlink -f `dirname $0`/..)"
cd $basedir
# Patch version.h
if [[ "$OPENRCT2_BUILD" != "" ]]; then
echo -e "\033[0;36mPatching version.h...\033[0m"
fileversion=$OPENRCT2_VERSION.$OPENRCT2_BUILD
productversion="$fileversion-${OPENRCT2_SHA1_SHORT}"
fileversion=${fileversion//./,}
echo "#define OPENRCT2_FILE_VERSION $fileversion" > "resources/version.h"
echo "#define OPENRCT2_PRODUCT_VERSION \"$productversion\"" >> "resources/version.h"
cat "resources/version.h"
if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then
# Patch version.h
if [[ "$OPENRCT2_BUILD" != "" ]]; then
echo -e "\033[0;36mPatching version.h...\033[0m"
fileversion=$OPENRCT2_VERSION.$OPENRCT2_BUILD
productversion="$fileversion-${OPENRCT2_SHA1_SHORT}"
fileversion=${fileversion//./,}
echo "#define OPENRCT2_FILE_VERSION $fileversion" > "resources/version.h"
echo "#define OPENRCT2_PRODUCT_VERSION \"$productversion\"" >> "resources/version.h"
cat "resources/version.h"
fi
# Build everything
echo -e "\033[0;36mBuilding OpenRCT2 for Windows $CONFIGURATION|$PLATFORM...\033[0m"
vstool msbuild openrct2.proj //t:build
# Create openrct2.exe and openrct2.com with correct subsystem
cp bin/openrct2.exe bin/openrct2.com
vstool editbin //subsystem:console bin/openrct2.com
vstool editbin //subsystem:windows bin/openrct2.exe
else
echo -e "\033[0;36mBuilding OpenRCT2...\033[0m"
mkdir -p bin && cd bin
export DESTDIR=install
cmake .. -G Ninja -DCMAKE_INSTALL_PREFIX=/usr "$@"
if [[ "$TESTPAINT" == "true" ]]; then
testpaint_target=testpaint
fi
ninja -v $testpaint_target all install
fi
# Build everything
echo -e "\033[0;36mBuilding OpenRCT2 for Windows $CONFIGURATION|$PLATFORM...\033[0m"
vstool msbuild openrct2.proj //t:build
# Create openrct2.exe and openrct2.com with correct subsystem
cp bin/openrct2.exe bin/openrct2.com
vstool editbin //subsystem:console bin/openrct2.com
vstool editbin //subsystem:windows bin/openrct2.exe