Skip to content

Commit

Permalink
devel/rgbds: Fix build with clang
Browse files Browse the repository at this point in the history
- yank _POSIX_C_SOURCE because it breaks the build

See also:	gbdev/rgbds#1091
		gbdev/rgbds#1111
Reported by:	danfe, gerald
  • Loading branch information
nunotexbsd committed Mar 28, 2023
1 parent dcf820e commit e4d330b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions 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}/

Expand All @@ -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>

0 comments on commit e4d330b

Please sign in to comment.