From c26ff1ed9badf9ec4e5c572a755985360f682010 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Fri, 2 Dec 2022 19:50:19 +0100 Subject: [PATCH] pulseaudio: reference wrapped binaries in service files Since commit 3871f8be8d6de48d5f094fbe90a09e42cc0b289c ("pulseaudioFull: fix wrapGApp wrapping"), the pulseaudio service files have been referencing *unwrapped* binaries. This mostly hurts pulseaudioFull, where using unwrapped binaries means there's no High Fidelity A2DP profile at all. Plain pulseaudio (not -full) seems able to use A2DP profile with SBC codec, but not aptX, as the latter requires gstreamer / wrapper. Since the wrapping of pulseaudio is a bit complicated (see referenced commit), let's just fix the service files manually in preFixup. Ref https://github.com/NixOS/nixpkgs/issues/203919. --- pkgs/servers/pulseaudio/default.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix index f1fc2a3573b7..056710a588f7 100644 --- a/pkgs/servers/pulseaudio/default.nix +++ b/pkgs/servers/pulseaudio/default.nix @@ -165,6 +165,11 @@ stdenv.mkDerivation rec { + lib.optionalString (!libOnly) '' mkdir -p $out/bin ln -st $out/bin $out/.bin-unwrapped/* + + # Ensure that service files use the wrapped binaries. + find "$out" -name "*.service" | while read f; do + substituteInPlace "$f" --replace "$out/.bin-unwrapped/" "$out/bin/" + done ''; meta = {