diff --git a/OpenRCT2.xcodeproj/project.pbxproj b/OpenRCT2.xcodeproj/project.pbxproj index df30e342b1..5e7d975780 100644 --- a/OpenRCT2.xcodeproj/project.pbxproj +++ b/OpenRCT2.xcodeproj/project.pbxproj @@ -3605,7 +3605,7 @@ ); runOnlyForDeploymentPostprocessing = 0; 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 */ = { isa = PBXShellScriptBuildPhase; @@ -3619,7 +3619,7 @@ ); runOnlyForDeploymentPostprocessing = 0; 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 */ = { isa = PBXShellScriptBuildPhase; @@ -3666,7 +3666,7 @@ ); runOnlyForDeploymentPostprocessing = 0; 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 */ = { isa = PBXShellScriptBuildPhase; diff --git a/scripts/build b/scripts/build index 160d7c331b..9274410488 100755 --- a/scripts/build +++ b/scripts/build @@ -1,5 +1,4 @@ -#!/bin/bash -set -e +#!/bin/bash -e # Ensure we are in root directory if [[ $(uname) == "Darwin" ]]; then diff --git a/scripts/build-appimage b/scripts/build-appimage index 498706c5ba..0bc94c9a14 100755 --- a/scripts/build-appimage +++ b/scripts/build-appimage @@ -1,5 +1,4 @@ -#!/bin/bash -set -e +#!/bin/bash -e echo -e "\033[0;36mBuilding AppImage for OpenRCT2...\033[0m" @@ -8,7 +7,7 @@ basedir="$(readlink -f `dirname $0`/..)" cd $basedir 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 pushd bin $linuxdeploy --appimage-extract-and-run --appdir install/ --output appimage --desktop-file install/usr/share/applications/openrct2.desktop diff --git a/scripts/build-installer b/scripts/build-installer index 49101bf4a5..2f2fb5adff 100755 --- a/scripts/build-installer +++ b/scripts/build-installer @@ -1,5 +1,5 @@ -#!/bin/bash -set -e +#!/bin/bash -e + if [[ "$#" -gt 2 || "$1" == "-h" ]]; then echo 'Create a Windows installer for OpenRCT2' echo '' diff --git a/scripts/build-portable b/scripts/build-portable index d1180b9dd5..bd4460cfa1 100755 --- a/scripts/build-portable +++ b/scripts/build-portable @@ -1,5 +1,4 @@ -#!/bin/bash -set -e +#!/bin/bash -e if [[ "$OSTYPE" == "cygwin" || "$OSTYPE" == "msys" ]]; then # Create a Windows symbols archive for OpenRCT2 diff --git a/scripts/build-symbols b/scripts/build-symbols index d3e28e446b..5fede436c6 100755 --- a/scripts/build-symbols +++ b/scripts/build-symbols @@ -1,5 +1,14 @@ -#!/bin/bash -set -e +#!/bin/bash -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 basedir="$(readlink -f `dirname $0`/..)" @@ -7,17 +16,11 @@ cd $basedir/bin 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" if [[ -f $destination ]]; then rm $destination 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)) printf '\033[0;32m%s\033[0m\n' "${destination} created successfully" diff --git a/scripts/check-code-formatting b/scripts/check-code-formatting index 04cc0e1a0d..86c2e64b22 100755 --- a/scripts/check-code-formatting +++ b/scripts/check-code-formatting @@ -1,5 +1,4 @@ -#!/bin/sh -set -e +#!/bin/sh -e readlink_bin='readlink' diff --git a/scripts/get-discord-rpc b/scripts/get-discord-rpc index 1305efacb2..cd785ff567 100755 --- a/scripts/get-discord-rpc +++ b/scripts/get-discord-rpc @@ -1,5 +1,5 @@ -#!/bin/bash -set -e +#!/bin/bash -e + if [[ $(uname) == "Linux" ]]; then basedir="$(readlink -f `dirname $0`/..)" elif [[ $(uname) == "Darwin" ]]; then @@ -10,5 +10,5 @@ else fi cd $basedir -git clone https://github.com/discordapp/discord-rpc -b v3.4.0 -git clone https://github.com/janisozaur/rapidjson discord-rpc/thirdparty/rapidjson -b patch-1 +git clone --depth 1 -b v3.4.0 https://github.com/discordapp/discord-rpc +git clone --depth 1 -b patch-1 https://github.com/janisozaur/rapidjson discord-rpc/thirdparty/rapidjson diff --git a/scripts/install-nsis b/scripts/install-nsis index 43a1ec2029..a31d6e3d18 100755 --- a/scripts/install-nsis +++ b/scripts/install-nsis @@ -1,5 +1,5 @@ -#!/bin/bash -set -e +#!/bin/bash -e + if [[ "$#" -ne 0 && "$#" -ne 2 ]]; then echo 'Install a portable version of NSIS which can build the OpenRCT2 Windows installer.' echo '' @@ -11,7 +11,7 @@ fi if [[ "$1" == "-d" ]]; then 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 rm nsis.zip echo -e "\033[0;32mNSIS downloaded, add "$2/bin" to PATH\033[0m" @@ -19,7 +19,7 @@ if [[ "$1" == "-d" ]]; then fi # 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 ]] then 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 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 cp FindProcDLL.dll "$nsisdir/tools/nsis-3.0b1/Plugins/x86-ansi" 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" -7z x uac.zip +curl -sSfLO "http://nsis.sourceforge.net/mediawiki/images/8/8f/UAC.zip" +7z x UAC.zip cp UAC.nsh "$nsisdir/tools/nsis-3.0b1/Include" cp -r Plugins "$nsisdir/tools/nsis-3.0b1" diff --git a/scripts/linux/build-appimage-docker.sh b/scripts/linux/build-appimage-docker.sh index 8ac54e010a..cde760edf4 100755 --- a/scripts/linux/build-appimage-docker.sh +++ b/scripts/linux/build-appimage-docker.sh @@ -1,12 +1,10 @@ -#! /bin/bash - -set -ex +#!/bin/bash -ex 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 apt-get update apt-get install -y wget libcairo2 -bash -xe scripts/linux/build-appimage.sh +scripts/linux/build-appimage.sh " diff --git a/scripts/linux/build-appimage.sh b/scripts/linux/build-appimage.sh index fd0da9511a..6d2b1529c7 100755 --- a/scripts/linux/build-appimage.sh +++ b/scripts/linux/build-appimage.sh @@ -1,7 +1,4 @@ -#! /bin/bash - -set -e -set -x +#!/bin/bash -ex # use RAM disk if possible if [ "$CI" == "" ] && [ -d /dev/shm ]; then @@ -18,7 +15,7 @@ cleanup () { fi } -[ "$NO_CLEANUP" == "" ] && trap cleanup EXIT +if [ "$NO_CLEANUP" == "" ] && trap cleanup EXIT # store repo root as variable REPO_ROOT=$(readlink -f $(dirname "$0")/../..) diff --git a/scripts/linux/build.sh b/scripts/linux/build.sh deleted file mode 100755 index bbc323b687..0000000000 --- a/scripts/linux/build.sh +++ /dev/null @@ -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 diff --git a/scripts/linux/clean.sh b/scripts/linux/clean.sh deleted file mode 100755 index 91bf63302b..0000000000 --- a/scripts/linux/clean.sh +++ /dev/null @@ -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 diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh deleted file mode 100755 index 438fd0a7b0..0000000000 --- a/scripts/linux/install.sh +++ /dev/null @@ -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 diff --git a/scripts/run-clang-format.py b/scripts/run-clang-format.py index 8f88bfc462..df3c498488 100755 --- a/scripts/run-clang-format.py +++ b/scripts/run-clang-format.py @@ -1,4 +1,5 @@ #!/usr/bin/env python3 + """A wrapper script around clang-format, suitable for linting multiple files and to use for continuous integration. diff --git a/scripts/run-testpaint b/scripts/run-testpaint index 479640a7ad..de0968afc3 100755 --- a/scripts/run-testpaint +++ b/scripts/run-testpaint @@ -1,5 +1,4 @@ -#!/bin/bash -set -e +#!/bin/bash -e # Ensure we are in root directory basedir="$(readlink -f `dirname $0`/..)" diff --git a/scripts/run-tests b/scripts/run-tests index 4317a8c1fd..e02f7d926b 100755 --- a/scripts/run-tests +++ b/scripts/run-tests @@ -1,5 +1,4 @@ -#!/bin/bash -set -e +#!/bin/bash -e # Ensure we are in root directory if [[ $(uname) == "Darwin" ]]; then diff --git a/scripts/setenv b/scripts/setenv index b7791237e2..fd9796599b 100755 --- a/scripts/setenv +++ b/scripts/setenv @@ -22,10 +22,10 @@ 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 -export OPENRCT2_TAG= -export OPENRCT2_PUSH= +unset OPENRCT2_TAG +unset OPENRCT2_PUSH if [[ $GITHUB_REF == refs/tags/* ]]; then - export OPENRCT2_BRANCH= + unset OPENRCT2_BRANCH export OPENRCT2_TAG=true export OPENRCT2_PUSH=true else @@ -35,13 +35,13 @@ else fi fi if [[ "$OPENRCT2_ORG_TOKEN" == "" ]]; then - export OPENRCT2_PUSH= + unset OPENRCT2_PUSH fi # Get the short SHA1 export OPENRCT2_SHA1=$GITHUB_SHA export OPENRCT2_SHA1_SHORT=${OPENRCT2_SHA1:0:7} -export OPENRCT2_VERSION_EXTRA= +unset OPENRCT2_VERSION_EXTRA if [[ "$OPENRCT2_TAG" != "true" ]]; then export OPENRCT2_VERSION_EXTRA=$OPENRCT2_BRANCH-$OPENRCT2_SHA1_SHORT fi diff --git a/scripts/stats/count-rct-globals.php b/scripts/stats/count-rct-globals.php index ea04033d53..99ae2f901b 100755 --- a/scripts/stats/count-rct-globals.php +++ b/scripts/stats/count-rct-globals.php @@ -1,4 +1,5 @@ #!/usr/bin/env php +