diff --git a/data/meson.build b/data/meson.build index 67d0087b9..12890ff8f 100644 --- a/data/meson.build +++ b/data/meson.build @@ -36,6 +36,7 @@ configure_file( install_dir : full_servicedir, ) +if use_systemd # Systemd user service systemd_unit = 'calls-daemon.service' configure_file( @@ -45,6 +46,7 @@ configure_file( install : true, install_dir : systemd_user_unit_dir, ) +endif desktop_utils = find_program('desktop-file-validate', required: false) if desktop_utils.found() diff --git a/meson.build b/meson.build index cb3cf1b19..a6f4463ac 100644 --- a/meson.build +++ b/meson.build @@ -59,9 +59,16 @@ libcall_ui_dep = dependency('call-ui', default_options: ['tests=false', 'examples=false', 'gtk_doc=false'], ) +use_systemd = get_option('logind_provider') == 'systemd' +if use_systemd + libsystemd_dep = dependency('libsystemd', version: '>= 209', required: true) +elif get_option('logind_provider') == 'elogind' + libelogind_dep = dependency('libelogind', version: '>= 209', required: true) +endif + systemd_user_unit_dir = get_option('systemd_user_unit_dir') systemd_dep = dependency('systemd', required: false) -if systemd_user_unit_dir == '' +if systemd_user_unit_dir == '' and use_systemd if systemd_dep.found() systemd_user_unit_dir = systemd_dep.get_variable('systemd_user_unit_dir') else diff --git a/meson_options.txt b/meson_options.txt index d9c08c96f..1561a195e 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -17,3 +17,7 @@ option('gst_debug', option('systemd_user_unit_dir', type: 'string', value: '', description: 'Directory for systemd user units') + +option('logind_provider', + type: 'combo', choices: ['systemd', 'elogind'], value: 'systemd', + description: 'logind implementation') \ No newline at end of file