git: bee4aa6a98e9 - main - games/0ad: Fix build with newer libfmt

From: Guido Falsi <madpilot_at_FreeBSD.org>
Date: Mon, 18 Sep 2023 07:17:29 UTC
The branch main has been updated by madpilot:

URL: https://cgit.FreeBSD.org/ports/commit/?id=bee4aa6a98e9d2aa673af6ec0606f88c65fd52ea

commit bee4aa6a98e9d2aa673af6ec0606f88c65fd52ea
Author:     Guido Falsi <madpilot@FreeBSD.org>
AuthorDate: 2023-09-18 07:16:49 +0000
Commit:     Guido Falsi <madpilot@FreeBSD.org>
CommitDate: 2023-09-18 07:16:49 +0000

    games/0ad: Fix build with newer libfmt
    
    Import upstream patch to fix building with upcoming libfmt update.
    
    While here, remove some unneeded dependencies.
    
    PR:             273873
    Obtained from:  https://trac.wildfiregames.com/changeset/27657
---
 games/0ad/Makefile                                     | 16 +++++++---------
 games/0ad/files/patch-source_network_NetMessage.cpp    | 18 ++++++++++++++++++
 ...urce_simulation2_serialization_BinarySerializer.cpp | 11 +++++++++++
 3 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/games/0ad/Makefile b/games/0ad/Makefile
index da16454a9af2..055246833ffb 100644
--- a/games/0ad/Makefile
+++ b/games/0ad/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	0ad
 PORTVERSION=	0.0.26
-PORTREVISION=	14
+PORTREVISION=	15
 CATEGORIES=	games
 MASTER_SITES=	http://releases.wildfiregames.com/ \
 		SF/zero-ad/releases
@@ -19,22 +19,20 @@ BROKEN_powerpc64=	fails to compile: _psutil_bsd.c: error: 'struct xtcpcb' has no
 BUILD_DEPENDS=	${RUST_DEFAULT}>=1.35:lang/${RUST_DEFAULT} \
 		zip:archivers/zip \
 		cmake:devel/cmake-core
-LIB_DEPENDS=	libboost_thread.so:devel/boost-libs \
+LIB_DEPENDS=	libboost_filesystem.so:devel/boost-libs \
 		libicui18n.so:devel/icu \
-		libpng.so:graphics/png \
-		libogg.so:audio/libogg \
-		libvorbis.so:audio/libvorbis \
+		libpng16.so:graphics/png \
+		libvorbisfile.so:audio/libvorbis \
 		libcurl.so:ftp/curl \
+		libfreetype.so:print/freetype2 \
 		libgloox.so:net-im/gloox \
 		libminiupnpc.so:net/miniupnpc \
-		libnspr4.so:devel/nspr \
 		libenet.so:net/enet \
-		libtiff.so:graphics/tiff \
 		libsodium.so:security/libsodium \
 		libfmt.so:devel/libfmt
 
-USES=		compiler:c++11-lib desktop-file-utils dos2unix gl gmake gnome \
-		iconv jpeg openal:al perl5 pkgconfig python:build sdl tar:xz \
+USES=		compiler:c++11-lib desktop-file-utils dos2unix gmake gnome \
+		iconv openal:al perl5 pkgconfig python:build sdl tar:xz \
 		xorg
 USE_GNOME=	libxml2
 USE_GL=		gl
diff --git a/games/0ad/files/patch-source_network_NetMessage.cpp b/games/0ad/files/patch-source_network_NetMessage.cpp
new file mode 100644
index 000000000000..f8722186a922
--- /dev/null
+++ b/games/0ad/files/patch-source_network_NetMessage.cpp
@@ -0,0 +1,18 @@
+--- source/network/NetMessage.cpp.orig	2023-09-17 08:35:54 UTC
++++ source/network/NetMessage.cpp
+@@ -1,4 +1,4 @@
+-/* Copyright (C) 2017 Wildfire Games.
++/* Copyright (C) 2023 Wildfire Games.
+  * This file is part of 0 A.D.
+  *
+  * 0 A.D. is free software: you can redistribute it and/or modify
+@@ -216,7 +216,8 @@ CNetMessage* CNetMessageFactory::CreateMessage(const v
+ 		break;
+ 
+ 	default:
+-		LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received", header.GetType());
++		LOGERROR("CNetMessageFactory::CreateMessage(): Unknown message type '%d' received",
++			static_cast<int>(header.GetType()));
+ 		break;
+ 	}
+ 
diff --git a/games/0ad/files/patch-source_simulation2_serialization_BinarySerializer.cpp b/games/0ad/files/patch-source_simulation2_serialization_BinarySerializer.cpp
new file mode 100644
index 000000000000..c1c94a1d1e1e
--- /dev/null
+++ b/games/0ad/files/patch-source_simulation2_serialization_BinarySerializer.cpp
@@ -0,0 +1,11 @@
+--- source/simulation2/serialization/BinarySerializer.cpp.orig	2022-08-21 12:45:40 UTC
++++ source/simulation2/serialization/BinarySerializer.cpp
+@@ -52,7 +52,7 @@ static u8 GetArrayType(js::Scalar::Type arrayType)
+ 	case js::Scalar::Uint8Clamped:
+ 		return SCRIPT_TYPED_ARRAY_UINT8_CLAMPED;
+ 	default:
+-		LOGERROR("Cannot serialize unrecognized typed array view: %d", arrayType);
++		LOGERROR("Cannot serialize unrecognized typed array view: %d", static_cast<int>(arrayType));
+ 		throw PSERROR_Serialize_InvalidScriptValue();
+ 	}
+ }