From f2f7e4d0a7c84d7dcd0de3e0344c8b3844708da1 Mon Sep 17 00:00:00 2001 From: Jan Beich Date: Thu, 24 Dec 2020 23:24:05 +0000 Subject: [PATCH] build: add basu as sd-bus provider Based on https://github.com/swaywm/sway/commit/a52176f83035 --- main.c | 12 +++++++----- meson.build | 5 +++++ meson_options.txt | 2 +- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/main.c b/main.c index b15462e3..b0025e24 100644 --- a/main.c +++ b/main.c @@ -21,6 +21,8 @@ #include #elif HAVE_LIBELOGIND #include +#elif HAVE_BASU +#include #endif static struct org_kde_kwin_idle *idle_manager = NULL; @@ -714,7 +716,7 @@ static int parse_timeout(int argc, char **argv) { static int parse_sleep(int argc, char **argv) { #if !HAVE_LOGIND swayidle_log(LOG_ERROR, "%s not supported: swayidle was compiled " - "with neither systemd nor elogind support.", "before-sleep"); + "with neither systemd nor elogind nor basu support.", "before-sleep"); exit(-1); #endif if (argc < 2) { @@ -734,7 +736,7 @@ static int parse_sleep(int argc, char **argv) { static int parse_resume(int argc, char **argv) { #if !HAVE_LOGIND swayidle_log(LOG_ERROR, "%s not supported: swayidle was compiled " - "with neither systemd nor elogind support.", "after-resume"); + "with neither systemd nor elogind nor basu support.", "after-resume"); exit(-1); #endif if (argc < 2) { @@ -754,7 +756,7 @@ static int parse_resume(int argc, char **argv) { static int parse_lock(int argc, char **argv) { #if !HAVE_LOGIND swayidle_log(LOG_ERROR, "%s not supported: swayidle was compiled" - " with neither systemd nor elogind support.", "lock"); + " with neither systemd nor elogind nor basu support.", "lock"); exit(-1); #endif if (argc < 2) { @@ -774,7 +776,7 @@ static int parse_lock(int argc, char **argv) { static int parse_unlock(int argc, char **argv) { #if !HAVE_LOGIND swayidle_log(LOG_ERROR, "%s not supported: swayidle was compiled" - " with neither systemd nor elogind support.", "unlock"); + " with neither systemd nor elogind nor basu support.", "unlock"); exit(-1); #endif if (argc < 2) { @@ -794,7 +796,7 @@ static int parse_unlock(int argc, char **argv) { static int parse_idlehint(int argc, char **argv) { #if !HAVE_LOGIND swayidle_log(LOG_ERROR, "%s not supported: swayidle was compiled" - " with neither systemd nor elogind support.", "idlehint"); + " with neither systemd nor elogind nor basu support.", "idlehint"); exit(-1); #endif if (state.logind_idlehint) { diff --git a/meson.build b/meson.build index 6bc71c78..b147c0cf 100644 --- a/meson.build +++ b/meson.build @@ -87,8 +87,12 @@ if get_option('sd-bus-provider') == 'auto' if not sdbus.found() sdbus = dependency('libelogind', required: false, + not_found_message: 'libelogind not found, trying basu', ) endif + if not sdbus.found() + sdbus = dependency('basu', required: false) + endif else sdbus = dependency(get_option('sd-bus-provider'), required: get_option('logind')) endif @@ -107,6 +111,7 @@ conf_data = configuration_data() conf_data.set10('HAVE_LIBSYSTEMD', sdbus.found() and sdbus.name() == 'libsystemd') conf_data.set10('HAVE_LIBELOGIND', sdbus.found() and sdbus.name() == 'libelogind') +conf_data.set10('HAVE_BASU', sdbus.found() and sdbus.name() == 'basu') conf_data.set10('HAVE_LOGIND', have_logind) configure_file(output: 'config.h', configuration: conf_data) diff --git a/meson_options.txt b/meson_options.txt index f96aba0e..4cb0cb65 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,6 @@ option('man-pages', type: 'feature', value: 'auto', description: 'Generate and install man pages') option('logind', type: 'feature', value: 'auto', description: 'Enable support for logind') -option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind'], value: 'auto', description: 'Provider of the sd-bus library') +option('sd-bus-provider', type: 'combo', choices: ['auto', 'libsystemd', 'libelogind', 'basu'], value: 'auto', description: 'Provider of the sd-bus library') option('zsh-completions', type: 'boolean', value: true, description: 'Install zsh shell completions.') option('bash-completions', type: 'boolean', value: true, description: 'Install bash shell completions.') option('fish-completions', type: 'boolean', value: true, description: 'Install fish shell completions.')