pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

rtmidi: add options.mk



Module Name:	pkgsrc-wip
Committed By:	Niclas Rosenvik <nros%pkgsrc.org@localhost>
Pushed By:	nros
Date:		Sun Dec 26 13:02:44 2021 +0100
Changeset:	fdfc4d81f3e75df0620ca6bfa63e872be7518946

Modified Files:
	rtmidi/Makefile
Added Files:
	rtmidi/options.mk

Log Message:
rtmidi: add options.mk

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=fdfc4d81f3e75df0620ca6bfa63e872be7518946

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 rtmidi/Makefile   | 10 ++--------
 rtmidi/options.mk | 39 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 8 deletions(-)

diffs:
diff --git a/rtmidi/Makefile b/rtmidi/Makefile
index 14634b045d..9ea1105f09 100644
--- a/rtmidi/Makefile
+++ b/rtmidi/Makefile
@@ -13,17 +13,11 @@ USE_CMAKE=	yes
 USE_TOOLS+=	pkg-config
 USE_LANGUAGES=	c c++
 
-.include "../../mk/bsd.prefs.mk"
-.if ${OPSYS} != "Linux"
-CMAKE_ARGS+=	-DRTMIDI_API_ALSA=OFF
-.endif
 CMAKE_ARGS+=	-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON
 
 PKGCONFIG_OVERRIDE+=	rtmidi.pc.in
 
-.if ${OPSYS} == "Linux"
-.include "../../audio/alsa-lib/buildlink3.mk"
-.endif
-.include "../../audio/jack/buildlink3.mk"
+.include "options.mk"
+
 .include "../../mk/pthread.buildlink3.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/rtmidi/options.mk b/rtmidi/options.mk
new file mode 100644
index 0000000000..0b7b4f4907
--- /dev/null
+++ b/rtmidi/options.mk
@@ -0,0 +1,39 @@
+# $NetBSD$
+
+PKG_OPTIONS_VAR=		PKG_OPTIONS.rtmidi
+PKG_OPTIONS_SET.driver=		alsa coreaudio jack
+PKG_OPTIONS_NONEMPTY_SETS=	driver
+
+.include "../../mk/bsd.prefs.mk"
+
+PKG_SUGGESTED_OPTIONS=	jack
+
+.if ${OPSYS} == "Linux"
+PKG_SUGGESTED_OPTIONS+=	alsa
+.endif
+
+.if ${OPSYS} == "Darwin"
+PKG_SUGGESTED_OPTIONS+=	coreaudio
+.endif
+
+.include "../../mk/bsd.options.mk"
+
+.if !empty(PKG_OPTIONS:Malsa)
+CMAKE_ARGS+=	-DRTMIDI_API_ALSA=ON
+.include "../../audio/alsa-lib/buildlink3.mk"
+.else
+CMAKE_ARGS+=	-DRTMIDI_API_ALSA=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mcoreaudio)
+CMAKE_ARGS+=	-DRTMIDI_API_CORE=ON
+.else
+CMAKE_ARGS+=	-DRTMIDI_API_CORE=OFF
+.endif
+
+.if !empty(PKG_OPTIONS:Mjack)
+CMAKE_ARGS+=	-DRTMIDI_API_JACK=ON
+.include "../../audio/jack/buildlink3.mk"
+.else
+CMAKE_ARGS+=	-DRTMIDI_API_JACK=OFF
+.endif


Home | Main Index | Thread Index | Old Index