pipewire: fix build for FreeBSD (#387712)

authored by K900 and committed by GitHub 482a6cc2 83e2dec6

+52 -25
+52 -25
pkgs/development/libraries/pipewire/default.nix
··· 6 python3, 7 meson, 8 ninja, 9 elogind, 10 systemd, 11 - enableSystemd ? true, # enableSystemd=false maintained by maintainers.qyliss. 12 pkg-config, 13 docutils, 14 doxygen, ··· 55 libcanberra, 56 xorg, 57 libmysofa, 58 - ffadoSupport ? x11Support && lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform, 59 ffado, 60 libselinux, 61 libebur128, ··· 66 webrtc-audio-processing_1 67 webrtc-audio-processing 68 ]; 69 in 70 71 stdenv.mkDerivation (finalAttrs: { ··· 111 112 buildInputs = 113 [ 114 - alsa-lib 115 - bluez 116 dbus 117 - fdk_aac 118 ffmpeg 119 fftwFloat 120 glib 121 gst_all_1.gst-plugins-base 122 gst_all_1.gstreamer 123 - libcamera 124 libebur128 125 libjack2 126 - libfreeaptx 127 - liblc3 128 libmysofa 129 libopus 130 libpulseaudio 131 libusb1 132 - libselinux 133 libsndfile 134 lilv 135 - modemmanager 136 ncurses 137 readline 138 - sbc 139 ] 140 ++ ( 141 if enableSystemd then 142 [ systemd ] 143 - else 144 [ 145 elogind 146 udev 147 ] 148 ) 149 ++ lib.take 1 webrtc-audio-processings 150 - ++ lib.optional (lib.meta.availableOn stdenv.hostPlatform ldacbt) ldacbt 151 ++ lib.optional zeroconfSupport avahi 152 ++ lib.optional raopSupport openssl 153 ++ lib.optional rocSupport roc-toolkit ··· 161 xorg.libX11 162 xorg.libXfixes 163 ] 164 - ++ lib.optional ffadoSupport ffado; 165 166 # Valgrind binary is required for running one optional test. 167 nativeCheckInputs = lib.optional (lib.meta.availableOn stdenv.hostPlatform valgrind) valgrind; 168 169 mesonFlags = [ 170 (lib.mesonEnable "docs" true) 171 (lib.mesonOption "udevrulesdir" "lib/udev/rules.d") 172 (lib.mesonEnable "installed_tests" true) 173 (lib.mesonOption "installed_test_prefix" (placeholder "installedTests")) 174 (lib.mesonOption "libjack-path" "${placeholder "jack"}/lib") 175 (lib.mesonEnable "echo-cancel-webrtc" (webrtc-audio-processings != [ ])) 176 - (lib.mesonEnable "libcamera" true) 177 (lib.mesonEnable "libffado" ffadoSupport) 178 (lib.mesonEnable "roc" rocSupport) 179 (lib.mesonEnable "libpulse" true) ··· 181 (lib.mesonEnable "gstreamer" true) 182 (lib.mesonEnable "gstreamer-device-provider" true) 183 (lib.mesonOption "logind-provider" (if enableSystemd then "libsystemd" else "libelogind")) 184 (lib.mesonEnable "systemd" enableSystemd) 185 (lib.mesonEnable "systemd-system-service" enableSystemd) 186 - (lib.mesonEnable "udev" (!enableSystemd)) 187 (lib.mesonEnable "ffmpeg" true) 188 (lib.mesonEnable "pw-cat-ffmpeg" true) 189 - (lib.mesonEnable "bluez5" true) 190 - (lib.mesonEnable "bluez5-backend-hsp-native" true) 191 - (lib.mesonEnable "bluez5-backend-hfp-native" true) 192 - (lib.mesonEnable "bluez5-backend-native-mm" true) 193 - (lib.mesonEnable "bluez5-backend-ofono" true) 194 - (lib.mesonEnable "bluez5-backend-hsphfpd" true) 195 # source code is not easily obtainable 196 (lib.mesonEnable "bluez5-codec-lc3plus" false) 197 - (lib.mesonEnable "bluez5-codec-lc3" true) 198 - (lib.mesonEnable "bluez5-codec-ldac" (lib.meta.availableOn stdenv.hostPlatform ldacbt)) 199 (lib.mesonEnable "opus" true) 200 (lib.mesonOption "sysconfdir" "/etc") 201 (lib.mesonEnable "raop" raopSupport) ··· 233 changelog = "https://gitlab.freedesktop.org/pipewire/pipewire/-/releases/${finalAttrs.version}"; 234 homepage = "https://pipewire.org/"; 235 license = licenses.mit; 236 - platforms = platforms.linux; 237 maintainers = with maintainers; [ 238 kranzes 239 k900
··· 6 python3, 7 meson, 8 ninja, 9 + freebsd, 10 elogind, 11 + libinotify-kqueue, 12 + epoll-shim, 13 systemd, 14 + enableSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd, # enableSystemd=false maintained by maintainers.qyliss. 15 pkg-config, 16 docutils, 17 doxygen, ··· 58 libcanberra, 59 xorg, 60 libmysofa, 61 + ffadoSupport ? 62 + x11Support 63 + && lib.systems.equals stdenv.buildPlatform stdenv.hostPlatform 64 + && lib.meta.availableOn stdenv.hostPlatform ffado, 65 ffado, 66 libselinux, 67 libebur128, ··· 72 webrtc-audio-processing_1 73 webrtc-audio-processing 74 ]; 75 + 76 + bluezSupport = stdenv.hostPlatform.isLinux; 77 + modemmanagerSupport = lib.meta.availableOn stdenv.hostPlatform modemmanager; 78 + libcameraSupport = lib.meta.availableOn stdenv.hostPlatform libcamera; 79 + ldacbtSupport = lib.meta.availableOn stdenv.hostPlatform ldacbt; 80 in 81 82 stdenv.mkDerivation (finalAttrs: { ··· 122 123 buildInputs = 124 [ 125 dbus 126 ffmpeg 127 fftwFloat 128 glib 129 gst_all_1.gst-plugins-base 130 gst_all_1.gstreamer 131 libebur128 132 libjack2 133 libmysofa 134 libopus 135 libpulseaudio 136 libusb1 137 libsndfile 138 lilv 139 ncurses 140 readline 141 ] 142 ++ ( 143 if enableSystemd then 144 [ systemd ] 145 + else if stdenv.hostPlatform.isLinux then 146 [ 147 elogind 148 udev 149 ] 150 + else 151 + [ ] 152 ) 153 + ++ lib.optionals stdenv.hostPlatform.isFreeBSD [ 154 + libinotify-kqueue 155 + epoll-shim 156 + freebsd.libstdthreads 157 + ] 158 ++ lib.take 1 webrtc-audio-processings 159 + ++ lib.optional stdenv.hostPlatform.isLinux alsa-lib 160 + ++ lib.optional ldacbtSupport ldacbt 161 + ++ lib.optional libcameraSupport libcamera 162 ++ lib.optional zeroconfSupport avahi 163 ++ lib.optional raopSupport openssl 164 ++ lib.optional rocSupport roc-toolkit ··· 172 xorg.libX11 173 xorg.libXfixes 174 ] 175 + ++ lib.optionals bluezSupport [ 176 + bluez 177 + libfreeaptx 178 + liblc3 179 + sbc 180 + fdk_aac 181 + ] 182 + ++ lib.optional ffadoSupport ffado 183 + ++ lib.optional stdenv.hostPlatform.isLinux libselinux 184 + ++ lib.optional modemmanagerSupport modemmanager; 185 186 # Valgrind binary is required for running one optional test. 187 nativeCheckInputs = lib.optional (lib.meta.availableOn stdenv.hostPlatform valgrind) valgrind; 188 189 mesonFlags = [ 190 + (lib.mesonEnable "pipewire-alsa" stdenv.hostPlatform.isLinux) 191 + (lib.mesonEnable "alsa" stdenv.hostPlatform.isLinux) 192 (lib.mesonEnable "docs" true) 193 (lib.mesonOption "udevrulesdir" "lib/udev/rules.d") 194 (lib.mesonEnable "installed_tests" true) 195 (lib.mesonOption "installed_test_prefix" (placeholder "installedTests")) 196 (lib.mesonOption "libjack-path" "${placeholder "jack"}/lib") 197 (lib.mesonEnable "echo-cancel-webrtc" (webrtc-audio-processings != [ ])) 198 + (lib.mesonEnable "libcamera" (lib.meta.availableOn stdenv.hostPlatform libcamera)) 199 (lib.mesonEnable "libffado" ffadoSupport) 200 (lib.mesonEnable "roc" rocSupport) 201 (lib.mesonEnable "libpulse" true) ··· 203 (lib.mesonEnable "gstreamer" true) 204 (lib.mesonEnable "gstreamer-device-provider" true) 205 (lib.mesonOption "logind-provider" (if enableSystemd then "libsystemd" else "libelogind")) 206 + (lib.mesonEnable "logind" stdenv.hostPlatform.isLinux) 207 + (lib.mesonEnable "selinux" stdenv.hostPlatform.isLinux) 208 + (lib.mesonEnable "avb" stdenv.hostPlatform.isLinux) 209 + (lib.mesonEnable "v4l2" stdenv.hostPlatform.isLinux) 210 + (lib.mesonEnable "pipewire-v4l2" stdenv.hostPlatform.isLinux) 211 (lib.mesonEnable "systemd" enableSystemd) 212 (lib.mesonEnable "systemd-system-service" enableSystemd) 213 + (lib.mesonEnable "udev" (!enableSystemd && stdenv.hostPlatform.isLinux)) 214 (lib.mesonEnable "ffmpeg" true) 215 (lib.mesonEnable "pw-cat-ffmpeg" true) 216 + (lib.mesonEnable "bluez5" bluezSupport) 217 + (lib.mesonEnable "bluez5-backend-hsp-native" bluezSupport) 218 + (lib.mesonEnable "bluez5-backend-hfp-native" bluezSupport) 219 + (lib.mesonEnable "bluez5-backend-native-mm" bluezSupport) 220 + (lib.mesonEnable "bluez5-backend-ofono" bluezSupport) 221 + (lib.mesonEnable "bluez5-backend-hsphfpd" bluezSupport) 222 # source code is not easily obtainable 223 (lib.mesonEnable "bluez5-codec-lc3plus" false) 224 + (lib.mesonEnable "bluez5-codec-lc3" bluezSupport) 225 + (lib.mesonEnable "bluez5-codec-ldac" (bluezSupport && ldacbtSupport)) 226 (lib.mesonEnable "opus" true) 227 (lib.mesonOption "sysconfdir" "/etc") 228 (lib.mesonEnable "raop" raopSupport) ··· 260 changelog = "https://gitlab.freedesktop.org/pipewire/pipewire/-/releases/${finalAttrs.version}"; 261 homepage = "https://pipewire.org/"; 262 license = licenses.mit; 263 + platforms = platforms.linux ++ platforms.freebsd; 264 maintainers = with maintainers; [ 265 kranzes 266 k900