git: e328e7c21883 - 2024Q4 - devel/openocd: Unbreak aarch64 build

From: Joel Bodenmann <jbo_at_FreeBSD.org>
Date: Mon, 23 Dec 2024 13:02:57 UTC
The branch 2024Q4 has been updated by jbo:

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

commit e328e7c218833412be5537690ffd61924b128593
Author:     Robert Clausecker <fuz@FreeBSD.org>
AuthorDate: 2024-12-23 12:34:16 +0000
Commit:     Joel Bodenmann <jbo@FreeBSD.org>
CommitDate: 2024-12-23 13:02:37 +0000

    devel/openocd: Unbreak aarch64 build
    
    Working around an issue where upstream provided page size macros are
    colliding with page size macros from <machine/param.h>.
    
    PR:             283034
    Reported by:    Duane (parakleta@darkreality.org)
    
    (cherry picked from commit 7ff81df978340dd7d36c28c38492eb5ec7af6cb9)
---
 devel/openocd/Makefile                            |  7 +------
 devel/openocd/files/patch-src_target_nds32__tlb.h | 16 ++++++++++++++++
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/devel/openocd/Makefile b/devel/openocd/Makefile
index f19f6b0540d4..22b500114d87 100644
--- a/devel/openocd/Makefile
+++ b/devel/openocd/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	openocd
 DISTVERSION=	0.12.0
-PORTREVISION=	4
+PORTREVISION=	5
 CATEGORIES=	devel
 MASTER_SITES=	SF
 
@@ -11,11 +11,6 @@ WWW=		https://openocd.sf.net
 LICENSE=	GPLv2
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-# Note: A local patch would be feasible but upstream has removed support for the offending feature
-#       implementation since their last release (0.12.0). As such, this will no longer be relevant
-#       from 0.13.0 onwards. Hence we're not addressing this "limitation" right now.
-BROKEN_aarch64=	fails to build: src/target/nds32_tlb.h:25:2: error: expected identifier PAGE_SIZE_4K = 0
-
 USES=		gmake libtool makeinfo pkgconfig tar:bzip2
 GNU_CONFIGURE=	yes
 GNU_CONFIGURE_MANPREFIX=	${PREFIX}/share
diff --git a/devel/openocd/files/patch-src_target_nds32__tlb.h b/devel/openocd/files/patch-src_target_nds32__tlb.h
new file mode 100644
index 000000000000..04b1a2494ec7
--- /dev/null
+++ b/devel/openocd/files/patch-src_target_nds32__tlb.h
@@ -0,0 +1,16 @@
+--- src/target/nds32_tlb.h.orig	2022-09-18 13:46:16 UTC
++++ src/target/nds32_tlb.h
+@@ -10,6 +10,13 @@
+ 
+ #include "nds32.h"
+ 
++#ifdef PAGE_SIZE_4K
++# undef PAGE_SIZE_4K
++#endif
++#ifdef PAGE_SIZE_8K
++# undef PAGE_SIZE_8k
++#endif
++
+ enum {
+ 	PAGE_SIZE_4K = 0,
+ 	PAGE_SIZE_8K,