mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-05 08:15:58 +01:00
Add D-Bus and systemd service files
This commit is contained in:
parent
ccc8a31568
commit
ea98281d0a
4 changed files with 43 additions and 1 deletions
8
contrib/systemd/xdg-desktop-portal-wlr.service.in
Normal file
8
contrib/systemd/xdg-desktop-portal-wlr.service.in
Normal file
|
@ -0,0 +1,8 @@
|
|||
[Unit]
|
||||
Description=Portal service (wlroots implementation)
|
||||
|
||||
[Service]
|
||||
Type=dbus
|
||||
BusName=org.freedesktop.impl.portal.desktop.wlr
|
||||
ExecStart=@libexecdir@/xdg-desktop-portal-wlr
|
||||
Restart=on-failure
|
31
meson.build
31
meson.build
|
@ -3,7 +3,7 @@ project(
|
|||
'c',
|
||||
version: '0.0.0',
|
||||
license: 'MIT',
|
||||
meson_version: '>=0.46.0',
|
||||
meson_version: '>=0.47.0',
|
||||
default_options: [
|
||||
'c_std=c11',
|
||||
'warning_level=2',
|
||||
|
@ -60,6 +60,35 @@ executable(
|
|||
],
|
||||
include_directories: [inc],
|
||||
install: true,
|
||||
install_dir: get_option('libexecdir'),
|
||||
)
|
||||
|
||||
conf_data = configuration_data()
|
||||
conf_data.set('libexecdir',
|
||||
join_paths(get_option('prefix'), get_option('libexecdir')))
|
||||
conf_data.set('systemd_service', '')
|
||||
|
||||
systemd = dependency('systemd', required: get_option('systemd'))
|
||||
|
||||
if systemd.found()
|
||||
systemd_service_file = 'xdg-desktop-portal-wlr.service'
|
||||
user_unit_dir = systemd.get_pkgconfig_variable('systemduserunitdir',
|
||||
define_variable: ['prefix', get_option('prefix')])
|
||||
conf_data.set('systemd_service', 'SystemdService=' + systemd_service_file)
|
||||
|
||||
configure_file(
|
||||
configuration: conf_data,
|
||||
input: 'contrib/systemd/' + systemd_service_file + '.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: user_unit_dir,
|
||||
)
|
||||
endif
|
||||
|
||||
configure_file(
|
||||
configuration: conf_data,
|
||||
input: 'org.freedesktop.impl.portal.desktop.wlr.service.in',
|
||||
output: '@BASENAME@',
|
||||
install_dir: join_paths(get_option('datadir'), 'dbus-1', 'services'),
|
||||
)
|
||||
|
||||
install_data(
|
||||
|
|
1
meson_options.txt
Normal file
1
meson_options.txt
Normal file
|
@ -0,0 +1 @@
|
|||
option('systemd', type: 'feature', value: 'auto', description: 'Install systemd user service unit')
|
4
org.freedesktop.impl.portal.desktop.wlr.service.in
Normal file
4
org.freedesktop.impl.portal.desktop.wlr.service.in
Normal file
|
@ -0,0 +1,4 @@
|
|||
[D-BUS Service]
|
||||
Name=org.freedesktop.impl.portal.desktop.wlr
|
||||
Exec=@libexecdir@/xdg-desktop-portal-wlr
|
||||
@systemd_service@
|
Loading…
Reference in a new issue