From 7975af0cce12cec7d242b3be346ed34ae60eece8 Mon Sep 17 00:00:00 2001 From: Jonas Gorski Date: Mon, 12 Aug 2024 10:11:53 +0200 Subject: [PATCH] meson.build: properly get systemd unit path Instead of hardcoding the systemd unit path, extract it via a systemd dependency. Signed-off-by: Jonas Gorski --- meson.build | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 354c6af7..ef44c899 100644 --- a/meson.build +++ b/meson.build @@ -60,7 +60,12 @@ sources = files(''' # setup paths prefixdir = get_option('prefix') -systemunitdir = '/usr/lib/systemd/system' +systemd = dependency('systemd', required: false) +if systemd.found() + systemunitdir = systemd.get_variable('systemdsystemunitdir') +else + systemunitdir = '/lib/systemd/system' +endif if not prefixdir.startswith('/') error('Prefix is not absolute: "@0@"'.format(prefixdir)) endif