meson: build tinyalsa plugin
authorTim-Philipp Müller <tim@centricular.com>
Sat, 15 Dec 2018 20:02:48 +0000 (20:02 +0000)
committerSebastian Dröge <slomo@coaxion.net>
Mon, 17 Dec 2018 09:12:53 +0000 (09:12 +0000)
meson_options.txt
sys/meson.build
sys/tinyalsa/meson.build [new file with mode: 0644]

index 49b3787..513aa06 100644 (file)
@@ -130,6 +130,7 @@ option('soundtouch', type : 'feature', value : 'auto', description : 'Audio pitc
 option('spandsp', type : 'feature', value : 'auto', description : 'Packet loss concealment audio plugin')
 option('srt', type : 'feature', value : 'auto', description : 'Secure, Reliable, Transport client/server network source/sink plugin')
 option('srtp', type : 'feature', value : 'auto', description : 'Secure RTP codec plugin')
+option('tinyalsa', type : 'feature', value : 'auto', description : 'TinyALSA plugin')
 option('ttml', type : 'feature', value : 'auto', description : 'TTML subtitle parser and renderer plugin')
 option('uvch264', type : 'feature', value : 'auto', description : 'UVC compliant H.264 camera source plugin')
 option('vcd', type : 'feature', value : 'auto', description : 'VCD source plugin')
index 1129282..d22d6ac 100644 (file)
@@ -17,6 +17,7 @@ subdir('kms')
 subdir('msdk')
 subdir('opensles')
 subdir('shm')
+subdir('tinyalsa')
 subdir('uvch264')
 subdir('vcd')
 #subdir('vdpau')
diff --git a/sys/tinyalsa/meson.build b/sys/tinyalsa/meson.build
new file mode 100644 (file)
index 0000000..0bf4c72
--- /dev/null
@@ -0,0 +1,29 @@
+if get_option('tinyalsa').disabled()
+  subdir_done()
+endif
+
+have_tinyalsa = cc.has_header ('tinyalsa/asoundlib.h')
+if not have_tinyalsa
+  tinyalsa_dep = cc.find_library('tinyalsa', required: false)
+  have_tinyalsa = tinyalsa_dep.found()
+endif
+
+if not have_tinyalsa
+  tinyalsa_dep = dependency('tinyalsa', required: get_option('tinyalsa'),
+                            fallback: ['tinyalsa', 'tinyalsa_dep'])
+  have_tinyalsa = tinyalsa_dep.found()
+endif
+
+if have_tinyalsa
+  gsttinyalsa = library('gsttinyalsa',
+    'tinyalsa.c', 'tinyalsasink.c',
+    c_args: gst_plugins_bad_args,
+    include_directories: [configinc],
+    dependencies : [gstbase_dep, gstaudio_dep, tinyalsa_dep],
+    install: true,
+    install_dir: plugins_install_dir
+  )
+  pkgconfig.generate(gsttinyalsa, install_dir: plugins_pkgconfig_install_dir)
+elif get_option('tinyalsa').enabled()
+  error('tinyalsa plugin enabled but TinyALSA library or headers not found')
+endif