From 60fb3ca6ad0ccdd5aba06056f2bb2c90fe2e7b66 Mon Sep 17 00:00:00 2001 From: Aster Boese Date: Sun, 25 Jan 2026 20:12:10 -0500 Subject: [PATCH] meson: allow installing systemd service without systemd A vendor may support systemd while not installing it in the build environment. This would cause systemd to not be detected and the service to not be installed. Changes the logic to be based off of explicitly listing the option instead of automatically detected. Signed-off-by: Aster Boese --- meson_options.txt | 2 +- services/meson.build | 3 +-- services/systemd/meson.build | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index c8560b6..0fe93ec 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,4 @@ option('man', type : 'feature', value : 'auto', description : 'build manpage with ronn') -option('systemd', type : 'feature', value : 'auto', +option('systemd', type : 'boolean', value : true, description :'enable systemd support') diff --git a/services/meson.build b/services/meson.build index 0be40f1..2c56c01 100644 --- a/services/meson.build +++ b/services/meson.build @@ -1,4 +1,3 @@ -systemd = dependency('systemd', required: get_option('systemd')) -if systemd.found() +if get_option('systemd') subdir('systemd') endif diff --git a/services/systemd/meson.build b/services/systemd/meson.build index eccbde7..ae746fa 100644 --- a/services/systemd/meson.build +++ b/services/systemd/meson.build @@ -1,5 +1,5 @@ -unitdir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir') prefixdir = get_option('prefix') +unitdir = join_paths(prefixdir, get_option('libdir'), 'systemd', 'system') bindir = join_paths(prefixdir, get_option('bindir')) unit_conf = configuration_data()