Skip to content

Commit

Permalink
meson.build: properly get systemd unit path
Browse files Browse the repository at this point in the history
Instead of hardcoding the systemd unit path, extract it via a systemd
dependency.

Signed-off-by: Jonas Gorski <[email protected]>
  • Loading branch information
KanjiMonster committed Aug 12, 2024
1 parent 17b0a2b commit 7975af0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7975af0

Please sign in to comment.