mirror of https://github.com/nirenjan/libx52.git
fix: Fix systemd service installation in Meson
The Meson build change broke the systemd service file installation. This commit fixes that, while retaining Autotools support.master
parent
e9a806a6a2
commit
33bbafe970
|
|
@ -62,3 +62,24 @@ x52d_mouse_test = executable('x52d-mouse-test', x52d_mouse_test_sources,
|
|||
|
||||
test('x52d-mouse-test', x52d_mouse_test, protocol: 'tap')
|
||||
|
||||
# Install service file
|
||||
if dep_systemd.found()
|
||||
systemd_system_unit_dir = get_option('systemd-unit-dir')
|
||||
if systemd_system_unit_dir == ''
|
||||
systemd_system_unit_dir = dep_systemd.get_variable(
|
||||
pkgconfig: 'systemd_system_unit_dir',
|
||||
default_value: '/lib/systemd/system')
|
||||
endif
|
||||
sed = find_program('sed')
|
||||
bindir_path = get_option('prefix') / get_option('bindir')
|
||||
sed_script = 's|%bindir%|' + bindir_path + '|g'
|
||||
|
||||
systemd_service_file = configure_file(
|
||||
input: 'x52d.service.in',
|
||||
output: 'x52d.service',
|
||||
command: [sed, sed_script, '@INPUT@'],
|
||||
capture: true,
|
||||
install: true,
|
||||
install_dir: systemd_system_unit_dir
|
||||
)
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -2,6 +2,11 @@ option('systemd-logs',
|
|||
type: 'feature',
|
||||
description: 'Hide timestamps in log messages, needed for systemd')
|
||||
|
||||
option('systemd-unit-dir',
|
||||
type: 'string',
|
||||
value: '',
|
||||
description: 'Directory for systemd service files (leave empty for auto-detection)')
|
||||
|
||||
option('nls',
|
||||
type: 'feature',
|
||||
description: 'Enable message translations')
|
||||
|
|
|
|||
Loading…
Reference in New Issue