meson: build musepack plugin
authorTim-Philipp Müller <tim@centricular.com>
Sun, 19 Aug 2018 14:50:25 +0000 (15:50 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sun, 19 Aug 2018 14:50:25 +0000 (15:50 +0100)
ext/meson.build
ext/musepack/meson.build [new file with mode: 0644]
meson_options.txt

index 0e65653..6ad70d4 100644 (file)
@@ -30,7 +30,7 @@ subdir('lv2')
 #subdir('modplug')
 subdir('mpeg2enc')
 subdir('mplex')
-#subdir('musepack')
+subdir('musepack')
 subdir('neon')
 #subdir('ofa')
 #subdir('openal')
diff --git a/ext/musepack/meson.build b/ext/musepack/meson.build
new file mode 100644 (file)
index 0000000..41434be
--- /dev/null
@@ -0,0 +1,16 @@
+mpcdec_dep = cc.find_library('mpcdec', required: get_option('musepack'))
+
+if mpcdec_dep.found() and cc.has_header_symbol('mpc/mpcdec.h', 'mpc_demux_init', dependencies: mpcdec_dep)
+  gstmusepack = library('gstmusepack',
+    'gstmusepackdec.c', 'gstmusepackreader.c',
+    c_args : gst_plugins_bad_args,
+    link_args : noseh_link_args,
+    include_directories : [configinc],
+    dependencies : [gstaudio_dep, mpcdec_dep],
+    install : true,
+    install_dir : plugins_install_dir,
+  )
+  pkgconfig.generate(gstmusepack, install_dir : plugins_pkgconfig_install_dir)
+elif get_option('musepack').enabled()
+  error('Could not find libmpcdec header files, but Musepack was enabled via options')
+endif
index 619c12a..5890557 100644 (file)
@@ -108,6 +108,7 @@ option('libmms', type : 'feature', value : 'auto', description : 'Microsoft mult
 option('lv2', type : 'feature', value : 'auto', description : 'LV2 audio plugin bridge')
 option('mpeg2enc', type : 'feature', value : 'auto', description : 'mpeg2enc video encoder plugin')
 option('mplex', type : 'feature', value : 'auto', description : 'mplex audio/video multiplexer plugin')
+option('musepack', type : 'feature', value : 'auto', description : 'libmpcdec Musepack decoder plugin')
 option('neon', type : 'feature', value : 'auto', description : 'NEON HTTP source plugin')
 option('openh264', type : 'feature', value : 'auto', description : 'H.264 video codec plugin')
 option('openjpeg', type : 'feature', value : 'auto', description : 'JPEG2000 image codec plugin')