git: f3b181530fcb - main - devel/ncurses: Switch to using WITH_DEBUG

From: Ganael LAPLANCHE <martymac_at_FreeBSD.org>
Date: Thu, 02 Jun 2022 20:37:33 UTC
The branch main has been updated by martymac:

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

commit f3b181530fcb74df2165caa2c65fab3d45d3d050
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2022-06-02 20:32:18 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2022-06-02 20:32:18 +0000

    devel/ncurses: Switch to using WITH_DEBUG
    
    Rework previous commit and use WITH_DEBUG instead of DEBUG option to
    get the ports framework auto-adapt STRIP_CMD accordingly.
    
    Reported by:    danfe, bapt (via ports-committers@)
    Approved by:    blanket (infrastructure change)
---
 devel/ncurses/Makefile | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/devel/ncurses/Makefile b/devel/ncurses/Makefile
index 463448b1d6b3..1063649e7b09 100644
--- a/devel/ncurses/Makefile
+++ b/devel/ncurses/Makefile
@@ -42,7 +42,7 @@ CONFIGURE_ARGS=		--datadir=${PREFIX}/share \
 			--with-termlib \
 			--without-manpage-renames
 
-OPTIONS_DEFINE=		DEBUG DOCS EXAMPLES MANPAGES PROFILE TRACE
+OPTIONS_DEFINE=		DOCS EXAMPLES MANPAGES PROFILE TRACE
 OPTIONS_DEFAULT=	DOCS EXAMPLES MANPAGES
 
 TRACE_DESC=	Add trace() function to all models of ncurses
@@ -76,10 +76,16 @@ EXAMPLES_CPP=	cursesapp.cc cursesapp.h cursesf.cc cursesf.h cursesm.cc \
 TRACE_CONFIGURE_ON=		--with-trace
 PROFILE_CONFIGURE_WITH=		profile
 MANPAGES_CONFIGURE_WITH=	manpages
-DEBUG_CONFIGURE_WITH=		debug
 
 OPTIONS_SUB=	yes
 
+.if defined(WITH_DEBUG)
+CONFIGURE_ARGS+=	--with-debug
+PLIST_SUB+=	DEBUG=""
+.else
+PLIST_SUB+=	DEBUG="@comment "
+.endif
+
 .include <bsd.port.options.mk>
 
 .if ${PORT_OPTIONS:MMANPAGES}
@@ -95,9 +101,7 @@ post-install:
 	${RM} ${STAGEDIR}${PREFIX}/lib/libncurses.so
 	${ECHO} "INPUT(libncurses.so.${PORTVERSION:R} AS_NEEDED(-ltinfo))" > ${STAGEDIR}${PREFIX}/lib/libncurses.so
 
-.if ! ${PORT_OPTIONS:MDEBUG}
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/*.so.${DISTVERSION}
-.endif
 
 	# backwards compatibility, remove 2021-07-02
 	${RLN} ${STAGEDIR}${PREFIX}/lib/libncurses.so ${STAGEDIR}${PREFIX}/lib/libncursesw.so