Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 603c0d4e742f
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: e95cc8519b0c
Choose a head ref
  • 2 commits
  • 3 files changed
  • 2 contributors

Commits on Nov 23, 2020

  1. 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.
    jansol committed Nov 23, 2020
    Copy the full SHA
    aca9784 View commit details

Commits on Nov 26, 2020

  1. Merge pull request #104553 from jansol/pipewire

    pipewire: 0.3.15 -> 0.3.16
    jtojnar authored Nov 26, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e95cc85 View commit details
19 changes: 8 additions & 11 deletions nixos/modules/services/desktops/pipewire.nix
Original file line number Diff line number Diff line change
@@ -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";
};
}
24 changes: 9 additions & 15 deletions pkgs/development/libraries/pipewire/default.nix
Original file line number Diff line number Diff line change
@@ -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,19 +56,16 @@ stdenv.mkDerivation rec {
owner = "pipewire";
repo = "pipewire";
rev = version;
sha256 = "1lmsn13pbr0cigb5ri9nd3102ffbaf8nsz5c8aawf6lsz7mhkx9x";
sha256 = "0ivfx3rbg2iwjdh412zjpk9y5mzw7zh6asv4sji8lq0dzhwbz1qc";
};

patches = [
# Break up a dependency cycle between outputs.
./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,15 +74,13 @@ stdenv.mkDerivation rec {
meson
ninja
pkgconfig
removeReferencesTo
];

buildInputs = [
alsaLib
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 = {
24 changes: 24 additions & 0 deletions pkgs/development/libraries/pipewire/pipewire-pulse-path.patch
Original file line number Diff line number Diff line change
@@ -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',