Systemd fixes

Fix installation path, install the service only if the systemd option is enabled
This commit is contained in:
Pavel Solovev 2024-11-01 13:54:17 +00:00 committed by Mihai Fufezan
parent 3c0605c68e
commit 29e7dc6428
2 changed files with 5 additions and 2 deletions

View file

@ -53,7 +53,9 @@ epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs
# Handle options # Handle options
if get_option('systemd').enabled() if get_option('systemd').enabled()
systemd = dependency('systemd')
add_project_arguments('-DUSES_SYSTEMD', language: 'cpp') add_project_arguments('-DUSES_SYSTEMD', language: 'cpp')
subdir('systemd')
endif endif
if get_option('legacy_renderer').enabled() if get_option('legacy_renderer').enabled()
@ -89,7 +91,6 @@ subdir('hyprpm/src')
subdir('assets') subdir('assets')
subdir('example') subdir('example')
subdir('docs') subdir('docs')
subdir('systemd')
# Generate hyprland.pc # Generate hyprland.pc
pkg_install_dir = join_paths(get_option('datadir'), 'pkgconfig') pkg_install_dir = join_paths(get_option('datadir'), 'pkgconfig')

View file

@ -7,9 +7,11 @@ install_data(
conf_data = configuration_data() conf_data = configuration_data()
conf_data.set('PREFIX', get_option('prefix')) conf_data.set('PREFIX', get_option('prefix'))
conf_data.set('BINDIR', get_option('bindir')) conf_data.set('BINDIR', get_option('bindir'))
user_unit_dir = systemd.get_variable(pkgconfig: 'systemduserunitdir',
pkgconfig_define: ['prefix', get_option('prefix')])
configure_file( configure_file(
configuration: conf_data, configuration: conf_data,
input: 'hyprland-session.service.in', input: 'hyprland-session.service.in',
output: '@BASENAME@', output: '@BASENAME@',
install_dir: join_paths(get_option('libdir'), 'systemd/user') ) install_dir: user_unit_dir )