git: b1a251040cd6 - main - audio/drumstick: Add/rearrange options

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 02 Sep 2022 23:44:07 UTC
The branch main has been updated by yuri:

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

commit b1a251040cd6235bdcdd713797ee2c3f9ef16d79
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-09-02 23:40:30 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-09-02 23:44:05 +0000

    audio/drumstick: Add/rearrange options
    
    This fixes build for some combination of options.
    
    Reported by:    hps@selasky.org
---
 audio/drumstick/Makefile  | 29 +++++++++++++++++++----------
 audio/drumstick/pkg-plist |  8 ++++----
 2 files changed, 23 insertions(+), 14 deletions(-)

diff --git a/audio/drumstick/Makefile b/audio/drumstick/Makefile
index d136f3f2e501..d9326b8ccd1b 100644
--- a/audio/drumstick/Makefile
+++ b/audio/drumstick/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	drumstick
 DISTVERSION=	2.7.1
-PORTREVISION=	1
+PORTREVISION=	2
 CATEGORIES=	audio multimedia
 MASTER_SITES=	SF/${PORTNAME}/${PORTVERSION}/
 
@@ -10,31 +10,40 @@ COMMENT=	MIDI libraries for Qt/C++
 LICENSE=	BSD2CLAUSE
 LICENSE_FILE=	${WRKSRC}/COPYING
 
-LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth \
-		libsonivox.so:audio/sonivox
-RUN_DEPENDS=	${LOCALBASE}/share/sounds/sf2/FluidR3_GM.sf2:audio/fluid-soundfont
-
 USES=		compiler:c++11-lang cmake desktop-file-utils pkgconfig qt:6 shared-mime-info tar:bz2
 USE_QT=		base svg 5compat tools_build
 USE_LDCONFIG=	yes
 
 CMAKE_ARGS=	-DUSE_QT=6
+CMAKE_OFF=	BUILD_TESTING
 
-OPTIONS_DEFINE=		ALSA PULSEAUDIO MANPAGES
-OPTIONS_DEFAULT=	ALSA PULSEAUDIO MANPAGES
+OPTIONS_DEFINE=		ALSA MANPAGES
+OPTIONS_MULTI=			RT_BACKEND
+OPTIONS_MULTI_RT_BACKEND=	FLUIDSYNTH NETWORK SONIVOX
+OPTIONS_DEFAULT=	ALSA MANPAGES ${OPTIONS_MULTI_RT_BACKEND}
 OPTIONS_SUB=		yes
 
 ALSA_CMAKE_BOOL=	BUILD_ALSA
 ALSA_USES=		localbase
 ALSA_LIB_DEPENDS=	libasound.so:audio/alsa-lib
 
-PULSEAUDIO_CMAKE_BOOL=	USE_PULSEAUDIO
-PULSEAUDIO_LIB_DEPENDS=	libpulse.so:audio/pulseaudio
-
 MANPAGES_CMAKE_BOOL=	BUILD_DOCS
 MANPAGES_BUILD_DEPENDS=	xsltproc:textproc/libxslt \
 			docbook-xsl>0:textproc/docbook-xsl
 
+FLUIDSYNTH_DESC=	Build FluidSynth RT backend
+FLUIDSYNTH_CMAKE_BOOL=	USE_FLUIDSYNTH
+FLUIDSYNTH_RUN_DEPENDS=	${LOCALBASE}/share/sounds/sf2/FluidR3_GM.sf2:audio/fluid-soundfont
+FLUIDSYNTH_LIB_DEPENDS=	libfluidsynth.so:audio/fluidsynth
+
+NETWORK_DESC=		Build Network RT backend
+NETWORK_CMAKE_BOOL=	USE_NETWORK # QtNetwork is used
+
+SONIVOX_DESC=		Build FluidSynth RT backend
+SONIVOX_CMAKE_BOOL=	USE_SONIVOX USE_PULSEAUDIO # these two options have to be always equal
+SONIVOX_LIB_DEPENDS=	libpulse.so:audio/pulseaudio \
+			libsonivox.so:audio/sonivox
+
 post-patch:
 	# instead of default.sf2 use FluidR3_GM.sf2 installed by fluid-soundfont
 	@${REINPLACE_CMD} -e 's|"default.sf2"|"${LOCALBASE}/share/sounds/sf2/FluidR3_GM.sf2"|' \
diff --git a/audio/drumstick/pkg-plist b/audio/drumstick/pkg-plist
index 16683d1e6dda..24b248cb3cb4 100644
--- a/audio/drumstick/pkg-plist
+++ b/audio/drumstick/pkg-plist
@@ -48,10 +48,10 @@ lib/cmake/drumstick/drumstick-widgets-targets-%%CMAKE_BUILD_TYPE%%.cmake
 lib/cmake/drumstick/drumstick-widgets-targets.cmake
 %%ALSA%%lib/drumstick2/libdrumstick-rt-alsa-in.so
 %%ALSA%%lib/drumstick2/libdrumstick-rt-alsa-out.so
-%%PULSEAUDIO%%lib/drumstick2/libdrumstick-rt-eassynth.so
-lib/drumstick2/libdrumstick-rt-fluidsynth.so
-lib/drumstick2/libdrumstick-rt-net-in.so
-lib/drumstick2/libdrumstick-rt-net-out.so
+%%SONIVOX%%lib/drumstick2/libdrumstick-rt-eassynth.so
+%%FLUIDSYNTH%%lib/drumstick2/libdrumstick-rt-fluidsynth.so
+%%NETWORK%%lib/drumstick2/libdrumstick-rt-net-in.so
+%%NETWORK%%lib/drumstick2/libdrumstick-rt-net-out.so
 lib/drumstick2/libdrumstick-rt-oss-in.so
 lib/drumstick2/libdrumstick-rt-oss-out.so
 %%ALSA%%lib/libdrumstick-alsa.so