Skip to content

Commit bab1f34

Browse files
committed
meson.build: allow systemd service installation without systemd at buildtime
If the unit directory is already provided, we don't need systemd. It allows Alpine to package systemd services (e.g. for postmarketOS) without having systemd in Alpine. Signed-off-by: Achill Gilgenast <[email protected]>
1 parent 5923eea commit bab1f34

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

meson.build

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,10 @@ prefix = get_option('prefix')
1313
with_qrtr_ns = get_option('qrtr-ns')
1414

1515
install_systemd_unit = get_option('systemd-service')
16-
systemd = dependency('systemd', required : install_systemd_unit)
17-
if systemd.found()
18-
systemd_system_unit_dir = get_option('systemd-unit-prefix')
16+
systemd_system_unit_dir = get_option('systemd-unit-prefix')
17+
systemd = dependency('systemd', required : false)
18+
enable_systemd = systemd.found() or (install_systemd_unit and systemd_system_unit_dir != '')
19+
if enable_systemd
1920
if systemd_system_unit_dir == ''
2021
systemd_system_unit_dir = systemd.get_variable(
2122
pkgconfig : 'systemdsystemunitdir',
@@ -31,7 +32,7 @@ subdir('lib')
3132
subdir('include')
3233
subdir('src')
3334

34-
if systemd.found() and with_qrtr_ns.enabled()
35+
if enable_systemd and with_qrtr_ns.enabled()
3536
systemd_unit_conf = configuration_data()
3637
systemd_unit_conf.set('prefix', prefix)
3738
configure_file(

0 commit comments

Comments
 (0)