11 , enableSystemd ? true
25 , webrtc-audio-processing
26 , webrtc-audio-processing_1
28 , readline # meson can't find <7 as those versions don't have a .pc file
33 , withValgrind ? lib.meta.availableOn stdenv.hostPlatform valgrind
35 , libcameraSupport ? true
38 , gstreamerSupport ? true
40 , ffmpegSupport ? true
49 , ldacbtSupport ? bluezSupport && lib.meta.availableOn stdenv.hostPlatform ldacbt
51 , nativeHspSupport ? true
52 , nativeHfpSupport ? true
53 , nativeModemManagerSupport ? true
56 , hsphfpdSupport ? true
57 , pulseTunnelSupport ? true
59 , zeroconfSupport ? true
68 , mysofaSupport ? true
71 , ffadoSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
76 # Bluetooth codec only makes sense if general bluetooth enabled
77 assert ldacbtSupport -> bluezSupport;
80 mesonEnableFeature = b: if b then "enabled" else "disabled";
82 self = stdenv.mkDerivation rec {
95 src = fetchFromGitLab {
96 domain = "gitlab.freedesktop.org";
100 sha256 = "sha256-9W9y+wtS/CYUaPRrCRmRDeyvuS1XllMBNQLy6GAMqBM=";
104 # Load libjack from a known location
105 ./0060-libjack-path.patch
106 # Move installed tests into their own output.
107 ./0070-installed-tests-path.patch
111 nativeBuildInputs = [
137 ] ++ (if enableSystemd then [ systemd ] else [ eudev ])
138 ++ (if lib.meta.availableOn stdenv.hostPlatform webrtc-audio-processing_1 then [ webrtc-audio-processing_1 ] else [ webrtc-audio-processing ])
139 ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
140 ++ lib.optionals libcameraSupport [ libcamera libdrm ]
141 ++ lib.optional ffmpegSupport ffmpeg
142 ++ lib.optionals bluezSupport [ bluez libfreeaptx liblc3 sbc fdk_aac libopus ]
143 ++ lib.optional ldacbtSupport ldacbt
144 ++ lib.optional nativeModemManagerSupport modemmanager
145 ++ lib.optional pulseTunnelSupport libpulseaudio
146 ++ lib.optional zeroconfSupport avahi
147 ++ lib.optional raopSupport openssl
148 ++ lib.optional rocSupport roc-toolkit
149 ++ lib.optionals x11Support [ libcanberra xorg.libX11 xorg.libXfixes ]
150 ++ lib.optional mysofaSupport libmysofa
151 ++ lib.optional ffadoSupport ffado;
153 # Valgrind binary is required for running one optional test.
154 nativeCheckInputs = lib.optional withValgrind valgrind;
158 "-Dudevrulesdir=lib/udev/rules.d"
159 "-Dinstalled_tests=enabled"
160 "-Dinstalled_test_prefix=${placeholder "installedTests"}"
161 "-Dlibjack-path=${placeholder "jack"}/lib"
162 "-Dlibcamera=${mesonEnableFeature libcameraSupport}"
163 "-Dlibffado=${mesonEnableFeature ffadoSupport}"
164 "-Droc=${mesonEnableFeature rocSupport}"
165 "-Dlibpulse=${mesonEnableFeature pulseTunnelSupport}"
166 "-Davahi=${mesonEnableFeature zeroconfSupport}"
167 "-Dgstreamer=${mesonEnableFeature gstreamerSupport}"
168 "-Dsystemd-system-service=${mesonEnableFeature enableSystemd}"
169 "-Dudev=${mesonEnableFeature (!enableSystemd)}"
170 "-Dffmpeg=${mesonEnableFeature ffmpegSupport}"
171 "-Dbluez5=${mesonEnableFeature bluezSupport}"
172 "-Dbluez5-backend-hsp-native=${mesonEnableFeature nativeHspSupport}"
173 "-Dbluez5-backend-hfp-native=${mesonEnableFeature nativeHfpSupport}"
174 "-Dbluez5-backend-native-mm=${mesonEnableFeature nativeModemManagerSupport}"
175 "-Dbluez5-backend-ofono=${mesonEnableFeature ofonoSupport}"
176 "-Dbluez5-backend-hsphfpd=${mesonEnableFeature hsphfpdSupport}"
177 # source code is not easily obtainable
178 "-Dbluez5-codec-lc3plus=disabled"
179 "-Dbluez5-codec-lc3=${mesonEnableFeature bluezSupport}"
180 "-Dbluez5-codec-ldac=${mesonEnableFeature ldacbtSupport}"
182 "-Draop=${mesonEnableFeature raopSupport}"
183 "-Dsession-managers="
185 "-Dx11=${mesonEnableFeature x11Support}"
186 "-Dx11-xfixes=${mesonEnableFeature x11Support}"
187 "-Dlibcanberra=${mesonEnableFeature x11Support}"
188 "-Dlibmysofa=${mesonEnableFeature mysofaSupport}"
189 "-Dsdl2=disabled" # required only to build examples, causes dependency loop
190 "-Drlimits-install=false" # installs to /etc, we won't use this anyway
191 "-Dcompress-offload=enabled"
194 # Fontconfig error: Cannot load default config file
195 FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
200 patchShebangs source/doc/input-filter.sh
201 patchShebangs source/doc/input-filter-h.sh
205 moveToOutput "bin/pw-jack" "$jack"
208 passthru.tests.installed-tests = nixosTests.installed-tests.pipewire;
211 description = "Server and user space API to deal with multimedia pipelines";
212 changelog = "https://gitlab.freedesktop.org/pipewire/pipewire/-/releases/${version}";
213 homepage = "https://pipewire.org/";
214 license = licenses.mit;
215 platforms = platforms.linux;
216 maintainers = with maintainers; [ kranzes k900 ];