about summary refs log tree commit diff
path: root/pkgs/servers/pulseaudio/0005-Enable-CoreAudio-on-darwin.patch
blob: bdf5ff2b9ca354a006225b7444f530486807faba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
diff --git a/meson.build b/meson.build
index c5135330f..055567479 100644
--- a/meson.build
+++ b/meson.build
@@ -185,6 +185,7 @@ endif
 # rather than ending up in the config.h file?
 if host_machine.system() == 'darwin'
   cdata.set('OS_IS_DARWIN', 1)
+  cdata.set('HAVE_COREAUDIO', 1)
   cdata.set('_DARWIN_C_SOURCE', '200112L') # Needed to get NSIG on Mac OS
 elif host_machine.system() == 'windows'
   cdata.set('OS_IS_WIN32', 1)
diff --git a/src/modules/meson.build b/src/modules/meson.build
index 1e12569dc..53a800927 100644
--- a/src/modules/meson.build
+++ b/src/modules/meson.build
@@ -63,6 +63,14 @@ all_modules = [
   [ 'module-volume-restore', 'module-volume-restore.c' ],
 ]
 
+if host_machine.system() == 'darwin'
+  coreaudio_dep = dependency('appleframeworks', modules : ['AudioUnit', 'Cocoa', 'CoreServices', 'CoreAudio'])
+  all_modules += [
+    [ 'module-coreaudio-detect', 'macosx/module-coreaudio-detect.c', [], [], [coreaudio_dep] ],
+    [ 'module-coreaudio-device', 'macosx/module-coreaudio-device.c', [], [], [coreaudio_dep] ],
+  ]
+endif
+
 if host_machine.system() == 'windows'
   winmm_dep = meson.get_compiler('c').find_library('winmm')
   ksuser_dep = meson.get_compiler('c').find_library('ksuser')