]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
build: drop build-time systemd dependency 4215/head
authorAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 01:58:10 +0000 (12:58 +1100)
committerAleksa Sarai <cyphar@cyphar.com>
Fri, 28 Oct 2022 03:34:28 +0000 (14:34 +1100)
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 <cyphar@cyphar.com>
config/init/systemd/meson.build
meson_options.txt

index 21e75650404d650638e99d9933cea4126f67062d..7419010167b8fde232e3c7909ad169679db5fbac 100644 (file)
@@ -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,
index 7aefa2bd2e5bc339fe63139890c46cd8dc6a6f04..9803473d2f3c9e2dc13c6b56efad60bfbd298c3a 100644 (file)
@@ -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')