From 1d5c7e771c036e72a1c516f49b7d7aa1a9da4bb7 Mon Sep 17 00:00:00 2001 From: Aleksa Sarai Date: Fri, 28 Oct 2022 12:58:10 +1100 Subject: [PATCH] build: drop build-time systemd dependency On openSUSE, our packages are build in the Open Build Service which does not have a proper systemd installation that you can query to get the systemdunitdir. The simplest solution is to re-add the ability to explicitly set the systemdunitdir (as was previously possible with the autotools build system in pre-5.0 LXC). Signed-off-by: Aleksa Sarai --- config/init/systemd/meson.build | 7 +++++-- meson_options.txt | 5 +++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/init/systemd/meson.build b/config/init/systemd/meson.build index 21e756504..741901016 100644 --- a/config/init/systemd/meson.build +++ b/config/init/systemd/meson.build @@ -8,8 +8,11 @@ lxc_apparmor_load = configure_file( install_dir: lxclibexec) if 'systemd' in init_script - systemd = dependency('systemd') - systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir') + systemd_system_unit_dir = get_option('systemd-unitdir') + if systemd_system_unit_dir == '' + systemd = dependency('systemd') + systemd_system_unit_dir = systemd.get_variable('systemdsystemunitdir') + endif configure_file( configuration: conf, diff --git a/meson_options.txt b/meson_options.txt index 7aefa2bd2..9803473d2 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -18,6 +18,11 @@ option('init-script', type : 'array', choices : ['systemd', 'sysvinit', 'upstart'], value : ['systemd'], description : 'init script') +# was --systemd-unidir in autotools +# If set to "", the value is taken from the running systemd instance. +option('systemd-unitdir', type : 'string', value: '', + description : 'systemd system unit directory') + # was --{disable,enable}-liburing in autotools option('io-uring-event-loop', type: 'boolean', value: 'false', description: 'Enable io-uring based event loop') -- 2.47.2