2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
2020-10-27 00:29:36 +00:00
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitLab
|
2020-06-18 07:06:33 +00:00
|
|
|
, fetchpatch
|
2020-10-27 00:29:36 +00:00
|
|
|
, removeReferencesTo
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-27 00:29:36 +00:00
|
|
|
, systemd
|
2020-04-24 23:36:52 +00:00
|
|
|
, pkgconfig
|
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, valgrind
|
|
|
|
, glib
|
|
|
|
, dbus
|
|
|
|
, alsaLib
|
|
|
|
, libjack2
|
|
|
|
, udev
|
|
|
|
, libva
|
|
|
|
, libsndfile
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libpulseaudio
|
|
|
|
, makeFontsConf
|
2020-10-27 00:29:36 +00:00
|
|
|
, callPackage
|
|
|
|
, nixosTests
|
|
|
|
, gstreamerSupport ? true, gst_all_1 ? null
|
|
|
|
, ffmpegSupport ? true, ffmpeg ? null
|
|
|
|
, bluezSupport ? true, bluez ? null, sbc ? null
|
|
|
|
, nativeHspSupport ? true
|
|
|
|
, ofonoSupport ? true
|
|
|
|
, hsphfpdSupport ? false
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
fontsConf = makeFontsConf {
|
|
|
|
fontDirectories = [];
|
|
|
|
};
|
2020-10-27 00:29:36 +00:00
|
|
|
|
|
|
|
mesonBool = b: if b then "true" else "false";
|
2020-04-24 23:36:52 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pipewire";
|
2020-10-27 00:29:36 +00:00
|
|
|
version = "0.3.13";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"lib"
|
|
|
|
"pulse"
|
|
|
|
"jack"
|
|
|
|
"dev"
|
|
|
|
"doc"
|
|
|
|
"installedTests"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "pipewire";
|
|
|
|
repo = "pipewire";
|
|
|
|
rev = version;
|
2020-10-27 00:29:36 +00:00
|
|
|
sha256 = "19j5kmb7iaivkq2agfzncfm2qms41ckqi0ddxvhpc91ihwprdc5w";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
patches = [
|
|
|
|
# Break up a dependency cycle between outputs.
|
|
|
|
./alsa-profiles-use-libdir.patch
|
|
|
|
# Move installed tests into their own output.
|
|
|
|
./installed-tests-path.patch
|
|
|
|
|
|
|
|
# TODO Remove this on next update
|
|
|
|
# Fixes rpath referencecs.
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://gitlab.freedesktop.org/pipewire/pipewire/commit/2e3556fa128b778be62a7ffad5fbe78393035825.diff";
|
|
|
|
sha256 = "039yysb8j1aiqml54rxnaqfmzqz1b6m8sv5w3vz52grvav3kyr1l";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkgconfig
|
2020-10-27 00:29:36 +00:00
|
|
|
removeReferencesTo
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsaLib
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
libjack2
|
|
|
|
libpulseaudio
|
|
|
|
libsndfile
|
|
|
|
udev
|
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
2020-10-27 00:29:36 +00:00
|
|
|
valgrind
|
|
|
|
systemd
|
|
|
|
] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
|
|
|
|
++ lib.optional ffmpegSupport ffmpeg
|
|
|
|
++ lib.optionals bluezSupport [ bluez sbc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=true"
|
|
|
|
"-Dman=false" # we don't have xmltoman
|
2020-10-27 00:29:36 +00:00
|
|
|
"-Dexamples=true" # only needed for `pipewire-media-session`
|
|
|
|
"-Dudevrulesdir=lib/udev/rules.d"
|
|
|
|
"-Dinstalled_tests=true"
|
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
|
|
|
"-Dlibpulse-path=${placeholder "pulse"}/lib"
|
|
|
|
"-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}"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2020-10-27 00:29:36 +00:00
|
|
|
# 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)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Server and user space API to deal with multimedia pipelines";
|
|
|
|
homepage = "https://pipewire.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
};
|
|
|
|
}
|