aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix96
1 files changed, 74 insertions, 22 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix b/infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix
index cb5073f50c15..d07c77f4e2eb 100644
--- a/infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix
+++ b/infra/libkookie/nixpkgs/pkgs/development/libraries/pipewire/default.nix
@@ -1,89 +1,141 @@
{ stdenv
+, lib
, fetchFromGitLab
, fetchpatch
+, removeReferencesTo
, meson
, ninja
+, systemd
, pkgconfig
, doxygen
, graphviz
, valgrind
, glib
, dbus
-, gst_all_1
, alsaLib
-, ffmpeg_3
, libjack2
, udev
, libva
-, xorg
-, sbc
-, SDL2
, libsndfile
-, bluez
, vulkan-headers
, vulkan-loader
-, libpulseaudio
, makeFontsConf
+, callPackage
+, nixosTests
+, gstreamerSupport ? true, gst_all_1 ? null
+, ffmpegSupport ? true, ffmpeg ? null
+, bluezSupport ? true, bluez ? null, sbc ? null
+, nativeHspSupport ? true
+, ofonoSupport ? true
+, hsphfpdSupport ? true
}:
let
fontsConf = makeFontsConf {
fontDirectories = [];
};
+
+ mesonBool = b: if b then "true" else "false";
in
stdenv.mkDerivation rec {
pname = "pipewire";
- version = "0.3.7";
+ version = "0.3.17";
- outputs = [ "out" "lib" "dev" "doc" ];
+ outputs = [
+ "out"
+ "lib"
+ "pulse"
+ "jack"
+ "dev"
+ "doc"
+ "installedTests"
+ ];
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "pipewire";
repo = "pipewire";
rev = version;
- sha256 = "04l66p0wj553gp2zf3vwwh6jbr1vkf6wrq4za9zlm9dn144am4j2";
+ sha256 = "1gzdahji23fsgjycc08h7zzv8filmzdrkyvpkljc881l4cb5l58n";
};
+ patches = [
+ # Break up a dependency cycle between outputs.
+ ./alsa-profiles-use-libdir.patch
+ # Move installed tests into their own output.
+ ./installed-tests-path.patch
+ # Change the path of the pipewire-pulse binary in the service definition.
+ ./pipewire-pulse-path.patch
+ # Add flag to specify configuration directory (different from the installation directory).
+ ./pipewire-config-dir.patch
+ ];
+
nativeBuildInputs = [
doxygen
graphviz
meson
ninja
pkgconfig
- valgrind
];
buildInputs = [
- SDL2
alsaLib
- bluez
dbus
- ffmpeg_3
glib
- gst_all_1.gst-plugins-base
- gst_all_1.gstreamer
libjack2
- libpulseaudio
libsndfile
- libva
- sbc
udev
vulkan-headers
vulkan-loader
- xorg.libX11
- ];
+ valgrind
+ systemd
+ ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
+ ++ lib.optional ffmpegSupport ffmpeg
+ ++ lib.optionals bluezSupport [ bluez sbc ];
mesonFlags = [
"-Ddocs=true"
"-Dman=false" # we don't have xmltoman
- "-Dgstreamer=true"
+ "-Dexamples=true" # only needed for `pipewire-media-session`
+ "-Dudevrulesdir=lib/udev/rules.d"
+ "-Dinstalled_tests=true"
+ "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+ "-Dpipewire_pulse_prefix=${placeholder "pulse"}"
+ "-Dlibjack-path=${placeholder "jack"}/lib"
+ "-Dgstreamer=${mesonBool gstreamerSupport}"
+ "-Dffmpeg=${mesonBool ffmpegSupport}"
+ "-Dbluez5=${mesonBool bluezSupport}"
+ "-Dbluez5-backend-native=${mesonBool nativeHspSupport}"
+ "-Dbluez5-backend-ofono=${mesonBool ofonoSupport}"
+ "-Dbluez5-backend-hsphfpd=${mesonBool hsphfpdSupport}"
+ "-Dpipewire_config_dir=/etc/pipewire"
];
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
doCheck = true;
+ postInstall = ''
+ moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse"
+ moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse"
+ moveToOutput "bin/pipewire-pulse" "$pulse"
+ '';
+
+ passthru.tests = {
+ installedTests = nixosTests.installed-tests.pipewire;
+
+ # This ensures that all the paths used by the NixOS module are found.
+ test-paths = callPackage ./test-paths.nix {
+ paths-out = [
+ "share/alsa/alsa.conf.d/50-pipewire.conf"
+ ];
+ paths-lib = [
+ "lib/alsa-lib/libasound_module_pcm_pipewire.so"
+ "share/alsa-card-profile/mixer"
+ ];
+ };
+ };
+
meta = with stdenv.lib; {
description = "Server and user space API to deal with multimedia pipelines";
homepage = "https://pipewire.org/";