Skip to content

Commit

Permalink
Merge branch 'master' into jgrpp
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/workflows/ci-build.yml
#	.github/workflows/release-linux.yml
#	.github/workflows/release-macos.yml
#	.github/workflows/release-windows.yml
#	.gitignore
#	COMPILING.md
#	src/company_gui.cpp
#	src/date_gui.cpp
#	src/engine.cpp
#	src/engine_func.h
#	src/fileio.cpp
#	src/linkgraph/linkgraph_gui.h
#	src/newgrf_debug_gui.cpp
#	src/newgrf_gui.cpp
#	src/order_gui.cpp
#	src/osk_gui.cpp
#	src/rail_gui.cpp
#	src/road_gui.cpp
#	src/script/api/script_event_types.hpp
#	src/sl/oldloader_sl.cpp
#	src/smallmap_gui.cpp
#	src/station_cmd.cpp
#	src/toolbar_gui.cpp
#	src/town_gui.cpp
#	src/transparency_gui.cpp
#	src/vehicle_gui.cpp
#	src/widget.cpp
#	src/widget_type.h
#	src/widgets/dropdown.cpp
#	src/widgets/dropdown_func.h
#	src/widgets/dropdown_type.h
#	src/widgets/group_widget.h
#	src/widgets/vehicle_widget.h
#	src/window.cpp
#	src/window_gui.h
#	src/window_type.h
  • Loading branch information
JGRennison committed Jan 2, 2024
2 parents 3611770 + 502a52e commit 42c8f50
Show file tree
Hide file tree
Showing 179 changed files with 2,190 additions and 1,826 deletions.
100 changes: 39 additions & 61 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:

name: Linux (${{ matrix.name }})

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
env:
CC: ${{ matrix.compiler }}
CXX: ${{ matrix.cxxcompiler }}
Expand All @@ -128,6 +128,14 @@ jobs:
with:
ref: ${{ github.event.inputs.ref }}

- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
run: |
echo "::group::Update apt"
Expand All @@ -147,6 +155,16 @@ jobs:
${{ matrix.libraries }} \
zlib1g-dev \
# EOF
echo "::group::Install vcpkg dependencies"
# Disable vcpkg integration, as we mostly use system libraries.
mv vcpkg.json vcpkg-disabled.json
# We only use breakpad from vcpkg, as its CMake files
# are a bit special. So the Ubuntu's variant doesn't work.
#vcpkg install breakpad
echo "::endgroup::"
env:
DEBIAN_FRONTEND: noninteractive
Expand Down Expand Up @@ -185,10 +203,15 @@ jobs:
- name: Test
run: |
cd build
ctest -j $(nproc) --timeout 120
(
cd build
ctest -j $(nproc) --timeout 120
)
# Re-enable vcpkg.
mv vcpkg-disabled.json vcpkg.json
# Check no tracked files have been modified
# Check no tracked files have been modified.
git diff --exit-code
macos:
Expand Down Expand Up @@ -216,38 +239,13 @@ jobs:
with:
ref: ${{ github.event.inputs.ref }}

- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
pkg-config \
# EOF
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
run: |
vcpkg install --triplet=${{ matrix.arch }}-osx \
curl \
liblzma \
libpng \
lzo \
zlib \
zstd \
# EOF
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install OpenGFX
run: |
Expand Down Expand Up @@ -312,33 +310,13 @@ jobs:
with:
ref: ${{ github.event.inputs.ref }}

- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
- name: Prepare vcpkg
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
zlib \
zstd \
# EOF
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install OpenGFX
shell: bash
Expand Down
91 changes: 53 additions & 38 deletions .github/workflows/release-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@ jobs:
linux:
name: Linux (Generic)

runs-on: ubuntu-20.04
runs-on: ubuntu-latest
container:
# manylinux2014 is based on CentOS 7, but already has a lot of things
# installed and preconfigured. It makes it easier to build OpenTTD.
image: quay.io/pypa/manylinux2014_x86_64
volumes:
- /usr/local/share/vcpkg:/vcpkg
env:
ImageOS: ${{ env.ImageOS }}
ImageVersion: ${{ env.ImageVersion }}

steps:
- name: Download source
Expand All @@ -33,18 +28,37 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Prepare cache key
id: key
# curl is too old for most of the tools to work properly. For example,
# rust-toolchain doesn't work properly, neither vcpkg caching.
# The easier solution here is to upgrade curl.
- name: Update curl
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
yum install -y \
openssl-devel \
# EOF
mkdir /curl
cd /curl
curl -o curl-7.81.0.zip https://curl.se/download/curl-7.81.0.zip
unzip curl-7.81.0.zip
cd curl-7.81.0
./configure --with-ssl --with-zlib --prefix=/usr --libdir=/usr/lib64
make -j $(nproc)
make install
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2

- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
path: /vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-release
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
run: |
Expand Down Expand Up @@ -84,6 +98,14 @@ jobs:
cmake --build . -j $(nproc)
cmake --install .
)
# The container we use is old enough, that it doesn't know SHF_COMPRESSED.
# But, breakpad needs this symbol to exist. So we patch it in our system
# libraries.
(
cd /
patch -p1 < ${GITHUB_WORKSPACE}/os/linux/shf-compressed.patch
)
echo "::endgroup::"
echo "::group::Install audio drivers"
Expand All @@ -100,29 +122,22 @@ jobs:
# We use vcpkg for our dependencies, to get more up-to-date version.
echo "::group::Install vcpkg and dependencies"
# Make Python3 available for other packages.
/vcpkg/vcpkg install python3
ln -sf /vcpkg/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
# SDL2 needs dbus, but dbus default install comes with libsystemd
# and some of libsystemd deps fail to build on our quite old linux.
# So just install basic dbus without any extra deps.
/vcpkg/vcpkg install dbus[core]
# Now we can install OpenTTD dependencies
/vcpkg/vcpkg install \
curl[http2] \
fontconfig \
freetype \
harfbuzz \
icu \
liblzma \
libpng \
lzo \
sdl2 \
zlib \
zstd \
# EOF
git clone https://github.com/microsoft/vcpkg /vcpkg
(
cd /vcpkg
./bootstrap-vcpkg.sh -disableMetrics
)
# Make Python3 available for other packages. This needs to be done
# first, as otherwise dependencies fail to build because Python3 is
# not available.
(
cd /
/vcpkg/vcpkg install python3
ln -sf /vcpkg/installed/x64-linux/tools/python3/python3.[0-9][0-9] /usr/bin/python3
)
echo "::endgroup::"
- name: Install GCC problem matcher
Expand Down
48 changes: 15 additions & 33 deletions .github/workflows/release-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
macos:
name: MacOS

runs-on: macos-12
runs-on: macos-latest
env:
MACOSX_DEPLOYMENT_TARGET: 10.13

Expand All @@ -26,45 +26,27 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Enable Rust cache
uses: Swatinem/rust-cache@v2

- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Install dependencies
env:
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
pandoc \
pkg-config \
# EOF
- name: Prepare cache key
id: key
run: |
echo "image=$ImageOS-$ImageVersion" >> $GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
with:
path: /usr/local/share/vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-release-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-release
${{ steps.key.outputs.image }}-vcpkg-x64
- name: Prepare vcpkg
run: |
vcpkg install \
curl:x64-osx \
curl:arm64-osx \
liblzma:x64-osx \
liblzma:arm64-osx \
libpng:x64-osx \
libpng:arm64-osx \
lzo:x64-osx \
lzo:arm64-osx \
zlib:x64-osx \
zlib:arm64-osx \
zstd:x64-osx \
zstd:arm64-osx \
# EOF
- name: Install GCC problem matcher
Expand Down
45 changes: 12 additions & 33 deletions .github/workflows/release-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,45 +39,24 @@ jobs:
run: |
tar -xf source.tar.gz --strip-components=1
- name: Install dependencies
shell: bash
run: |
choco install pandoc
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

- name: Prepare cache key
id: key
shell: powershell
run: |
# Work around caching failure with GNU tar
New-Item -Type Junction -Path vcpkg -Target c:\vcpkg
- name: Enable Rust cache
uses: Swatinem/rust-cache@v2

Write-Output "image=$env:ImageOS-$env:ImageVersion" >> $env:GITHUB_OUTPUT
- name: Enable vcpkg cache
uses: actions/cache@v3
- name: Setup vcpkg caching
uses: actions/github-script@v6
with:
path: vcpkg/installed
key: ${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}-1 # Increase the number whenever dependencies are modified
restore-keys: |
${{ steps.key.outputs.image }}-vcpkg-${{ matrix.arch }}
script: |
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
core.exportVariable('VCPKG_BINARY_SOURCES', 'clear;x-gha,readwrite')
- name: Prepare vcpkg
- name: Install dependencies
shell: bash
run: |
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
liblzma \
libpng \
lzo \
zlib \
zstd \
# EOF
# arm64-windows-static is not (yet) supported for breakpad.
if [ "${{ matrix.arch }}" != "arm64" ]; then
vcpkg install --triplet=${{ matrix.arch }}-windows-static \
breakpad \
# EOF
fi
choco install pandoc
- name: Install MSVC problem matcher
uses: ammaraskar/msvc-problem-matcher@master
Expand Down
Loading

0 comments on commit 42c8f50

Please sign in to comment.