~kennylevinsen/seatd-devel

seatd: build: add explicit logind provider option, auto-detect by default v1 APPLIED

Simon Ser: 1
 build: add explicit logind provider option, auto-detect by default

 2 files changed, 14 insertions(+), 10 deletions(-)
build pending: smoketest-seatd.sh
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/seatd-devel/patches/21864/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH seatd] build: add explicit logind provider option, auto-detect by default Export this patch

Allow package maintainers to explicitly select a logind provider
by passing -Dlogind=systemd or -Dlogind=elogind. In case both are
available (e.g. for distributions which support both), this makes
it possible to gte deterministic behavior.

By default, auto-detect the logind provider. That way, users which
have systemd or elogind installed get the backend built by default.
---
 meson.build       | 22 +++++++++++++---------
 meson_options.txt |  2 +-
 2 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/meson.build b/meson.build
index 482f8777d8c9..5d67d5943deb 100644
--- a/meson.build
+++ b/meson.build
@@ -108,13 +108,19 @@ if get_option('seatd').enabled()
endif

logind_provider = ''
if not get_option('logind').disabled()
	foreach logind_provider : ['elogind', 'systemd']
		logind = dependency('lib@0@'.format(logind_provider), required: false)
		if logind.found()
			break
		endif
	endforeach
if get_option('logind') != 'disabled'
	if get_option('logind') == 'auto'
		assert(get_option('auto_features').auto(), '-Dlogind must be set to systemd or elogind since auto_features != auto')
		foreach logind_provider : ['elogind', 'systemd']
			logind = dependency('lib@0@'.format(logind_provider), required: false)
			if logind.found()
				break
			endif
		endforeach
	else
		logind_provider = get_option('logind')
		logind = dependency('lib@0@'.format(logind_provider))
	endif

	if logind.found()
		add_project_arguments('-DLOGIND_ENABLED=1', language: 'c')
@@ -124,8 +130,6 @@ if not get_option('logind').disabled()
			'common/drm.c',
		]
		private_deps += logind
	elif get_option('logind').enabled()
		error('logind backend was enabled but no supported logind provider was found')
	endif
endif

diff --git a/meson_options.txt b/meson_options.txt
index 73b9634c2ce6..9c36fa3fc90c 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,4 +1,4 @@
option('logind', type: 'feature', value: 'disabled', description: 'logind support')
option('logind', type: 'combo', choices: ['auto', 'disabled', 'elogind', 'systemd'], value: 'auto', description: 'logind support')
option('seatd', type: 'feature', value: 'enabled', description: 'seatd support')
option('builtin', type: 'feature', value: 'disabled', description: 'builtin seatd server')
option('server', type: 'feature', value: 'enabled', description: 'seatd server')
-- 
2.31.1
Applied, thanks!