git: e760c81810bf - main - net/guacamole-server: Fix disabling KUBERNETES/SSH

From: Felix Palmen <zirias_at_FreeBSD.org>
Date: Mon, 01 Apr 2024 06:11:37 UTC
The branch main has been updated by zirias:

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

commit e760c81810bf72c06194543cee14207911aaf988
Author:     Felix Palmen <zirias@FreeBSD.org>
AuthorDate: 2024-03-23 06:26:43 +0000
Commit:     Felix Palmen <zirias@FreeBSD.org>
CommitDate: 2024-04-01 06:10:37 +0000

    net/guacamole-server: Fix disabling KUBERNETES/SSH
    
    Both options need --with-pango and --with-terminal configure args. The
    <opt>_CONFIGURE_WITH helper also adds --without-* args for disabled
    options, so it can't be used here, as this will lead to conflicting
    configure args.
    
    Solve this by explicitly handling these after including
    bsd.port.options.mk. Also fix pkg-plist when both KUBERNETES and SSH are
    disabled.
    
    PR:             277976
    Approved by:    ultima (maintainer)
---
 net/guacamole-server/Makefile  | 18 ++++++++++++------
 net/guacamole-server/pkg-plist | 10 +++++-----
 2 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/net/guacamole-server/Makefile b/net/guacamole-server/Makefile
index d7da49121b4a..0529938dcd6d 100644
--- a/net/guacamole-server/Makefile
+++ b/net/guacamole-server/Makefile
@@ -67,19 +67,16 @@ GUACENC_LIB_DEPENDS=	libavcodec.so:multimedia/ffmpeg
 GUACENC_CFLAGS=		-Wno-error=deprecated
 GUACLOG_CONFIGURE_ENABLE=	guaclog
 KUBERNETES_CONFIGURE_ENABLE=	kubernetes
-KUBERNETES_CONFIGURE_WITH=	pango terminal
 KUBERNETES_LIB_DEPENDS=		libwebsockets.so:net/libwebsockets \
 				libharfbuzz.so:print/harfbuzz
-KUBERNETES_USE=			GNOME=pango
 NLS_USES=		gettext-runtime
 PULSEAUDIO_CONFIGURE_WITH=	pulse
 PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
 RDP_CONFIGURE_WITH=	rdp
 RDP_LIB_DEPENDS=	libfreerdp2.so:net/freerdp
-SSH_CONFIGURE_WITH=	pango ssh terminal
+SSH_CONFIGURE_WITH=	ssh
 SSH_IMPLIES=		SSL
 SSH_LIB_DEPENDS=	libssh2.so:security/libssh2
-SSH_USE=		GNOME=pango
 SSL_CONFIGURE_WITH=	ssl
 SSL_USES=		ssl
 VNC_CONFIGURE_WITH=	vnc
@@ -90,7 +87,16 @@ VORBIS_LIB_DEPENDS=	libvorbis.so:audio/libvorbis \
 WEBP_CONFIGURE_WITH=	webp
 WEBP_LIB_DEPENDS=	libwebp.so:graphics/webp
 
-.include <bsd.port.pre.mk>
+.include <bsd.port.options.mk>
+
+.if ${PORT_OPTIONS:MKUBERNETES}${PORT_OPTIONS:MSSH}
+CONFIGURE_ARGS+=	--with-pango --with-terminal
+PLIST_SUB+=		TERMINAL=""
+USE_GNOME+=		pango
+.else
+CONFIGURE_ARGS+=	--without-pango --without-terminal
+PLIST_SUB+=		TERMINAL="@comment "
+.endif
 
 .if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
 CFLAGS+=       -Wno-error=strict-prototypes \
@@ -108,4 +114,4 @@ post-install:
 	@${MKDIR} ${STAGEDIR}${ETCDIR} ${STAGEDIR}${GUACAMOLE_HOME}
 	${INSTALL_DATA} ${FILESDIR}/guacd.conf.sample ${STAGEDIR}${ETCDIR}
 
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>
diff --git a/net/guacamole-server/pkg-plist b/net/guacamole-server/pkg-plist
index 5cf72710b626..0303899e3170 100644
--- a/net/guacamole-server/pkg-plist
+++ b/net/guacamole-server/pkg-plist
@@ -41,7 +41,7 @@ include/guacamole/socket.h
 include/guacamole/stream-types.h
 include/guacamole/stream.h
 include/guacamole/string.h
-include/guacamole/terminal/terminal.h
+%%TERMINAL%%include/guacamole/terminal/terminal.h
 include/guacamole/timestamp-types.h
 include/guacamole/timestamp.h
 include/guacamole/unicode.h
@@ -73,10 +73,10 @@ lib/libguac.a
 lib/libguac.so
 lib/libguac.so.23
 lib/libguac.so.23.0.0
-lib/libguac-terminal.a
-lib/libguac-terminal.so
-lib/libguac-terminal.so.0
-lib/libguac-terminal.so.0.1.0
+%%TERMINAL%%lib/libguac-terminal.a
+%%TERMINAL%%lib/libguac-terminal.so
+%%TERMINAL%%lib/libguac-terminal.so.0
+%%TERMINAL%%lib/libguac-terminal.so.0.1.0
 %%GUACENC%%share/man/man1/guacenc.1.gz
 %%GUACLOG%%share/man/man1/guaclog.1.gz
 share/man/man5/guacd.conf.5.gz