commit:     ba3dacd5312a26126935d0f4e4a7aaffa033f7fd
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun May 12 16:21:40 2024 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Sun May 12 16:23:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba3dacd5

games-engines/odamex: Fix musl build with patch

This has been merged upstream.

Closes: https://bugs.gentoo.org/923818
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 games-engines/odamex/files/odamex-musl.patch | 119 +++++++++++++++++++++++++++
 games-engines/odamex/odamex-10.4.0-r3.ebuild |   5 +-
 2 files changed, 121 insertions(+), 3 deletions(-)

diff --git a/games-engines/odamex/files/odamex-musl.patch 
b/games-engines/odamex/files/odamex-musl.patch
new file mode 100644
index 000000000000..bf6f2999ba49
--- /dev/null
+++ b/games-engines/odamex/files/odamex-musl.patch
@@ -0,0 +1,119 @@
+From deb113e672588879697ae3343c5d3f1616d13503 Mon Sep 17 00:00:00 2001
+From: James Le Cuirot <[email protected]>
+Date: Sat, 30 Mar 2024 22:39:14 +0000
+Subject: [PATCH] Include <ctime> wherever time_t is used to fix musl
+
+---
+ client/src/m_menu.cpp       | 2 ++
+ client/src/v_screenshot.cpp | 2 ++
+ common/c_dispatch.cpp       | 1 +
+ common/cmdlib.h             | 1 +
+ common/p_user.cpp           | 2 ++
+ server/src/c_console.cpp    | 2 ++
+ server/src/sv_banlist.cpp   | 1 +
+ server/src/sv_banlist.h     | 1 +
+ 8 files changed, 12 insertions(+)
+
+diff --git a/client/src/m_menu.cpp b/client/src/m_menu.cpp
+index 6268e1819..f82cbf40d 100644
+--- a/client/src/m_menu.cpp
++++ b/client/src/m_menu.cpp
+@@ -25,6 +25,8 @@
+ 
+ #include "odamex.h"
+ 
++#include <ctime>
++
+ #include "gstrings.h"
+ #include "c_console.h"
+ #include "c_dispatch.h"
+diff --git a/client/src/v_screenshot.cpp b/client/src/v_screenshot.cpp
+index 2f24cb184..375de5b9d 100644
+--- a/client/src/v_screenshot.cpp
++++ b/client/src/v_screenshot.cpp
+@@ -24,6 +24,8 @@
+ 
+ #include "odamex.h"
+ 
++#include <ctime>
++
+ #include <SDL.h>
+ 
+ #include <stdlib.h>
+diff --git a/common/c_dispatch.cpp b/common/c_dispatch.cpp
+index 504379aad..d30dd4e24 100644
+--- a/common/c_dispatch.cpp
++++ b/common/c_dispatch.cpp
+@@ -26,6 +26,7 @@
+ 
+ #include <sstream>
+ #include <algorithm>
++#include <ctime>
+ 
+ #include "cmdlib.h"
+ #include "c_console.h"
+diff --git a/common/cmdlib.h b/common/cmdlib.h
+index c7041837b..a20be7c4c 100644
+--- a/common/cmdlib.h
++++ b/common/cmdlib.h
+@@ -24,6 +24,7 @@
+ #pragma once
+ 
+ #include <algorithm>
++#include <ctime>
+ 
+ #ifdef _MSC_VER
+ #pragma warning(disable : 4244)     // MIPS
+diff --git a/common/p_user.cpp b/common/p_user.cpp
+index d9a4bb965..461a3ef03 100644
+--- a/common/p_user.cpp
++++ b/common/p_user.cpp
+@@ -26,6 +26,8 @@
+ 
+ #include "odamex.h"
+ 
++#include <ctime>
++
+ #include <limits.h>
+ 
+ #include "cmdlib.h"
+diff --git a/server/src/c_console.cpp b/server/src/c_console.cpp
+index 34fcd19d9..57d7e71e2 100644
+--- a/server/src/c_console.cpp
++++ b/server/src/c_console.cpp
+@@ -24,6 +24,8 @@
+ 
+ #include "odamex.h"
+ 
++#include <ctime>
++
+ #include <stdarg.h>
+ 
+ #include "m_memio.h"
+diff --git a/server/src/sv_banlist.cpp b/server/src/sv_banlist.cpp
+index c271fe68c..36cdf9b63 100644
+--- a/server/src/sv_banlist.cpp
++++ b/server/src/sv_banlist.cpp
+@@ -24,6 +24,7 @@
+ 
+ #include "odamex.h"
+ 
++#include <ctime>
+ #include <sstream>
+ 
+ #include "win32inc.h"
+diff --git a/server/src/sv_banlist.h b/server/src/sv_banlist.h
+index 6096f73fc..f4d686071 100644
+--- a/server/src/sv_banlist.h
++++ b/server/src/sv_banlist.h
+@@ -23,6 +23,7 @@
+ 
+ #pragma once
+ 
++#include <ctime>
+ #include <sstream>
+ 
+ #include "json/json.h"
+-- 
+2.44.0
+

diff --git a/games-engines/odamex/odamex-10.4.0-r3.ebuild 
b/games-engines/odamex/odamex-10.4.0-r3.ebuild
index a1d216e1f011..8b0fd3fd1b7b 100644
--- a/games-engines/odamex/odamex-10.4.0-r3.ebuild
+++ b/games-engines/odamex/odamex-10.4.0-r3.ebuild
@@ -9,7 +9,7 @@ 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"
@@ -38,13 +38,12 @@ RDEPEND="
 DEPEND="${RDEPEND}"
 BDEPEND="games-util/deutex"
 
-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
+       "${FILESDIR}"/${PN}-musl.patch
 )
 
 src_prepare() {

Reply via email to