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
|
|
|
|
, makeFontsConf
|
2020-10-27 00:29:36 +00:00
|
|
|
, callPackage
|
|
|
|
, nixosTests
|
|
|
|
, gstreamerSupport ? true, gst_all_1 ? null
|
|
|
|
, ffmpegSupport ? true, ffmpeg ? null
|
2020-12-25 13:55:36 +00:00
|
|
|
, bluezSupport ? true, bluez ? null, sbc ? null, libopenaptx ? null, ldacbt ? null
|
2020-10-27 00:29:36 +00:00
|
|
|
, nativeHspSupport ? true
|
|
|
|
, ofonoSupport ? true
|
2020-12-07 07:45:13 +00:00
|
|
|
, hsphfpdSupport ? true
|
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-12-25 13:55:36 +00:00
|
|
|
version = "0.3.18";
|
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-12-25 13:55:36 +00:00
|
|
|
sha256 = "1yghhgs18yqrnd0b2r75l5n8yng962r1wszbsi01v6i9zib3jc9g";
|
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
|
2020-11-30 08:33:03 +00:00
|
|
|
# Change the path of the pipewire-pulse binary in the service definition.
|
|
|
|
./pipewire-pulse-path.patch
|
2020-12-07 07:45:13 +00:00
|
|
|
# Add flag to specify configuration directory (different from the installation directory).
|
|
|
|
./pipewire-config-dir.patch
|
2020-10-27 00:29:36 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkgconfig
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsaLib
|
|
|
|
dbus
|
|
|
|
glib
|
|
|
|
libjack2
|
|
|
|
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
|
2020-12-25 13:55:36 +00:00
|
|
|
++ lib.optionals bluezSupport [ bluez libopenaptx ldacbt 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"}"
|
2020-11-30 08:33:03 +00:00
|
|
|
"-Dpipewire_pulse_prefix=${placeholder "pulse"}"
|
2020-10-27 00:29:36 +00:00
|
|
|
"-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-12-07 07:45:13 +00:00
|
|
|
"-Dpipewire_config_dir=/etc/pipewire"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2020-11-30 08:33:03 +00:00
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse"
|
|
|
|
moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse"
|
|
|
|
moveToOutput "bin/pipewire-pulse" "$pulse"
|
2020-10-27 00:29:36 +00: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"
|
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|