summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Solanti <jhs@psonet.com>2020-11-22 04:42:02 +0200
committerJan Solanti <jhs@psonet.com>2020-11-23 10:40:35 +0200
commitaca97840da9a85ddf65ea33fa778a35d8d88bb4b (patch)
treecc09351a3060f11ac9bb83e9946400addce6a356
parent258903e725db91db53f0ed8badfad8b988ba0e05 (diff)
downloadnixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.gz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.bz2
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.lz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.xz
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.tar.zst
nixpkgs-aca97840da9a85ddf65ea33fa778a35d8d88bb4b.zip
pipewire: 0.3.15 -> 0.3.16
This release replaces the libpulseaudio shim with a pipewire module that acts as a fake pulseaudio server along with a systemd service that loads that module on demand.
-rw-r--r--nixos/modules/services/desktops/pipewire.nix19
-rw-r--r--pkgs/development/libraries/pipewire/default.nix24
-rw-r--r--pkgs/development/libraries/pipewire/pipewire-pulse-path.patch24
3 files changed, 41 insertions, 26 deletions
diff --git a/nixos/modules/services/desktops/pipewire.nix b/nixos/modules/services/desktops/pipewire.nix
index 5179cbaf6bc..c4923cfd3f0 100644
--- a/nixos/modules/services/desktops/pipewire.nix
+++ b/nixos/modules/services/desktops/pipewire.nix
@@ -17,10 +17,6 @@ let
     mkdir -p "$out/lib"
     ln -s "${pkgs.pipewire.jack}/lib" "$out/lib/pipewire"
   '';
-  pulse-libs = pkgs.runCommand "pulse-libs" {} ''
-    mkdir -p "$out/lib"
-    ln -s "${pkgs.pipewire.pulse}/lib" "$out/lib/pipewire"
-  '';
 in {
 
   meta = {
@@ -50,7 +46,7 @@ in {
       };
 
       pulse = {
-        enable = mkEnableOption "PulseAudio emulation";
+        enable = mkEnableOption "PulseAudio server emulation";
       };
     };
   };
@@ -61,23 +57,24 @@ in {
     assertions = [
       {
         assertion = cfg.pulse.enable -> !config.hardware.pulseaudio.enable;
-        message = "PipeWire based PulseAudio emulation doesn't use the PulseAudio service";
+        message = "PipeWire based PulseAudio server emulation replaces PulseAudio";
       }
       {
         assertion = cfg.jack.enable -> !config.services.jack.jackd.enable;
-        message = "PIpeWire based JACK emulation doesn't use the JACK service";
+        message = "PipeWire based JACK emulation doesn't use the JACK service";
       }
     ];
 
     environment.systemPackages = [ pkgs.pipewire ]
-                                 ++ lib.optional cfg.jack.enable jack-libs
-                                 ++ lib.optional cfg.pulse.enable pulse-libs;
+                                 ++ lib.optional cfg.jack.enable jack-libs;
 
-    systemd.packages = [ pkgs.pipewire ];
+    systemd.packages = [ pkgs.pipewire ]
+                       ++ lib.optional cfg.pulse.enable pkgs.pipewire.pulse;
 
     # PipeWire depends on DBUS but doesn't list it. Without this booting
     # into a terminal results in the service crashing with an error.
     systemd.user.sockets.pipewire.wantedBy = lib.mkIf cfg.socketActivation [ "sockets.target" ];
+    systemd.user.sockets.pipewire-pulse.wantedBy = lib.mkIf (cfg.socketActivation && cfg.pulse.enable) ["sockets.target"];
     systemd.user.services.pipewire.bindsTo = [ "dbus.service" ];
     services.udev.packages = [ pkgs.pipewire ];
 
@@ -100,6 +97,6 @@ in {
       source = "${pkgs.pipewire}/share/alsa/alsa.conf.d/50-pipewire.conf";
     };
     environment.sessionVariables.LD_LIBRARY_PATH =
-      lib.optional (cfg.jack.enable || cfg.pulse.enable) "/run/current-system/sw/lib/pipewire";
+      lib.optional cfg.jack.enable "/run/current-system/sw/lib/pipewire";
   };
 }
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index c4b766b7093..f03f9ea88f4 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -19,7 +19,6 @@
 , libsndfile
 , vulkan-headers
 , vulkan-loader
