commit:     c4f807e3271696e8feab195954e876a36c8cb6dd
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Sun Dec  1 16:32:45 2024 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Mon Dec  2 12:59:32 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c4f807e3

games-engines/odamex: Support wxGTK 3.2

Finally upstream fixes odalaunch crashes with newer wxGTK

Closes: https://bugs.gentoo.org/935473
Signed-off-by: Pacho Ramos <pacho <AT> gentoo.org>

 .../odamex-10.6.0-odalaunch-sorting-crash.patch    | 28 +++++++
 games-engines/odamex/odamex-10.6.0-r1.ebuild       | 89 ++++++++++++++++++++++
 2 files changed, 117 insertions(+)

diff --git 
a/games-engines/odamex/files/odamex-10.6.0-odalaunch-sorting-crash.patch 
b/games-engines/odamex/files/odamex-10.6.0-odalaunch-sorting-crash.patch
new file mode 100644
index 000000000000..b665d16d86a4
--- /dev/null
+++ b/games-engines/odamex/files/odamex-10.6.0-odalaunch-sorting-crash.patch
@@ -0,0 +1,28 @@
+From e8dfbdc08a58d709fa7c23e38911c421cdb2a76d Mon Sep 17 00:00:00 2001
+From: Pavel Miksha <[email protected]>
+Date: Sun, 20 Oct 2024 15:53:14 +0300
+Subject: [PATCH] Fix odalaunch crashing when sorting servers
+
+---
+ odalaunch/src/lst_custom.cpp | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/odalaunch/src/lst_custom.cpp b/odalaunch/src/lst_custom.cpp
+index 1ad0387fa..22182b6cb 100644
+--- a/odalaunch/src/lst_custom.cpp
++++ b/odalaunch/src/lst_custom.cpp
+@@ -319,6 +319,14 @@ int wxCALLBACK wxCompareFunction(wxIntPtr item1, wxIntPtr 
item2,
+       Item.SetColumn(SortCol);
+       Item.SetMask(wxLIST_MASK_TEXT);
+ 
++      long id1 = ListCtrl->FindItem(-1, item1);
++      long id2 = ListCtrl->FindItem(-1, item2);
++
++      if (id1 == -1 || id2 == -1)
++      {
++              return 0;
++      }
++
+       if(SortCol == ListCtrl->GetSpecialSortColumn())
+       {
+               int Img1, Img2;

diff --git a/games-engines/odamex/odamex-10.6.0-r1.ebuild 
b/games-engines/odamex/odamex-10.6.0-r1.ebuild
new file mode 100644
index 000000000000..504ec274d098
--- /dev/null
+++ b/games-engines/odamex/odamex-10.6.0-r1.ebuild
@@ -0,0 +1,89 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+WX_GTK_VER="3.2-gtk3"
+inherit cmake desktop prefix wxwidgets xdg
+
+DESCRIPTION="Online multiplayer free software engine for DOOM"
+HOMEPAGE="https://odamex.net/";
+SRC_URI="https://github.com/${PN}/${PN}/releases/download/${PV}/${PN}-src-${PV}.tar.xz";
+S="${WORKDIR}/${PN}-src-${PV}"
+LICENSE="GPL-2+ MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
+IUSE="+client hidpi master +odalaunch portmidi server upnp"
+REQUIRED_USE="|| ( client master server )"
+
+# protobuf is still bundled. Unfortunately an old version is required for C++98
+# compatibility. We could use C++11, but upstream is concerned about using a
+# completely different protobuf version on a multiplayer-focused engine.
+
+RDEPEND="
+       client? (
+               media-libs/libpng:0=
+               media-libs/libsdl2[joystick,sound,video]
+               media-libs/sdl2-mixer
+               net-misc/curl
+               x11-libs/libX11
+               !hidpi? ( x11-libs/fltk:1 )
+               portmidi? ( media-libs/portmidi )
+       )
+       odalaunch? ( x11-libs/wxGTK:${WX_GTK_VER} )
+       server? (
+               dev-libs/jsoncpp:=
+               upnp? ( net-libs/miniupnpc:= )
+       )"
+DEPEND="${RDEPEND}"
+BDEPEND="games-util/deutex"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-10.3.0-unbundle-fltk.patch
+       "${FILESDIR}"/${P}-odalaunch-sorting-crash.patch
+)
+
+src_prepare() {
+       rm -r libraries/miniupnp || die
+       hprefixify common/d_main.cpp
+
+       cmake_src_prepare
+}
+
+src_configure() {
+       use odalaunch && setup-wxwidgets
+
+       local mycmakeargs=(
+               -DUSE_INTERNAL_FLTK=$(usex hidpi)
+               -DUSE_INTERNAL_JSONCPP=0
+               -DUSE_INTERNAL_LIBS=0
+               -DUSE_INTERNAL_MINIUPNP=0
+               -DBUILD_CLIENT=$(usex client)
+               -DBUILD_LAUNCHER=$(usex odalaunch)
+               -DBUILD_MASTER=$(usex master)
+               -DBUILD_SERVER=$(usex server)
+               -DBUILD_OR_FAIL=1
+               -DENABLE_PORTMIDI=$(usex portmidi)
+               -DUSE_MINIUPNP=$(usex upnp)
+       )
+
+       cmake_src_configure
+}
+
+src_install() {
+       if use client ; then
+               for size in 96 128 256 512; do
+                       newicon -s ${size} "${S}/media/icon_${PN}_${size}.png" 
"${PN}.png"
+               done
+               make_desktop_entry "${PN}" "Odamex"
+
+               if use odalaunch ; then
+                       for size in 96 128 256 512; do
+                               newicon -s ${size} 
"${S}/media/icon_odalaunch_${size}.png" "odalaunch.png"
+                       done
+                       make_desktop_entry odalaunch "Odamex Launcher" odalaunch
+               fi
+       fi
+
+       cmake_src_install
+}

Reply via email to