git: d76e4adce969 - main - emulators/mame: fix build with clang 18 and 19

From: Dimitry Andric <dim_at_FreeBSD.org>
Date: Wed, 04 Dec 2024 19:52:27 UTC
The branch main has been updated by dim:

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

commit d76e4adce969f7a3da6e7398cca26dca70cec559
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2024-12-03 09:22:18 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2024-12-04 19:51:46 +0000

    emulators/mame: fix build with clang 18 and 19
    
    During the exp-run for bug 283013 ("update LLVM_DEFAULT to 18") it
    turned out that emulators/mame fails to compile, with an error similar
    to:
    
      ../../../../../3rdparty/sol2/sol/sol.hpp:19875:31: error: address of overloaded function 'call' does not match required type 'int (lua_State *)'
       19875 |                                 lua_CFunction freefunc = &function_detail::upvalue_this_member_variable<C, Fx>::template call<is_yielding, no_trampoline>;
             |                                                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Upstream fixed this with [1] and [2].
    
    Similarly, compiling it with clang 19, we run into another error:
    
      ../../../../../3rdparty/sol2/sol/sol.hpp:6755:10: error: no member named 'construct' in 'optional<type-parameter-0-0 &>'
       2191 |                         this->construct(std::forward<Args>(args)...);
            |                         ~~~~  ^
    
    Upstream fixed this with [3].
    
    Apply these upstream fixes using PATCH_SITES and PATCHFILES.
    
    [1] https://github.com/mamedev/mame/commit/4da99a13f5c
    [2] https://github.com/mamedev/mame/commit/b7e0fa72b92
    [3] https://github.com/mamedev/mame/commit/c75845b1ef0
    
    PR:             283126
    Approved by:    agh@riseup.net (maintainer)
    MFH:            2024Q4
---
 emulators/mame/Makefile | 5 +++++
 emulators/mame/distinfo | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index 33d455a1d380..190f47f51213 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -2,6 +2,11 @@ PORTNAME=	mame
 DISTVERSION=	0.264
 CATEGORIES=	emulators games
 
+PATCH_SITES=	https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/commit/
+PATCHFILES+=	4da99a13f5cd8054ff8f747a0234a74b271b663d.patch:-p1 # fix build with clang 18
+PATCHFILES+=	b7e0fa72b92f8f6761a1a59e8ffdc46f6d17e6cc.patch:-p1 # idem
+PATCHFILES+=	c75845b1ef01d76379bcc0a6937f1ca678484c68.patch:-p1 # fix build with clang 19
+
 MAINTAINER=	agh@riseup.net
 COMMENT=	MAME: a multi-purpose emulation framework
 WWW=		https://mamedev.org/
diff --git a/emulators/mame/distinfo b/emulators/mame/distinfo
index 96550be61049..ea6a83f7ee17 100644
--- a/emulators/mame/distinfo
+++ b/emulators/mame/distinfo
@@ -1,3 +1,9 @@
-TIMESTAMP = 1711623026
+TIMESTAMP = 1733152778
 SHA256 (mamedev-mame-0.264-mame0264_GH0.tar.gz) = 3d9f69ed3ef7c1628d5714c8ae2695ea77b1a652a93347b2703f7c862299376e
 SIZE (mamedev-mame-0.264-mame0264_GH0.tar.gz) = 207550597
+SHA256 (4da99a13f5cd8054ff8f747a0234a74b271b663d.patch) = 276836cc29cf3273beeace1e7ca4e57899fdee5210ec22fa4c6f6e0badb01635
+SIZE (4da99a13f5cd8054ff8f747a0234a74b271b663d.patch) = 1219
+SHA256 (b7e0fa72b92f8f6761a1a59e8ffdc46f6d17e6cc.patch) = 94bcf956b88c049da20a7aa2097118b53bfd94a18607e09fcb9fdfcf1c025148
+SIZE (b7e0fa72b92f8f6761a1a59e8ffdc46f6d17e6cc.patch) = 1005
+SHA256 (c75845b1ef01d76379bcc0a6937f1ca678484c68.patch) = abad5c6f67eb101cc85e50aa4855f61adf63a95398ac771fa72cb53725d4137d
+SIZE (c75845b1ef01d76379bcc0a6937f1ca678484c68.patch) = 1098