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
|
2021-06-28 23:13:55 +00:00
|
|
|
, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2020-10-27 00:29:36 +00:00
|
|
|
, systemd
|
2024-09-19 14:19:46 +00:00
|
|
|
, enableSystemd ? true # enableSystemd=false maintained by maintainers.qyliss.
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2021-09-18 10:52:07 +00:00
|
|
|
, docutils
|
2020-04-24 23:36:52 +00:00
|
|
|
, doxygen
|
|
|
|
, graphviz
|
|
|
|
, glib
|
|
|
|
, dbus
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, libjack2
|
2021-07-14 22:03:04 +00:00
|
|
|
, libusb1
|
2020-04-24 23:36:52 +00:00
|
|
|
, udev
|
|
|
|
, libsndfile
|
2024-02-29 20:09:43 +00:00
|
|
|
, vulkanSupport ? true
|
2020-04-24 23:36:52 +00:00
|
|
|
, vulkan-headers
|
|
|
|
, vulkan-loader
|
2021-06-28 23:13:55 +00:00
|
|
|
, webrtc-audio-processing
|
2023-10-09 19:29:22 +00:00
|
|
|
, webrtc-audio-processing_1
|
2021-02-17 17:02:09 +00:00
|
|
|
, ncurses
|
2022-12-17 10:02:37 +00:00
|
|
|
, readline # meson can't find <7 as those versions don't have a .pc file
|
2022-01-03 16:56:52 +00:00
|
|
|
, lilv
|
2020-04-24 23:36:52 +00:00
|
|
|
, makeFontsConf
|
2020-10-27 00:29:36 +00:00
|
|
|
, nixosTests
|
2021-12-19 01:06:50 +00:00
|
|
|
, valgrind
|
2021-10-04 12:37:57 +00:00
|
|
|
, libcamera
|
|
|
|
, libdrm
|
2021-12-19 01:06:50 +00:00
|
|
|
, gst_all_1
|
|
|
|
, ffmpeg
|
|
|
|
, bluez
|
|
|
|
, sbc
|
|
|
|
, libfreeaptx
|
2022-10-30 15:09:59 +00:00
|
|
|
, liblc3
|
2021-12-19 01:06:50 +00:00
|
|
|
, fdk_aac
|
2022-09-30 11:47:45 +00:00
|
|
|
, libopus
|
2023-10-09 19:29:22 +00:00
|
|
|
, ldacbt
|
2023-04-12 12:48:02 +00:00
|
|
|
, modemmanager
|
2021-12-19 01:06:50 +00:00
|
|
|
, libpulseaudio
|
2021-09-18 10:52:07 +00:00
|
|
|
, zeroconfSupport ? true
|
2021-12-19 01:06:50 +00:00
|
|
|
, avahi
|
2022-02-10 20:34:41 +00:00
|
|
|
, raopSupport ? true
|
|
|
|
, openssl
|
2022-01-07 04:07:37 +00:00
|
|
|
, rocSupport ? true
|
|
|
|
, roc-toolkit
|
2022-02-10 20:34:41 +00:00
|
|
|
, x11Support ? true
|
|
|
|
, libcanberra
|
|
|
|
, xorg
|
2023-03-04 12:14:45 +00:00
|
|
|
, libmysofa
|
2024-06-05 15:53:02 +00:00
|
|
|
, ffadoSupport ? x11Support && lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform
|
2023-07-15 17:15:38 +00:00
|
|
|
, ffado
|
2023-11-16 04:20:00 +00:00
|
|
|
, libselinux
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation(finalAttrs: {
|
|
|
|
pname = "pipewire";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "1.2.3";
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
outputs = [
|
|
|
|
"out"
|
|
|
|
"jack"
|
|
|
|
"dev"
|
|
|
|
"doc"
|
|
|
|
"man"
|
|
|
|
"installedTests"
|
|
|
|
];
|
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.freedesktop.org";
|
|
|
|
owner = "pipewire";
|
|
|
|
repo = "pipewire";
|
|
|
|
rev = finalAttrs.version;
|
2024-09-19 14:19:46 +00:00
|
|
|
sha256 = "sha256-sdbv1PqLMGlRXe42pgNW5tNtQ3tEYWCwndZQQQEM6ig=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2021-02-17 17:02:09 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
patches = [
|
|
|
|
# Load libjack from a known location
|
|
|
|
./0060-libjack-path.patch
|
|
|
|
# Move installed tests into their own output.
|
|
|
|
./0070-installed-tests-path.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
nativeBuildInputs = [
|
|
|
|
docutils
|
|
|
|
doxygen
|
|
|
|
graphviz
|
|
|
|
meson
|
|
|
|
ninja
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
alsa-lib
|
2024-09-19 14:19:46 +00:00
|
|
|
bluez
|
2024-02-29 20:09:43 +00:00
|
|
|
dbus
|
2024-09-19 14:19:46 +00:00
|
|
|
fdk_aac
|
|
|
|
ffmpeg
|
2024-02-29 20:09:43 +00:00
|
|
|
glib
|
2024-09-19 14:19:46 +00:00
|
|
|
gst_all_1.gst-plugins-base
|
|
|
|
gst_all_1.gstreamer
|
|
|
|
libcamera
|
2024-02-29 20:09:43 +00:00
|
|
|
libjack2
|
2024-09-19 14:19:46 +00:00
|
|
|
libfreeaptx
|
|
|
|
liblc3
|
|
|
|
libmysofa
|
|
|
|
libopus
|
|
|
|
libpulseaudio
|
2024-02-29 20:09:43 +00:00
|
|
|
libusb1
|
|
|
|
libselinux
|
|
|
|
libsndfile
|
|
|
|
lilv
|
2024-09-19 14:19:46 +00:00
|
|
|
modemmanager
|
2024-02-29 20:09:43 +00:00
|
|
|
ncurses
|
|
|
|
readline
|
2024-09-19 14:19:46 +00:00
|
|
|
sbc
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ (if enableSystemd then [ systemd ] else [ udev ])
|
2024-02-29 20:09:43 +00:00
|
|
|
++ (if lib.meta.availableOn stdenv.hostPlatform webrtc-audio-processing_1 then [ webrtc-audio-processing_1 ] else [ webrtc-audio-processing ])
|
2024-09-19 14:19:46 +00:00
|
|
|
++ lib.optional (lib.meta.availableOn stdenv.hostPlatform ldacbt) ldacbt
|
2024-02-29 20:09:43 +00:00
|
|
|
++ lib.optional zeroconfSupport avahi
|
|
|
|
++ lib.optional raopSupport openssl
|
|
|
|
++ lib.optional rocSupport roc-toolkit
|
2024-04-21 15:54:59 +00:00
|
|
|
++ lib.optionals vulkanSupport [ libdrm vulkan-headers vulkan-loader ]
|
2024-02-29 20:09:43 +00:00
|
|
|
++ lib.optionals x11Support [ libcanberra xorg.libX11 xorg.libXfixes ]
|
|
|
|
++ lib.optional ffadoSupport ffado;
|
|
|
|
|
|
|
|
# Valgrind binary is required for running one optional test.
|
2024-09-19 14:19:46 +00:00
|
|
|
nativeCheckInputs = lib.optional (lib.meta.availableOn stdenv.hostPlatform valgrind) valgrind;
|
2024-02-29 20:09:43 +00:00
|
|
|
|
|
|
|
mesonFlags = [
|
|
|
|
(lib.mesonEnable "docs" true)
|
|
|
|
(lib.mesonOption "udevrulesdir" "lib/udev/rules.d")
|
|
|
|
(lib.mesonEnable "installed_tests" true)
|
|
|
|
(lib.mesonOption "installed_test_prefix" (placeholder "installedTests"))
|
|
|
|
(lib.mesonOption "libjack-path" "${placeholder "jack"}/lib")
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "libcamera" true)
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonEnable "libffado" ffadoSupport)
|
|
|
|
(lib.mesonEnable "roc" rocSupport)
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "libpulse" true)
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonEnable "avahi" zeroconfSupport)
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "gstreamer" true)
|
|
|
|
(lib.mesonEnable "gstreamer-device-provider" true)
|
2024-06-05 15:53:02 +00:00
|
|
|
(lib.mesonEnable "systemd" enableSystemd)
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonEnable "systemd-system-service" enableSystemd)
|
|
|
|
(lib.mesonEnable "udev" (!enableSystemd))
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "ffmpeg" true)
|
|
|
|
(lib.mesonEnable "pw-cat-ffmpeg" true)
|
|
|
|
(lib.mesonEnable "bluez5" true)
|
|
|
|
(lib.mesonEnable "bluez5-backend-hsp-native" true)
|
|
|
|
(lib.mesonEnable "bluez5-backend-hfp-native" true)
|
|
|
|
(lib.mesonEnable "bluez5-backend-native-mm" true)
|
|
|
|
(lib.mesonEnable "bluez5-backend-ofono" true)
|
|
|
|
(lib.mesonEnable "bluez5-backend-hsphfpd" true)
|
2024-02-29 20:09:43 +00:00
|
|
|
# source code is not easily obtainable
|
|
|
|
(lib.mesonEnable "bluez5-codec-lc3plus" false)
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "bluez5-codec-lc3" true)
|
|
|
|
(lib.mesonEnable "bluez5-codec-ldac" (lib.meta.availableOn stdenv.hostPlatform ldacbt))
|
|
|
|
(lib.mesonEnable "opus" true)
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonOption "sysconfdir" "/etc")
|
|
|
|
(lib.mesonEnable "raop" raopSupport)
|
|
|
|
(lib.mesonOption "session-managers" "")
|
|
|
|
(lib.mesonEnable "vulkan" vulkanSupport)
|
|
|
|
(lib.mesonEnable "x11" x11Support)
|
|
|
|
(lib.mesonEnable "x11-xfixes" x11Support)
|
|
|
|
(lib.mesonEnable "libcanberra" x11Support)
|
2024-09-19 14:19:46 +00:00
|
|
|
(lib.mesonEnable "libmysofa" true)
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonEnable "sdl2" false) # required only to build examples, causes dependency loop
|
|
|
|
(lib.mesonBool "rlimits-install" false) # installs to /etc, we won't use this anyway
|
|
|
|
(lib.mesonEnable "compress-offload" true)
|
|
|
|
(lib.mesonEnable "man" true)
|
2024-07-27 06:49:29 +00:00
|
|
|
(lib.mesonEnable "snap" false) # we don't currently have a working snapd
|
2024-02-29 20:09:43 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Fontconfig error: Cannot load default config file
|
|
|
|
FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
postUnpack = ''
|
|
|
|
patchShebangs source/doc/*.py
|
|
|
|
patchShebangs source/doc/input-filter-h.sh
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
moveToOutput "bin/pw-jack" "$jack"
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.installed-tests = nixosTests.installed-tests.pipewire;
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Server and user space API to deal with multimedia pipelines";
|
2024-05-15 15:35:15 +00:00
|
|
|
changelog = "https://gitlab.freedesktop.org/pipewire/pipewire/-/releases/${finalAttrs.version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
homepage = "https://pipewire.org/";
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ kranzes k900 ];
|
|
|
|
};
|
|
|
|
})
|