git: 076f21eb4dd1 - main - audio/rtaudio: Add options for several (all supported) audio backends

From: Yuri Victorovich <yuri_at_FreeBSD.org>
Date: Fri, 24 Jun 2022 07:20:52 UTC
The branch main has been updated by yuri:

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

commit 076f21eb4dd17a66ced3e62e6bfad24fb85c1d4a
Author:     Yuri Victorovich <yuri@FreeBSD.org>
AuthorDate: 2022-06-24 06:18:36 +0000
Commit:     Yuri Victorovich <yuri@FreeBSD.org>
CommitDate: 2022-06-24 07:20:46 +0000

    audio/rtaudio: Add options for several (all supported) audio backends
---
 audio/rtaudio/Makefile  | 25 ++++++++++++++++---------
 audio/rtaudio/pkg-plist |  4 ++++
 2 files changed, 20 insertions(+), 9 deletions(-)

diff --git a/audio/rtaudio/Makefile b/audio/rtaudio/Makefile
index 293dfae2a92f..e65649349925 100644
--- a/audio/rtaudio/Makefile
+++ b/audio/rtaudio/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	rtaudio
 DISTVERSION=	5.2.0
+PORTREVISION=	1
 CATEGORIES=	audio
 
 MAINTAINER=	yuri@FreeBSD.org
@@ -7,23 +8,29 @@ COMMENT=	C++ classes that provide a common API for realtime audio input/output
 
 LICENSE=	MIT
 
-USES=		autoreconf compiler:c++11-lang libtool pkgconfig
+USES=		cmake compiler:c++11-lang libtool pkgconfig
 USE_LDCONFIG=	yes
 
 USE_GITHUB=	yes
 GH_ACCOUNT=	thestk
 
-GNU_CONFIGURE=	yes
-CONFIGURE_ARGS=	--disable-static
+OPTIONS_MULTI=			AUDIO_BACKEND
+OPTIONS_MULTI_AUDIO_BACKEND=	ALSA JACK OSS PULSEAUDIO
+OPTIONS_DEFAULT=		PULSEAUDIO # default should probably be OSS, but it appears to be broken
 
-INSTALL_TARGET=	install-strip
+AUDIO_BACKEND_DESC=		Audio backend
 
-OPTIONS_DEFINE=			PULSEAUDIO
-OPTIONS_DEFAULT=		PULSEAUDIO
+ALSA_CMAKE_BOOL=		RTAUDIO_API_ALSA
+ALSA_LIB_DEPENDS=		libasound.so:audio/alsa-lib
 
-PULSEAUDIO_CONFIGURE_WITH=	pulse
-PULSEAUDIO_USES=		localbase:ldflags
-PULSEAUDIO_LDFLAGS=		-lpulse # see https://github.com/thestk/rtaudio/issues/293
+JACK_CMAKE_BOOL=		RTAUDIO_API_JACK
+JACK_LDFLAGS=			`pkg-config --libs jack` # workaround for https://github.com/thestk/rtaudio/issues/357
+JACK_LIB_DEPENDS=		libjack.so:audio/jack
+
+OSS_CMAKE_BOOL=			RTAUDIO_API_OSS # OSS option is possibly broken, see https://github.com/thestk/rtaudio/issues/359
+
+PULSEAUDIO_CMAKE_BOOL=		RTAUDIO_API_PULSE # is PULSEAUFIO broken? see https://github.com/thestk/rtaudio/issues/361
+PULSEAUDIO_USES=		localbase:ldflags # workaround for https://github.com/thestk/rtaudio/issues/360
 PULSEAUDIO_LIB_DEPENDS=		libpulse.so:audio/pulseaudio
 
 .include <bsd.port.mk>
diff --git a/audio/rtaudio/pkg-plist b/audio/rtaudio/pkg-plist
index 195a4298eb9c..a2ae0352c0d9 100644
--- a/audio/rtaudio/pkg-plist
+++ b/audio/rtaudio/pkg-plist
@@ -4,3 +4,7 @@ lib/librtaudio.so
 lib/librtaudio.so.6
 lib/librtaudio.so.6.0.2
 libdata/pkgconfig/rtaudio.pc
+%%DATADIR%%/RtAudioConfig-version.cmake
+%%DATADIR%%/RtAudioConfig.cmake
+%%DATADIR%%/RtAudioTargets-%%CMAKE_BUILD_TYPE%%.cmake
+%%DATADIR%%/RtAudioTargets.cmake