git: bb17778fa0d1 - main - games/UZDoom: bunch of improvements

From: Piotr Kubaj <pkubaj_at_FreeBSD.org>
Date: Sun, 04 Oct 2026 11:43:10 UTC
The branch main has been updated by pkubaj:

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

commit bb17778fa0d14890bda424a06d23d6614c2ce097
Author:     Piotr Kubaj <pkubaj@FreeBSD.org>
AuthorDate: 2026-10-04 09:38:44 +0000
Commit:     Piotr Kubaj <pkubaj@FreeBSD.org>
CommitDate: 2026-10-04 11:42:36 +0000

    games/UZDoom: bunch of improvements
    
    1. Fix build on aarch64.
    2. Restrict to 64-bit, upstream doesn't support 32-bit.
    3. Add missing dependency.
---
 games/UZDoom/Makefile                              | 14 ++++++++-
 .../UZDoom/files/patch-libraries_lzma_C_CpuArch.c  | 34 ++++++++++++++++++++++
 2 files changed, 47 insertions(+), 1 deletion(-)

diff --git a/games/UZDoom/Makefile b/games/UZDoom/Makefile
index eee2039b744e..24adb6cf7eb7 100644
--- a/games/UZDoom/Makefile
+++ b/games/UZDoom/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	UZDoom
 DISTVERSION=	5.0.3
+PORTREVISION=	1
 CATEGORIES=	games
 
 MAINTAINER=	pkubaj@FreeBSD.org
@@ -9,13 +10,17 @@ WWW=		https://github.com/UZDoom/UZDoom
 LICENSE=	GPLv3+
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
+NOT_FOR_ARCHS=		armv6 armv7 i386 powerpc powerpcspe
+NOT_FOR_ARCHS_REASON=	upstream only supports 64-bit platforms
+
 LIB_DEPENDS=	libdbus-1.so:devel/dbus \
 		libopenal.so:audio/openal-soft \
 		libvpx.so:multimedia/libvpx
 
-USES=		cmake desktop-file-utils localbase pkgconfig python:build \
+USES=		cmake desktop-file-utils gnome localbase pkgconfig python:build \
 		sdl shared-mime-info
 USE_GITHUB=	yes
+USE_GNOME=	glib20
 USE_SDL=	sdl2
 
 DATADIR=	${PREFIX}/share/games/uzdoom
@@ -37,6 +42,13 @@ X11_USE=		XORG=x11
 
 .include "${.CURDIR}/../doom-data/Makefile.include"
 
+.include <bsd.port.options.mk>
+
+# clang 19 PCH: std::__va_list mismatches __builtin_va_list on aarch64
+.if ${ARCH} == aarch64
+CMAKE_OFF+=	USE_PCH
+.endif
+
 post-install:
 	@${RM} -r ${STAGEDIR}${PREFIX}/include ${STAGEDIR}${PREFIX}/lib
 
diff --git a/games/UZDoom/files/patch-libraries_lzma_C_CpuArch.c b/games/UZDoom/files/patch-libraries_lzma_C_CpuArch.c
new file mode 100644
index 000000000000..161da825ae5e
--- /dev/null
+++ b/games/UZDoom/files/patch-libraries_lzma_C_CpuArch.c
@@ -0,0 +1,34 @@
+--- libraries/lzma/C/CpuArch.c.orig	2026-09-27 08:20:17 UTC
++++ libraries/lzma/C/CpuArch.c
+@@ -766,10 +766,21 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
+ 
+ #ifdef USE_HWCAP
+ 
++#if defined(__FreeBSD__)
++static unsigned long MY_getauxval(int aux)
++{
++  unsigned long val;
++  if (elf_aux_info(aux, &val, sizeof(val)))
++    return 0;
++  return val;
++}
++#else
++#define MY_getauxval  getauxval
+ #include <asm/hwcap.h>
++#endif
+ 
+   #define MY_HWCAP_CHECK_FUNC_2(name1, name2) \
+-  BoolInt CPU_IsSupported_ ## name1() { return (getauxval(AT_HWCAP)  & (HWCAP_  ## name2)) ? 1 : 0; }
++  BoolInt CPU_IsSupported_ ## name1() { return (MY_getauxval(AT_HWCAP)  & (HWCAP_  ## name2)) ? 1 : 0; }
+ 
+ #ifdef MY_CPU_ARM64
+   #define MY_HWCAP_CHECK_FUNC(name) \
+@@ -778,7 +789,7 @@ BoolInt CPU_IsSupported_AES (void) { return APPLE_CRYP
+ // MY_HWCAP_CHECK_FUNC (ASIMD)
+ #elif defined(MY_CPU_ARM)
+   #define MY_HWCAP_CHECK_FUNC(name) \
+-  BoolInt CPU_IsSupported_ ## name() { return (getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
++  BoolInt CPU_IsSupported_ ## name() { return (MY_getauxval(AT_HWCAP2) & (HWCAP2_ ## name)) ? 1 : 0; }
+   MY_HWCAP_CHECK_FUNC_2(NEON, NEON)
+ #endif
+