2020-02-29 15:59:51 +00:00
|
|
|
{ stdenv
|
2020-10-23 18:34:45 +01:00
|
|
|
, lib
|
2020-02-29 16:14:42 +00:00
|
|
|
, fetchFromGitLab
|
2020-10-23 18:42:50 +01:00
|
|
|
, fetchpatch
|
|
|
|
, removeReferencesTo
|
2020-02-29 15:59:51 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-23 18:34:45 +01:00
|
|
|
, systemd
|
2020-02-29 15:59:51 +00:00
|
|
|
, pkgconfig
|
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, valgrind
|
|
|
|
, glib
|
|
|
|
, dbus
|
|
|
|
, alsaLib
|
|
|
|
, libjack2
|
|
|
|
, udev
|
|
|
|
, libva
|
2020-02-29 16:14:42 +00:00
|
|
|
, libsndfile
|
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
|
|
|
, libpulseaudio
|
2020-02-29 15:59:51 +00:00
|
|
|
, makeFontsConf
|
2020-08-05 19:48:37 +01:00
|
|
|
, callPackage
|
|
|
|
, nixosTests
|
2020-10-23 18:34:45 +01:00
|
|
|
, gstreamerSupport ? true, gst_all_1 ? null
|
|
|
|
, ffmpegSupport ? true, ffmpeg ? null
|
|
|
|
, bluezSupport ? true, bluez ? null, sbc ? null
|
2020-08-05 05:13:04 +01:00
|
|
|
, nativeHspSupport ? true
|
2020-10-23 18:34:45 +01:00
|
|
|
, ofonoSupport ? true
|
|
|
|
, hsphfpdSupport ? false
|
2017-11-14 03:41:25 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2018-02-27 16:15:13 +00:00
|
|
|
fontsConf = makeFontsConf {
|
2020-02-29 15:59:51 +00:00
|
|
|
fontDirectories = [];
|
2018-02-27 16:15:13 +00:00
|
|
|
};
|
2020-10-23 18:34:45 +01:00
|
|
|
|
|
|
|
mesonBool = b: if b then "true" else "false";
|
2020-02-29 15:59:51 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-06-02 13:48:09 +01:00
|
|
|
pname = "pipewire";
|
2020-11-02 18:42:16 +00:00
|
|
|
version = "0.3.15";
|
2017-11-14 03:41:25 +00:00
|
|
|
|
2020-08-31 19:28:01 +01:00
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"lib"
|
|
|
|
"pulse"
|
|
|
|
"jack"
|
|
|
|
"dev"
|
|
|
|
"doc"
|
|
|
|
"installedTests"
|
|
|
|
];
|
2020-02-29 15:59:51 +00:00
|
|
|
|
2020-02-29 16:14:42 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "pipewire";
|
2017-11-14 03:41:25 +00:00
|
|
|
repo = "pipewire";
|
|
|
|
rev = version;
|
2020-11-02 18:42:16 +00:00
|
|
|
sha256 = "1lmsn13pbr0cigb5ri9nd3102ffbaf8nsz5c8aawf6lsz7mhkx9x";
|
2017-11-14 03:41:25 +00:00
|
|
|
};
|
|
|
|
|
2020-08-05 05:13:04 +01:00
|
|
|
patches = [
|
|
|
|
# Break up a dependency cycle between outputs.
|
|
|
|
./alsa-profiles-use-libdir.patch
|
2020-08-05 19:48:37 +01:00
|
|
|
# Move installed tests into their own output.
|
|
|
|
./installed-tests-path.patch
|
2020-10-23 18:42:50 +01:00
|
|
|
];
|
2020-08-05 19:48:37 +01:00
|
|
|
|
2017-11-14 03:41:25 +00:00
|
|
|
nativeBuildInputs = [
|
2020-02-29 15:59:51 +00:00
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkgconfig
|
2020-10-23 18:42:50 +01:00
|
|
|
removeReferencesTo
|
2017-11-14 03:41:25 +00:00
|
|
|
];
|
2020-02-29 15:59:51 +00:00
|
|
|
|
2017-11-14 03:41:25 +00:00
|
|
|
buildInputs = [
|
2020-02-29 15:59:51 +00:00
|
|
|
alsaLib
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
libjack2
|
2020-02-29 16:14:42 +00:00
|
|
|
libpulseaudio
|
|
|
|
libsndfile
|
2020-02-29 15:59:51 +00:00
|
|
|
udev
|
2020-02-29 16:14:42 +00:00
|
|
|
vulkan-headers
|
|
|
|
vulkan-loader
|
2020-10-23 18:34:45 +01: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 ];
|
2017-11-14 03:41:25 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
2018-08-20 16:03:55 +01:00
|
|
|
"-Ddocs=true"
|
2020-02-29 16:14:42 +00:00
|
|
|
"-Dman=false" # we don't have xmltoman
|
2020-10-23 18:34:45 +01:00
|
|
|
"-Dexamples=true" # only needed for `pipewire-media-session`
|
2020-08-05 05:13:04 +01:00
|
|
|
"-Dudevrulesdir=lib/udev/rules.d"
|
2020-08-05 19:48:37 +01:00
|
|
|
"-Dinstalled_tests=true"
|
2020-10-23 18:40:59 +01:00
|
|
|
"-Dinstalled_test_prefix=${placeholder "installedTests"}"
|
2020-08-31 19:28:01 +01:00
|
|
|
"-Dlibpulse-path=${placeholder "pulse"}/lib"
|
|
|
|
"-Dlibjack-path=${placeholder "jack"}/lib"
|
2020-10-23 18:34:45 +01:00
|
|
|
"-Dgstreamer=${mesonBool gstreamerSupport}"
|
|
|
|
"-Dffmpeg=${mesonBool ffmpegSupport}"
|
|
|
|
"-Dbluez5=${mesonBool bluezSupport}"
|
|
|
|
"-Dbluez5-backend-native=${mesonBool nativeHspSupport}"
|
|
|
|
"-Dbluez5-backend-ofono=${mesonBool ofonoSupport}"
|
|
|
|
"-Dbluez5-backend-hsphfpd=${mesonBool hsphfpdSupport}"
|
|
|
|
];
|
2017-11-14 03:41:25 +00:00
|
|
|
|
2018-02-27 16:15:13 +00:00
|
|
|
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
|
|
|
|
|
2017-11-14 03:41:25 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2020-10-23 18:42:50 +01:00
|
|
|
# Pulseaudio asserts lead to dev references.
|
|
|
|
# TODO This should be fixed in the pulseaudio sources instead.
|
2020-08-31 19:37:36 +01:00
|
|
|
preFixup = ''
|
2020-10-23 18:42:50 +01:00
|
|
|
remove-references-to -t ${libpulseaudio.dev} "$(readlink -f $pulse/lib/libpulse.so)"
|
2020-08-31 19:37:36 +01:00
|
|
|
'';
|
|
|
|
|
2020-08-05 19:48:37 +01:00
|
|
|
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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2017-11-14 03:41:25 +00:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Server and user space API to deal with multimedia pipelines";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://pipewire.org/";
|
2020-02-29 16:14:42 +00:00
|
|
|
license = licenses.mit;
|
2017-11-14 03:41:25 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ jtojnar ];
|
|
|
|
};
|
|
|
|
}
|