audio/din: Unbreak build on Darwin

Also add option for Apple's coreaudio
No changes affecting other platforms
This commit is contained in:
bacon 2023-11-08 16:49:02 +00:00
parent 57699aa6d9
commit 6d6a0f5d7e
6 changed files with 32 additions and 13 deletions

View file

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.47 2023/09/12 07:55:11 fox Exp $
# $NetBSD: Makefile,v 1.48 2023/11/08 16:49:02 bacon Exp $
DISTNAME= din-57
CATEGORIES= audio
@ -13,8 +13,19 @@ USE_LANGUAGES= c c++
USE_TOOLS+= autoreconf pkg-config gmake
GNU_CONFIGURE= yes
LIBS+= -ltcl -lSDL -lGL -lpthread
LIBS.Darwin+= -lSDLmain -lSDL -Wl,-framework,Cocoa
.include "../../mk/bsd.prefs.mk"
# Work around syntax errors from clang 15.0.0
.if ${OPSYS} == "Darwin" && ${OS_VERSION:R} >= 14
CXXFLAGS+= -std=c++20
.endif
# Don't depend on -lGL on Darwin, otherwise a black screen is produced
.if ${OPSYS} == "Darwin"
LIBS+= -ltcl -lSDLmain -lSDL -framework Cocoa -framework OpenGL -lpthread
.else
LIBS+= -ltcl -lSDL -lGL -lpthread
.endif
.include "options.mk"

View file

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.11 2023/09/12 07:55:11 fox Exp $
@comment $NetBSD: PLIST,v 1.12 2023/11/08 16:49:02 bacon Exp $
bin/din
share/applications/din.desktop
share/din/factory/2600

View file

@ -1,8 +1,8 @@
$NetBSD: distinfo,v 1.32 2023/09/12 07:55:11 fox Exp $
$NetBSD: distinfo,v 1.33 2023/11/08 16:49:02 bacon Exp $
BLAKE2s (din-57.tar.gz) = 22e6611ca0c80ff57133997b4c9a77ce02c1bd31a878597192dcad8e895e124a
SHA512 (din-57.tar.gz) = 03dfa45fb8c58f3f8dc739ec3c4c31029c544d9f0b1cf3dbae61643e5accd951ad65ebf19c078bfb1d30d3a8ccea7ffec2f1cb44f38bab1b07cfd2071361590c
Size (din-57.tar.gz) = 3693381 bytes
SHA1 (patch-src_Makefile.am) = dd222d23a5a4c95a803c88d3467eb2a5fe7c09a0
SHA1 (patch-src_Makefile.am) = 5fd638028053e70b29874fd588b0d66d4417b40e
SHA1 (patch-src_Makefile.in) = 3135bd8315cfdd65e7d885fc80f4baa89b7d94dc
SHA1 (patch-src_RtMidi.cpp) = ef74046633dd51666aeab206ec95b3266334a11b
SHA1 (patch-src_RtMidi.cpp) = 5c919adff2d5adb2683cfa5890748396a1918a3d

View file

@ -1,8 +1,8 @@
# $NetBSD: options.mk,v 1.2 2019/08/07 23:49:02 fox Exp $
# $NetBSD: options.mk,v 1.3 2023/11/08 16:49:02 bacon Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.din
PKG_OPTIONS_OPTIONAL_GROUPS= backend
PKG_OPTIONS_GROUP.backend= alsa jack
PKG_OPTIONS_GROUP.backend= alsa jack coreaudio
PKG_SUGGESTED_OPTIONS= jack
.include "../../mk/bsd.options.mk"
@ -24,3 +24,11 @@ CXXFLAGS+= -D__UNIX_JACK__
LIBS+= -ljack
.include "../../audio/jack/buildlink3.mk"
.endif
###
### Support CoreAudio
###
.if !empty(PKG_OPTIONS:Mcoreaudio)
CXXFLAGS+= -D__MACOSX_CORE__
LIBS+= -framework CoreMIDI -framework CoreAudio -framework CoreFoundation
.endif

View file

@ -1,4 +1,4 @@
$NetBSD: patch-src_Makefile.am,v 1.14 2022/10/01 09:46:56 fox Exp $
$NetBSD: patch-src_Makefile.am,v 1.15 2023/11/08 16:49:02 bacon Exp $
Removed tcl8.6, asound and jack flags, this is now handled in the pkgsrc
script.
@ -11,7 +11,7 @@ script.
-AM_CXXFLAGS = -I /usr/include/tcl8.6 -Wall -D_THREAD_SAFE -DHAVE_OPENGL -D__LICENSED__ -D__SVG__ -D__GPL20__ -D__BOOST_TIME__ -DPREFIX=\"@prefix@\"
-LIBS += -ltcl8.6 -lSDL -lGL -lpthread -lasound
+AM_CXXFLAGS = -Wall -D_THREAD_SAFE -DHAVE_OPENGL -D__LICENSED__ -D__SVG__ -D__GPL20__ -D__BOOST_TIME__ -DPREFIX=\"@prefix@\"
+LIBS += -lSDL -lGL -lpthread
+LIBS += @LIBS@
bin_PROGRAMS = din

View file

@ -1,4 +1,4 @@
$NetBSD: patch-src_RtMidi.cpp,v 1.1 2023/09/12 07:55:11 fox Exp $
$NetBSD: patch-src_RtMidi.cpp,v 1.2 2023/11/08 16:49:02 bacon Exp $
Use process scheduling from NetBSD instead of pthread.
@ -8,7 +8,7 @@ Use process scheduling from NetBSD instead of pthread.
return;
while ( jack_ringbuffer_write_space(data->buff) < sizeof(nBytes) + size )
+#if defined(__NetBSD__)
+#if defined(__NetBSD__) || defined(__APPLE__)
+ sched_yield();
+#else
pthread_yield();