summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2024-03-19 23:03:42 +0000
committerJames Le Cuirot <chewi@gentoo.org>2024-03-19 23:03:42 +0000
commit9f8fd17d55d0fe0cbca82eda3464338508b6bf25 (patch)
tree5cd1e8d15ef4fa3e9093a5d7dab7d4fc7a035f06 /games-engines
parentmedia-gfx/vkBasalt: new package, add 0.3.2.10 (diff)
downloadgentoo-9f8fd17d55d0fe0cbca82eda3464338508b6bf25.tar.gz
gentoo-9f8fd17d55d0fe0cbca82eda3464338508b6bf25.tar.bz2
gentoo-9f8fd17d55d0fe0cbca82eda3464338508b6bf25.zip
games-engines/odamex: Fix launcher path issue, fix LTO, fix wxGTK crash
We've already seen that odalaunch crashes with wxGTK 3.2 so keep it at 3.0. I have looked into this, and it relates to the server list sorting, but I cannot figure it out. Closes: https://bugs.gentoo.org/858722 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'games-engines')
-rw-r--r--games-engines/odamex/files/odamex-lto.patch41
-rw-r--r--games-engines/odamex/files/odamex-odalaunch-prefix.patch64
-rw-r--r--games-engines/odamex/odamex-10.4.0-r2.ebuild (renamed from games-engines/odamex/odamex-10.4.0-r1.ebuild)6
3 files changed, 109 insertions, 2 deletions
diff --git a/games-engines/odamex/files/odamex-lto.patch b/games-engines/odamex/files/odamex-lto.patch
new file mode 100644
index 000000000000..20d9d88c002b
--- /dev/null
+++ b/games-engines/odamex/files/odamex-lto.patch
@@ -0,0 +1,41 @@
+https://github.com/odamex/odamex/pull/942
+
+diff --git a/client/src/cl_parse.cpp b/client/src/cl_parse.cpp
+index cdadbbdf2..e15c45edc 100644
+--- a/client/src/cl_parse.cpp
++++ b/client/src/cl_parse.cpp
+@@ -2354,7 +2354,7 @@ static void CL_SectorProperties(const odaproto::svc::SectorProperties* msg)
+ break;
+ }
+ case SPC_Gravity:
+- *(int*)&sector->gravity = msg->sector().gravity();
++ *&sector->gravity = msg->sector().gravity();
+ break;
+ case SPC_Panning:
+ sector->ceiling_xoffs = msg->sector().ceiling_offs().x();
+diff --git a/common/p_spec.cpp b/common/p_spec.cpp
+index df1a42a6a..d0a5af419 100644
+--- a/common/p_spec.cpp
++++ b/common/p_spec.cpp
+@@ -465,7 +465,7 @@ void DPusher::Serialize (FArchive &arc)
+ else
+ {
+ arc >> m_Type;
+- arc.ReadObject((DObject*&)m_Source, DPusher::StaticType());
++ arc.ReadObject((DObject*&)*m_Source, DPusher::StaticType());
+ arc >> m_Xmag >> m_Ymag >> m_Magnitude >> m_Radius >> m_X >> m_Y >> m_Affectee;
+ }
+ }
+diff --git a/odalpapi/net_io.cpp b/odalpapi/net_io.cpp
+index d6dd666fe..16f136374 100644
+--- a/odalpapi/net_io.cpp
++++ b/odalpapi/net_io.cpp
+@@ -194,7 +194,7 @@ void BufferedSocket::SetRemoteAddress(const string& Address, const uint16_t& Por
+
+ m_RemoteAddress.sin_family = PF_INET;
+ m_RemoteAddress.sin_port = htons(Port);
+- m_RemoteAddress.sin_addr.s_addr = *((unsigned long*)&(((sockaddr_in*)result->ai_addr)->sin_addr));
++ m_RemoteAddress.sin_addr = ((sockaddr_in*)result->ai_addr)->sin_addr;
+ memset(m_RemoteAddress.sin_zero, '\0', sizeof m_RemoteAddress.sin_zero);
+
+ freeaddrinfo(result);
diff --git a/games-engines/odamex/files/odamex-odalaunch-prefix.patch b/games-engines/odamex/files/odamex-odalaunch-prefix.patch
new file mode 100644
index 000000000000..cf293e60f9e1
--- /dev/null
+++ b/games-engines/odamex/files/odamex-odalaunch-prefix.patch
@@ -0,0 +1,64 @@
+From 04e38b9fcb8a71a7b0b1b5bc1c1f229f2ff7a0a8 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <chewi@gentoo.org>
+Date: Mon, 18 Mar 2024 22:54:16 +0000
+Subject: [PATCH] Always define INSTALL_PREFIX to fix paths for odalaunch
+
+Without INSTALL_PREFIX, it was falling back to the current directory and
+failing to launch the game.
+---
+ CMakeLists.txt | 5 +++++
+ client/CMakeLists.txt | 5 -----
+ server/CMakeLists.txt | 5 -----
+ 3 files changed, 5 insertions(+), 10 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 147060cb1..97c447424 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -26,6 +26,11 @@ include(GNUInstallDirs OPTIONAL)
+ add_definitions(-DINSTALL_BINDIR="${CMAKE_INSTALL_BINDIR}")
+ add_definitions(-DINSTALL_DATADIR="${CMAKE_INSTALL_DATADIR}")
+
++# Set up FHS installation path
++if(NOT APPLE AND NOT WIN32)
++ add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
++endif()
++
+ if(WIN32)
+ set(USE_INTERNAL_LIBS 1)
+ else()
+diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt
+index 56caf04f8..0559564c7 100644
+--- a/client/CMakeLists.txt
++++ b/client/CMakeLists.txt
+@@ -128,11 +128,6 @@ if(APPLE)
+ ${AUDIOUNIT_LIBRARY})
+ endif()
+
+-# Set up FHS installation path
+-if(NOT APPLE AND NOT WIN32)
+- add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
+-endif()
+-
+ # Client target
+ if(TARGET SDL2::SDL2 OR TARGET SDL::SDL)
+
+diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
+index e5b54d8de..9afc6c2c6 100644
+--- a/server/CMakeLists.txt
++++ b/server/CMakeLists.txt
+@@ -37,11 +37,6 @@ if(WIN32 AND NOT MSVC)
+ add_definitions(-DWINVER=0x0500)
+ endif()
+
+-# Set up FHS installation path
+-if(NOT APPLE AND NOT WIN32)
+- add_definitions(-DINSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
+-endif()
+-
+ add_executable(odasrv
+ ${COMMON_SOURCES} ${SERVER_SOURCES} ${SERVER_WIN32_SOURCES})
+ odamex_target_settings(odasrv)
+--
+2.43.2
+
diff --git a/games-engines/odamex/odamex-10.4.0-r1.ebuild b/games-engines/odamex/odamex-10.4.0-r2.ebuild
index db3f6bd5532a..97ddf96efce4 100644
--- a/games-engines/odamex/odamex-10.4.0-r1.ebuild
+++ b/games-engines/odamex/odamex-10.4.0-r2.ebuild
@@ -1,9 +1,9 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
-WX_GTK_VER="3.2-gtk3"
+WX_GTK_VER="3.0-gtk3" # odalaunch crashes with 3.2. Check it before updating!
inherit cmake desktop prefix wxwidgets xdg
DESCRIPTION="Online multiplayer free software engine for DOOM"
@@ -43,6 +43,8 @@ S="${WORKDIR}/${PN}-src-${PV}"
PATCHES=(
"${FILESDIR}"/${PN}-10.3.0-unbundle-fltk.patch
"${FILESDIR}"/${PN}-10.4.0-backport-pr928.patch
+ "${FILESDIR}"/${PN}-odalaunch-prefix.patch
+ "${FILESDIR}"/${PN}-lto.patch
)
src_prepare() {