Browse Source

meson: integrate wireplumber as a subproject

This allows building wireplumber as part of the pipewire build
and running it in the uninstalled environment instead of media-session.

Building each session manager is individually contolled by the options:
 -Dmedia-session=auto/enabled/disabled
 -Dwireplumber=auto/enabled/disabled

And controlling which one is used in pipewire.conf is done with:
 -Dsession-manager=media-session/wireplumber

Wireplumber's source tree must be in subprojects/wireplumber/
If this is missing, the .wrap file ensures that the latest git
master is downloaded while meson configures the build.
This git tree will not be automatically updated later, you need
to ensure that it is up-to-date on your own.
lines
George Kiagiadakis 1 year ago
parent
commit
7ee5172ce8
5 changed files with 43 additions and 8 deletions
  1. +3
    -0
      .gitignore
  2. +13
    -4
      meson_options.txt
  3. +22
    -2
      src/daemon/meson.build
  4. +2
    -2
      src/daemon/pipewire.conf.in
  5. +3
    -0
      subprojects/wireplumber.wrap

+ 3
- 0
.gitignore View File

@ -12,6 +12,9 @@ cscope.out
cscope.in.out
cscope.po.out
Makefile
subprojects/lua*
subprojects/wireplumber
subprojects/packagecache
# Created by https://www.gitignore.io/api/vim


+ 13
- 4
meson_options.txt View File

@ -9,10 +9,6 @@ option('examples',
description: 'Build examples',
type: 'feature',
value: 'enabled')
option('media-session',
description: 'Build and install pipewire-media-session',
type: 'feature',
value: 'auto')
option('man',
description: 'Build manpages',
type: 'feature',
@ -195,3 +191,16 @@ option('echo-cancel-webrtc',
description : 'Enable WebRTC-based echo canceller',
type : 'feature',
value : 'auto')
option('media-session',
description: 'Build and install pipewire-media-session',
type: 'feature',
value: 'auto')
option('wireplumber',
description: 'Build and install wireplumber (subproject)',
type: 'feature',
value: 'auto')
option('session-manager',
description : 'Session manager to build and use in the uninstalled environment',
type : 'combo',
choices : ['media-session', 'wireplumber'],
value : 'media-session')

+ 22
- 2
src/daemon/meson.build View File

@ -9,13 +9,14 @@ pipewire_c_args = [
conf_config = configuration_data()
conf_config.set('VERSION', '"@0@"'.format(pipewire_version))
conf_config.set('PIPEWIRE_CONFIG_DIR', pipewire_configdir)
conf_config.set('media_session_path', pipewire_bindir / 'pipewire-media-session')
conf_config.set('session_manager_path', pipewire_bindir / 'pipewire-media-session')
conf_config.set('session_manager_args', '')
conf_config.set('pipewire_path', pipewire_bindir / 'pipewire')
conf_config.set('pipewire_pulse_path', pipewire_bindir / 'pipewire-pulse')
conf_config.set('comment', '#')
conf_config_uninstalled = conf_config
conf_config_uninstalled.set('media_session_path',
conf_config_uninstalled.set('session_manager_path',
meson.build_root() / 'src' / 'examples' / 'pipewire-media-session')
conf_config_uninstalled.set('pipewire_path',
meson.build_root() / 'src' / 'daemon' / 'pipewire')
@ -23,6 +24,25 @@ conf_config_uninstalled.set('pipewire_pulse_path',
meson.build_root() / 'src' / 'daemon' / 'pipewire-pulse')
conf_config_uninstalled.set('comment', '')
# Build WirePlumber if requested, and set it up in the config files
build_wp = get_option('wireplumber')
sm_choice = get_option('session-manager')
if build_wp.disabled() and (sm_choice == 'wireplumber')
error('option to build wireplumber is disabled, ' +
'but the requested session-manager is wireplumber')
elif build_wp.enabled() or (build_wp.auto() and (sm_choice == 'wireplumber'))
wp_proj = subproject('wireplumber', required : true)
wp_bindir = wp_proj.get_variable('wireplumber_bin_dir', pipewire_bindir)
conf_config.set('session_manager_path', wp_bindir / 'wireplumber')
# wp-uninstalled.sh -b path/to/wp/build/root wireplumber
conf_config_uninstalled.set('session_manager_path',
meson.source_root() / 'subprojects' / 'wireplumber' / 'wp-uninstalled.sh')
conf_config_uninstalled.set('session_manager_args',
'-b ' + meson.build_root() / 'subprojects' / 'wireplumber' + ' wireplumber')
endif
conf_files = [
'pipewire.conf',


+ 2
- 2
src/daemon/pipewire.conf.in View File

@ -130,7 +130,7 @@ context.modules = [
# access.allowed to list an array of paths of allowed
# apps.
#access.allowed = [
# @media_session_path@
# @session_manager_path@
#]
# An array of rejected paths.
@ -234,7 +234,7 @@ context.exec = [
# but it is better to start it as a systemd service.
# Run the session manager with -h for options.
#
@comment@{ path = "@media_session_path@" args = "" }
@comment@{ path = "@session_manager_path@" args = "@session_manager_args@" }
#
# You can optionally start the pulseaudio-server here as well
# but it is better to start it as a systemd service.


+ 3
- 0
subprojects/wireplumber.wrap View File

@ -0,0 +1,3 @@
[wrap-git]
url = https://gitlab.freedesktop.org/pipewire/wireplumber.git
revision = head

Loading…
Cancel
Save