From 70e3173f9993ef002ec8a4e8e809a7a8be612629 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Fri, 24 Apr 2026 10:27:55 +0200 Subject: [PATCH] build: add systemd-session feature option Let distributors opt out of installing labwc-session.target at configure time. Default is 'auto' (install if the systemd pkg-config file is present), 'enabled' forces it on, 'disabled' skips it entirely. --- meson.build | 8 +++++--- meson_options.txt | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index e2d2f585..7e345ba6 100644 --- a/meson.build +++ b/meson.build @@ -212,9 +212,11 @@ install_data('data/labwc.desktop', install_dir: get_option('datadir') / 'wayland install_data('data/labwc-portals.conf', install_dir: get_option('datadir') / 'xdg-desktop-portal') # Install labwc-session.target so that systemd user services with -# WantedBy=graphical-session.target start under labwc. Labwc activates -# this target itself in src/config/session.c on autostart. -systemd = dependency('systemd', required: false) +# WantedBy=graphical-session.target can be started and stopped in sync +# with a labwc session (see labwc(1) SESSION MANAGEMENT for the opt-in +# autostart/shutdown snippet). +systemd_feat = get_option('systemd-session') +systemd = dependency('systemd', required: systemd_feat) if systemd.found() install_data('data/labwc-session.target', install_dir: systemd.get_variable('systemduserunitdir')) diff --git a/meson_options.txt b/meson_options.txt index a47efa86..e059220d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -4,6 +4,7 @@ option('svg', type: 'feature', value: 'enabled', description: 'Enable svg window option('icon', type: 'feature', value: 'enabled', description: 'Enable window icons') option('labnag', type: 'feature', value: 'auto', description: 'Build labnag notification daemon') option('nls', type: 'feature', value: 'auto', description: 'Enable native language support') +option('systemd-session', type: 'feature', value: 'auto', description: 'Install labwc-session.target systemd user unit') option('static_analyzer', type: 'feature', value: 'disabled', description: 'Run gcc static analyzer') option('test', type: 'feature', value: 'disabled', description: 'Run tests') option('sections', type: 'feature', value: 'disabled', description: 'Show unused functions')