-, libpulseaudio
 , makeFontsConf
 , callPackage
 , nixosTests
@@ -40,7 +39,7 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "pipewire";
-  version = "0.3.15";
+  version = "0.3.16";
 
   outputs = [
     "out"
@@ -57,7 +56,7 @@ stdenv.mkDerivation rec {
     owner = "pipewire";
     repo = "pipewire";
     rev = version;
-    sha256 = "1lmsn13pbr0cigb5ri9nd3102ffbaf8nsz5c8aawf6lsz7mhkx9x";
+    sha256 = "0ivfx3rbg2iwjdh412zjpk9y5mzw7zh6asv4sji8lq0dzhwbz1qc";
   };
 
   patches = [
@@ -65,11 +64,8 @@ stdenv.mkDerivation rec {
     ./alsa-profiles-use-libdir.patch
     # Move installed tests into their own output.
     ./installed-tests-path.patch
-    # Fix older clients (e.g. Chrome/Chromium):
-    (fetchpatch { # protocol-native: do version check on HELLO
-      url = "https://gitlab.freedesktop.org/pipewire/pipewire/-/commit/b8c7b36d3b8be16593f554964cf2f852c21b5c2c.patch";
-      sha256 = "18461grisrgqbad6bfa1bm17mslddgfmjfprc9vjvab2mmpsjss9";
-    })
+    # Change the path of the pipewire-pulse binary in the service definition.
+    ./pipewire-pulse-path.patch
   ];
 
   nativeBuildInputs = [
@@ -78,7 +74,6 @@ stdenv.mkDerivation rec {
     meson
     ninja
     pkgconfig
-    removeReferencesTo
   ];
 
   buildInputs = [
@@ -86,7 +81,6 @@ stdenv.mkDerivation rec {
     dbus
     glib
     libjack2
-    libpulseaudio
     libsndfile
     udev
     vulkan-headers
@@ -104,7 +98,7 @@ stdenv.mkDerivation rec {
     "-Dudevrulesdir=lib/udev/rules.d"
     "-Dinstalled_tests=true"
     "-Dinstalled_test_prefix=${placeholder "installedTests"}"
-    "-Dlibpulse-path=${placeholder "pulse"}/lib"
+    "-Dpipewire_pulse_prefix=${placeholder "pulse"}"
     "-Dlibjack-path=${placeholder "jack"}/lib"
     "-Dgstreamer=${mesonBool gstreamerSupport}"
     "-Dffmpeg=${mesonBool ffmpegSupport}"
@@ -118,10 +112,10 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  # Pulseaudio asserts lead to dev references.
-  # TODO This should be fixed in the pulseaudio sources instead.
-  preFixup = ''
-    remove-references-to -t ${libpulseaudio.dev} "$(readlink -f $pulse/lib/libpulse.so)"
+  postInstall = ''
+    moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse"
+    moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse"
+    moveToOutput "bin/pipewire-pulse" "$pulse"
   '';
 
   passthru.tests = {
diff --git a/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch b/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch
new file mode 100644
index 00000000000..6ac86b111ee
--- /dev/null
+++ b/pkgs/development/libraries/pipewire/pipewire-pulse-path.patch
@@ -0,0 +1,24 @@
+diff --git a/meson_options.txt b/meson_options.txt
+index 4b9e46b8..9d73ed06 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -147,3 +147,6 @@ option('pw-cat',
+ option('udevrulesdir',
+        type : 'string',
+        description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')
++option('pipewire_pulse_prefix',
++       type : 'string',
++       description : 'Install directory for the pipewire-pulse daemon')
+diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
+index 29fc93d4..f78946f2 100644
+--- a/src/daemon/systemd/user/meson.build
++++ b/src/daemon/systemd/user/meson.build
+@@ -6,7 +6,7 @@ install_data(
+ 
+ systemd_config = configuration_data()
+ systemd_config.set('PW_BINARY', join_paths(pipewire_bindir, 'pipewire'))
+-systemd_config.set('PW_PULSE_BINARY', join_paths(pipewire_bindir, 'pipewire-pulse'))
++systemd_config.set('PW_PULSE_BINARY', join_paths(get_option('pipewire_pulse_prefix'), 'bin/pipewire-pulse'))
+ 
+ configure_file(input : 'pipewire.service.in',
+                output : 'pipewire.service',