git: e4d330bbdc82 - main - devel/rgbds: Fix build with clang

From: Nuno Teixeira <eduardo_at_FreeBSD.org>
Date: Tue, 28 Mar 2023 10:51:44 UTC
The branch main has been updated by eduardo:

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

commit e4d330bbdc82f346bc31f109ebff0d71154362d0
Author:     Nuno Teixeira <eduardo@FreeBSD.org>
AuthorDate: 2023-03-28 10:46:13 +0000
Commit:     Nuno Teixeira <eduardo@FreeBSD.org>
CommitDate: 2023-03-28 10:46:13 +0000

    devel/rgbds: Fix build with clang
    
    - yank _POSIX_C_SOURCE because it breaks the build
    
    See also:       https://github.com/gbdev/rgbds/issues/1091
                    https://github.com/gbdev/rgbds/issues/1111
    Reported by:    danfe, gerald
---
 devel/rgbds/Makefile | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/devel/rgbds/Makefile b/devel/rgbds/Makefile
index 3685a85a54d7..bd6d4fd33240 100644
--- a/devel/rgbds/Makefile
+++ b/devel/rgbds/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	rgbds
 DISTVERSION=	0.6.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	devel games
 MASTER_SITES=	https://github.com/gbdev/rgbds/releases/download/v${DISTVERSION}/
 
@@ -14,14 +14,13 @@ LICENSE_FILE=	${WRKSRC}/LICENSE
 LIB_DEPENDS=	libpng.so:graphics/png
 
 USES=		bison compiler:c11 dos2unix pkgconfig
-USE_GCC=	yes # clang >10 fails to build, https://github.com/gbdev/rgbds/issues/1091
 MAKE_ARGS=	Q= # verbose builds
 WRKSRC=		${WRKDIR}/rgbds
 
 do-configure:
-# yank _POSIX_C_SOURCE when there is no support for _ISOC11_SOURCE
-	@cd ${WRKSRC}; ${PRINTF} '#include <assert.h>\nint main(){static_assert(1, "");}' | \
-		${CC} -std=gnu11 -D_POSIX_C_SOURCE=200809L -D_ISOC11_SOURCE -xc - 2>/dev/null || \
-		${REINPLACE_CMD} 's,-D_POSIX_C_SOURCE=200809L,,' ${WRKSRC}/Makefile
+# yank _POSIX_C_SOURCE because it breaks the build, see also:
+# https://github.com/gbdev/rgbds/issues/1091
+# https://github.com/gbdev/rgbds/issues/1111
+	${REINPLACE_CMD} 's,-D_POSIX_C_SOURCE=200809L,,' ${WRKSRC}/Makefile
 
 .include <bsd.port.mk>