From 4957b6bfed9baaf945cf3c9a4db34efe72714936 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 19 Oct 2021 14:54:25 +1000 Subject: [PATCH] conf: template the set of with-foo module sets we install by default Make this a meson option in the form -Dwith-module-sets=jack,pulseaudio which will then install with-jack, with-pulseaudio. That's the default setting. And add a comment to the files themselves so it's more obvious what they are there for, just an empty file is confusing. --- media-session.d/meson.build | 6 ++++-- media-session.d/with-jack | 0 media-session.d/with-module-set.in | 5 +++++ media-session.d/with-pulseaudio | 0 meson_options.txt | 5 +++++ 5 files changed, 14 insertions(+), 2 deletions(-) delete mode 100644 media-session.d/with-jack create mode 100644 media-session.d/with-module-set.in delete mode 100644 media-session.d/with-pulseaudio diff --git a/media-session.d/meson.build b/media-session.d/meson.build index 3a6e9502a..5760ec029 100644 --- a/media-session.d/meson.build +++ b/media-session.d/meson.build @@ -7,10 +7,12 @@ conf_files = [ [ 'v4l2-monitor.conf', 'v4l2-monitor.conf' ], [ 'media-session.conf', 'media-session.conf' ], [ 'alsa-monitor.conf', 'alsa-monitor.conf' ], - [ 'with-jack', 'with-jack' ], - [ 'with-pulseaudio', 'with-pulseaudio' ], ] +foreach opt : get_option('with-module-sets') + conf_files += [ [ 'with-module-set.in', 'with-@0@'.format(opt) ] ] +endforeach + foreach c : conf_files configure_file(input : c.get(0), output : c.get(1), diff --git a/media-session.d/with-jack b/media-session.d/with-jack deleted file mode 100644 index e69de29bb..000000000 diff --git a/media-session.d/with-module-set.in b/media-session.d/with-module-set.in new file mode 100644 index 000000000..e7a827559 --- /dev/null +++ b/media-session.d/with-module-set.in @@ -0,0 +1,5 @@ +# This file is part of Media Session @VERSION@ +# +# Add this file to @MEDIA_SESSION_CONFIG_DIR@/media-session.d/ +# to load the corresponding module list in the in the media-session.conf +# session.modules[] array. diff --git a/media-session.d/with-pulseaudio b/media-session.d/with-pulseaudio deleted file mode 100644 index e69de29bb..000000000 diff --git a/meson_options.txt b/meson_options.txt index 9b13a8295..d25b03aea 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -29,3 +29,8 @@ option('systemd-user-service', option('systemd-user-unit-dir', type : 'string', description : 'Directory for user systemd units (defaults to /usr/lib/systemd/user)') +option('with-module-sets', + description : 'Extra modules sets to enable on install (see media-session.conf)', + type : 'array', + choices : ['alsa', 'jack', 'pulseaudio'], + value : ['jack', 'pulseaudio'])