From 654075ab489fc9d105ea78f57f4cd6bc27f9d155 Mon Sep 17 00:00:00 2001 From: Kevin Nobel Date: Tue, 5 Apr 2022 23:05:14 +0200 Subject: Ports: Update openttd to version 12.2 --- Ports/AvailablePorts.md | 2 +- Ports/openttd/package.sh | 4 ++-- Ports/openttd/patches/build-fixes.patch | 6 +++--- Ports/openttd/patches/os_abstraction.patch | 11 +++++++++++ 4 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 Ports/openttd/patches/os_abstraction.patch diff --git a/Ports/AvailablePorts.md b/Ports/AvailablePorts.md index fa66bba47f..cf5b7a27db 100644 --- a/Ports/AvailablePorts.md +++ b/Ports/AvailablePorts.md @@ -152,7 +152,7 @@ Please make sure to keep this list up to date when adding and updating ports. :^ | [`nyancat`](nyancat/) | Nyancat | | https://github.com/klange/nyancat | | [`openssh`](openssh/) | OpenSSH | 8.3-9ca7e9c | https://github.com/openssh/openssh-portable | | [`openssl`](openssl/) | OpenSSL | 1.1.1n | https://www.openssl.org/ | -| [`openttd`](openttd/) | OpenTTD | 1.11.0 | https://www.openttd.org/ | +| [`openttd`](openttd/) | OpenTTD | 12.2 | https://www.openttd.org/ | | [`openttd-opengfx`](openttd-opengfx/) | OpenGFX graphics for OpenTTD | 7.1 | https://www.openttd.org/ | | [`openttd-opensfx`](openttd-opensfx/) | OpenSFX audio files for OpenTTD | 1.0.3 | https://www.openttd.org/ | | [`opentyrian`](opentyrian/) | OpenTyrian | 84b820f | https://github.com/opentyrian/opentyrian | diff --git a/Ports/openttd/package.sh b/Ports/openttd/package.sh index 6ff232987c..b19a2e667d 100755 --- a/Ports/openttd/package.sh +++ b/Ports/openttd/package.sh @@ -1,9 +1,9 @@ #!/usr/bin/env -S bash ../.port_include.sh port=openttd -version=1.11.0 +version=12.2 auth_type=sha256 depends=("freetype" "SDL2" "libicu" "libpng" "zlib" "xz" "openttd-opengfx" "openttd-opensfx") -files="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz openttd-${version}.tar.xz 5e65184e07368ba1afa62dbb3e35abaee6c4da6730ff4bc9eb4447d53363c7a8" +files="https://cdn.openttd.org/openttd-releases/${version}/openttd-${version}-source.tar.xz openttd-${version}.tar.xz 81508f0de93a0c264b216ef56a05f8381fff7bffa6d010121a21490b4dace95c" useconfigure=true configopts=("-DCMAKE_TOOLCHAIN_FILE=${SERENITY_BUILD_DIR}/CMakeToolchain.txt") launcher_name=OpenTTD diff --git a/Ports/openttd/patches/build-fixes.patch b/Ports/openttd/patches/build-fixes.patch index 2547309866..191b4e363d 100644 --- a/Ports/openttd/patches/build-fixes.patch +++ b/Ports/openttd/patches/build-fixes.patch @@ -1,12 +1,12 @@ diff -Naur openttd-1.11.0/cmake/CompileFlags.cmake openttd-1.11.0.serenity/cmake/CompileFlags.cmake --- openttd-1.11.0/cmake/CompileFlags.cmake 2021-04-01 14:33:44.000000000 +0200 +++ openttd-1.11.0.serenity/cmake/CompileFlags.cmake 2021-04-19 19:30:33.457232215 +0200 -@@ -154,7 +154,7 @@ +@@ -158,7 +158,7 @@ message(FATAL_ERROR "No warning flags are set for this compiler yet; please consider creating a Pull Request to add support for this compiler.") endif() -- if(NOT WIN32) -+ if(NOT WIN32 AND NOT SERENITYOS) +- if(NOT WIN32 AND NOT HAIKU) ++ if(NOT WIN32 AND NOT HAIKU AND NOT SERENITYOS) # rdynamic is used to get useful stack traces from crash reports. set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -rdynamic") endif() diff --git a/Ports/openttd/patches/os_abstraction.patch b/Ports/openttd/patches/os_abstraction.patch new file mode 100644 index 0000000000..5231823717 --- /dev/null +++ b/Ports/openttd/patches/os_abstraction.patch @@ -0,0 +1,11 @@ +--- openttd-12.1/src/network/core/os_abstraction_original.cpp 2022-03-31 15:13:24.270873422 +0200 ++++ openttd-12.1/src/network/core/os_abstraction.cpp 2022-03-31 15:14:01.978511406 +0200 +@@ -172,7 +172,7 @@ + return setsockopt(d, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuse_port, sizeof(reuse_port)) == 0; + #else + int reuse_port = 1; +- return setsockopt(d, SOL_SOCKET, SO_REUSEPORT, &reuse_port, sizeof(reuse_port)) == 0; ++ return setsockopt(d, SOL_SOCKET, SO_REUSEADDR, (const char *)&reuse_port, sizeof(reuse_port)) == 0; + #endif + } + -- cgit v1.2.3