git: 4918ddd08653 - main - comms/gqrx: add flavors for Qt5 and Qt6

From: Ganael LAPLANCHE <martymac_at_FreeBSD.org>
Date: Thu, 12 Oct 2023 10:31:20 UTC
The branch main has been updated by martymac:

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

commit 4918ddd0865348af03c481751b97988cf2a7a1d3
Author:     Ganael LAPLANCHE <martymac@FreeBSD.org>
AuthorDate: 2023-10-12 10:30:21 +0000
Commit:     Ganael LAPLANCHE <martymac@FreeBSD.org>
CommitDate: 2023-10-12 10:30:21 +0000

    comms/gqrx: add flavors for Qt5 and Qt6
---
 comms/gqrx/Makefile | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/comms/gqrx/Makefile b/comms/gqrx/Makefile
index bb9f5e3c03fb..cc981feef948 100644
--- a/comms/gqrx/Makefile
+++ b/comms/gqrx/Makefile
@@ -1,8 +1,10 @@
 PORTNAME=	gqrx
 PORTVERSION=	2.17.2
 DISTVERSIONPREFIX=	v
+PORTREVISION=	1
 PORTEPOCH=	1
 CATEGORIES=	comms hamradio
+PKGNAMESUFFIX=	-${FLAVOR}
 
 MAINTAINER=	martymac@FreeBSD.org
 COMMENT=	Software defined radio receiver powered by GNU Radio and Qt
@@ -31,16 +33,24 @@ LIB_DEPENDS=	libgnuradio-runtime.so:comms/gnuradio \
 		libjack.so:audio/jack \
 		libportaudio.so:audio/portaudio
 
-USES=		cmake compiler:c++11-lang gl pkgconfig qt:6
+FLAVORS=	qt5 qt6
+FLAVOR?=	qt6
+
+USES=		cmake compiler:c++11-lang gl pkgconfig qt:${FLAVOR:S/qt//}
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	gqrx-sdr
 USE_GL=		gl
-USE_QT=		base svg
+_USE_QT_qt5=	core gui network svg widgets
+_USE_QT_qt6=	base svg
+USE_QT=		${_USE_QT_${FLAVOR}}
+
+CONFLICTS_INSTALL=	gqrx ${FLAVORS:N${FLAVOR}:S/^/${PORTNAME}-/}
 
 # XXX Use Portaudio as Gqrx is invariably linked to it
 # (auto-detected and used through Gnuradio CMake files)
-CMAKE_ARGS+=	-DLINUX_AUDIO_BACKEND:STRING="Portaudio"
+CMAKE_ARGS+=	-DLINUX_AUDIO_BACKEND:STRING="Portaudio" \
+		-DFORCE_QT${FLAVOR:S/qt//}:BOOL=ON
 
 # XXX Work around Gnuradio 3.8 headers (gnuradio/rpcserver_aggregator.h) still
 # using std::unary_function (removed with C++17). This breaks when building