Skip to content

Commit

Permalink
Rename session tracking build options
Browse files Browse the repository at this point in the history
Use logind (instead of libsystemd-login) and elogind (instead of
libelogind) as valid options for the session tracking build option.
As logind is the most commonly used option, default to that.
  • Loading branch information
mbiebl authored and jrybar-rh committed Mar 19, 2024
1 parent 60673b8 commit efa615e
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ COMMON_BUILD_OPTS=(
-Dexamples=true
-Dgtk_doc=true
-Dintrospection=true
-Dsession_tracking=libsystemd-login
-Dsession_tracking=logind
-Dtests=true
)

Expand Down
2 changes: 1 addition & 1 deletion .packit/polkit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Libraries files for polkit.
-D gtk_doc=true \
-D introspection=true \
-D man=true \
-D session_tracking=libsystemd-login \
-D session_tracking=logind \
-D tests=false

%meson_build
Expand Down
2 changes: 1 addition & 1 deletion data/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ if enable_pam
)
endif

if session_tracking == 'libsystemd-login'
if session_tracking == 'logind'
configure_file(
input: 'polkit.service.in',
output: '@BASENAME@',
Expand Down
10 changes: 5 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -193,17 +193,17 @@ if config_h.get('HAVE_SETNETGRENT', false)
config_h.set('HAVE_SETNETGRENT_RETURN', cc.compiles(setnetgrent_return_src, name: 'setnetgrent return support'))
endif

# Select wether to use libsystemd-login, libelogind or ConsoleKit for session tracking
# Select wether to use logind, elogind or ConsoleKit for session tracking
session_tracking = get_option('session_tracking')
enable_logind = (session_tracking != 'ConsoleKit')
if enable_logind
if session_tracking == 'libsystemd-login'
if session_tracking == 'logind'
logind_dep = dependency('libsystemd', required: false)
if not logind_dep.found()
logind_dep = dependency('libsystemd-login', not_found_message: 'libsystemd support requested but libsystemd or libsystemd-login library not found')
logind_dep = dependency('libsystemd-login', not_found_message: 'logind support requested but libsystemd or libsystemd-login library not found')
endif
else
logind_dep = dependency('libelogind', not_found_message: 'libelogind support requested but libelogind library not found')
logind_dep = dependency('libelogind', not_found_message: 'elogind support requested but libelogind library not found')
endif

func = 'sd_uid_get_display'
Expand All @@ -213,7 +213,7 @@ if enable_logind

# systemd unit / service files
systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
if systemd_systemdsystemunitdir == '' and session_tracking == 'libsystemd-login'
if systemd_systemdsystemunitdir == '' and session_tracking == 'logind'
systemd_dep = dependency('systemd', not_found_message: 'systemd required but not found, please provide a valid systemd user unit dir or disable it')
# FIXME: systemd.pc file does not use variables with relative paths, so `define_variable` cannot be used
systemd_systemdsystemunitdir = systemd_dep.get_pkgconfig_variable('systemdsystemunitdir')
Expand Down
2 changes: 1 addition & 1 deletion meson_options.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
option('session_tracking', type: 'combo', choices: ['libsystemd-login', 'libelogind', 'ConsoleKit'], value: 'ConsoleKit', description: 'session tracking (libsystemd-login/libelogind/ConsoleKit)')
option('session_tracking', type: 'combo', choices: ['logind', 'elogind', 'ConsoleKit'], value: 'logind', description: 'session tracking (logind/elogind/ConsoleKit)')
option('systemdsystemunitdir', type: 'string', value: '', description: 'custom directory for systemd system units')

option('libs-only', type: 'boolean', value: false, description: 'Only build libraries (skips building polkitd)')
Expand Down

0 comments on commit efa615e

Please sign in to comment.