mirror of
https://gitlab.freedesktop.org/pipewire/wireplumber.git
synced 2025-12-24 16:40:04 +01:00
parent
51e24c58b5
commit
56f8a82ad7
8 changed files with 103 additions and 0 deletions
|
|
@ -13,6 +13,12 @@ wireplumber_so_version = '0'
|
||||||
|
|
||||||
wireplumber_headers_dir = join_paths(get_option('includedir'), 'wireplumber-' + wireplumber_api_version, 'wp')
|
wireplumber_headers_dir = join_paths(get_option('includedir'), 'wireplumber-' + wireplumber_api_version, 'wp')
|
||||||
|
|
||||||
|
if get_option('bindir').startswith('/')
|
||||||
|
wireplumber_bin_dir = get_option('bindir')
|
||||||
|
else
|
||||||
|
wireplumber_bin_dir = join_paths(get_option('prefix'), get_option('bindir'))
|
||||||
|
endif
|
||||||
|
|
||||||
if get_option('libdir').startswith('/')
|
if get_option('libdir').startswith('/')
|
||||||
wireplumber_module_dir = join_paths(get_option('libdir'), 'wireplumber-' + wireplumber_api_version)
|
wireplumber_module_dir = join_paths(get_option('libdir'), 'wireplumber-' + wireplumber_api_version)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -4,3 +4,18 @@ option('doc', type : 'feature', value : 'auto',
|
||||||
description: 'Enable documentation.')
|
description: 'Enable documentation.')
|
||||||
option('system-lua', type : 'boolean', value : 'false',
|
option('system-lua', type : 'boolean', value : 'false',
|
||||||
description : 'Use lua from the system instead of the bundled one')
|
description : 'Use lua from the system instead of the bundled one')
|
||||||
|
option('systemd',
|
||||||
|
type: 'feature', value: 'auto',
|
||||||
|
description: 'Enable installing systemd units')
|
||||||
|
option('systemd-system-service',
|
||||||
|
type : 'boolean', value : false,
|
||||||
|
description: 'Install systemd system service file')
|
||||||
|
option('systemd-user-service',
|
||||||
|
type : 'boolean', value : true,
|
||||||
|
description: 'Install systemd user service file')
|
||||||
|
option('systemd-system-unit-dir',
|
||||||
|
type : 'string',
|
||||||
|
description : 'Directory for system systemd units')
|
||||||
|
option('systemd-user-unit-dir',
|
||||||
|
type : 'string',
|
||||||
|
description : 'Directory for user systemd units')
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,8 @@ install_subdir('scripts',
|
||||||
strip_directory : false
|
strip_directory : false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
subdir('systemd')
|
||||||
|
|
||||||
executable('wireplumber',
|
executable('wireplumber',
|
||||||
wp_sources,
|
wp_sources,
|
||||||
c_args : [
|
c_args : [
|
||||||
|
|
|
||||||
32
src/systemd/meson.build
Normal file
32
src/systemd/meson.build
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
systemd = dependency('systemd', required: get_option('systemd'))
|
||||||
|
|
||||||
|
if systemd.found()
|
||||||
|
systemd_config = configuration_data()
|
||||||
|
systemd_config.set('WP_BINARY', join_paths(wireplumber_bin_dir, 'wireplumber'))
|
||||||
|
|
||||||
|
# system service
|
||||||
|
if get_option('systemd-system-service')
|
||||||
|
systemd_system_unit_dir = systemd.get_pkgconfig_variable(
|
||||||
|
'systemd_system_unit_dir',
|
||||||
|
define_variable : ['prefix', get_option('prefix')])
|
||||||
|
|
||||||
|
if get_option('systemd-system-unit-dir') != ''
|
||||||
|
systemd_system_unit_dir = get_option('systemd-system-unit-dir')
|
||||||
|
endif
|
||||||
|
|
||||||
|
subdir('system')
|
||||||
|
endif
|
||||||
|
|
||||||
|
# user service
|
||||||
|
if get_option('systemd-user-service')
|
||||||
|
systemd_user_unit_dir = systemd.get_pkgconfig_variable(
|
||||||
|
'systemd_user_unit_dir',
|
||||||
|
define_variable : ['prefix', get_option('prefix')])
|
||||||
|
|
||||||
|
if get_option('systemd-user-unit-dir') != ''
|
||||||
|
systemd_user_unit_dir = get_option('systemd-user-unit-dir')
|
||||||
|
endif
|
||||||
|
|
||||||
|
subdir('user')
|
||||||
|
endif
|
||||||
|
endif
|
||||||
4
src/systemd/system/meson.build
Normal file
4
src/systemd/system/meson.build
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
configure_file(input : 'wireplumber.service.in',
|
||||||
|
output : 'wireplumber.service',
|
||||||
|
configuration : systemd_config,
|
||||||
|
install_dir : systemd_system_unit_dir)
|
||||||
21
src/systemd/system/wireplumber.service.in
Normal file
21
src/systemd/system/wireplumber.service.in
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Multimedia Service Session Manager
|
||||||
|
After=pipewire.service
|
||||||
|
BindsTo=pipewire.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
LockPersonality=yes
|
||||||
|
MemoryDenyWriteExecute=yes
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
RestrictNamespaces=yes
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
SystemCallFilter=@system-service
|
||||||
|
Type=simple
|
||||||
|
ExecStart=@WP_BINARY@
|
||||||
|
Restart=on-failure
|
||||||
|
RuntimeDirectory=pipewire
|
||||||
|
User=pipewire
|
||||||
|
Environment=PIPEWIRE_RUNTIME_DIR=%t/pipewire
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=pipewire.service
|
||||||
4
src/systemd/user/meson.build
Normal file
4
src/systemd/user/meson.build
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
configure_file(input : 'wireplumber.service.in',
|
||||||
|
output : 'wireplumber.service',
|
||||||
|
configuration : systemd_config,
|
||||||
|
install_dir : systemd_user_unit_dir)
|
||||||
19
src/systemd/user/wireplumber.service.in
Normal file
19
src/systemd/user/wireplumber.service.in
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Multimedia Service Session Manager
|
||||||
|
After=pipewire.service
|
||||||
|
BindsTo=pipewire.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
LockPersonality=yes
|
||||||
|
MemoryDenyWriteExecute=yes
|
||||||
|
NoNewPrivileges=yes
|
||||||
|
RestrictNamespaces=yes
|
||||||
|
SystemCallArchitectures=native
|
||||||
|
SystemCallFilter=@system-service
|
||||||
|
Type=simple
|
||||||
|
ExecStart=@WP_BINARY@
|
||||||
|
Restart=on-failure
|
||||||
|
Slice=session.slice
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=pipewire.service
|
||||||
Loading…
Add table
Reference in a new issue