From ec9dfe72ff94333d7480cb95faee7c1c197ae2f4 Mon Sep 17 00:00:00 2001 From: Jarkko Sakkinen Date: Sat, 9 Jan 2021 11:38:45 +0200 Subject: [PATCH] systemd: Add systemd-user-unit-dir override Add a new build option 'system-user-unit=dir', which can be used to override the pkg-config default value. By doing this, it becomes more practical to make a local unprivileged build of the latest PipeWire: $ meson --prefix=~/.local build $ meson configure build -Dpipewire-alsa=false $ meson configure build -Dsystemd-user-unit-dir=~/.config/systemd/user $ meson configure build -Dudevrulesdir="`mktemp -d`" $ ninja -C build install For a local build enabling ALSA plugins is not plausible. JACK needs a simple addition to the ~/.profile: export LD_LIBRARY_PATH=$HOME/.local/lib/x86_64-linux-gnu/pipewire-0.3/jack Finally, the genuine PulseAudio must be masked and local services enabled: systemctl --user enable pipewire.socket systemctl --user enable pipewire-pulse.socket systemctl --user mask pulseaudio.service A sanity check [*] shows that nothing has leaked out of the home directory (even though at least on my Debian 10 system PolKit still asks for authorization during the meson build). Not perfect, but lowers a barrier to run the development version a lot, as that does not anymore to trash your system. [*] find / -name "*pipewire*" \! -path "/home/*" \! -path "/var/lib/flatpak/*" 2> /dev/null Signed-off-by: Jarkko Sakkinen --- meson_options.txt | 3 +++ src/daemon/systemd/user/meson.build | 3 +++ 2 files changed, 6 insertions(+) diff --git a/meson_options.txt b/meson_options.txt index 122820ae1..efb320857 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -140,3 +140,6 @@ option('pw-cat', option('udevrulesdir', type : 'string', description : 'Directory for udev rules (defaults to /lib/udev/rules.d)') +option('systemd-user-unit-dir', + type : 'string', + description : 'Directory for user systemd units (defaults to /usr/lib/systemd/user)') diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build index 29fc93d4a..46dfbbc88 100644 --- a/src/daemon/systemd/user/meson.build +++ b/src/daemon/systemd/user/meson.build @@ -1,4 +1,7 @@ systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir', define_variable : [ 'prefix', prefix]) +if get_option('systemd-user-unit-dir') != '' + systemd_user_services_dir = get_option('systemd-user-unit-dir') +endif install_data( sources : ['pipewire.socket', 'pipewire-pulse.socket'],