summary refs log tree commit diff
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2023-09-09 13:50:07 +0200
committerOPNA2608 <christoph.neidahl@gmail.com>2023-09-09 13:50:07 +0200
commit05c541d09a5d4f3486c534b6bf5ecacded3129d2 (patch)
tree6b7f2479415e24789d7d629fc842a50b9b33df15
parent1a5bda2b28ea75a96dda2c349fe6d5e7864950ee (diff)
downloadnixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar.gz
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar.bz2
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar.lz
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar.xz
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.tar.zst
nixpkgs-05c541d09a5d4f3486c534b6bf5ecacded3129d2.zip
pipewire: Make ldacbt support optional based on availability
Because ldacbt doesn't support non-little-endian platforms.
-rw-r--r--pkgs/development/libraries/pipewire/default.nix10
1 files changed, 8 insertions, 2 deletions
diff --git a/pkgs/development/libraries/pipewire/default.nix b/pkgs/development/libraries/pipewire/default.nix
index fdc514c286b..28bbcb4a889 100644
--- a/pkgs/development/libraries/pipewire/default.nix
+++ b/pkgs/development/libraries/pipewire/default.nix
@@ -42,10 +42,11 @@
 , bluez
 , sbc
 , libfreeaptx
-, ldacbt
 , liblc3
 , fdk_aac
 , libopus
+, ldacbtSupport ? bluezSupport && lib.meta.availableOn stdenv.hostPlatform ldacbt
+, ldacbt
 , nativeHspSupport ? true
 , nativeHfpSupport ? true
 , nativeModemManagerSupport ? true
@@ -70,6 +71,9 @@
 , ffado
 }:
 
+# Bluetooth codec only makes sense if general bluetooth enabled
+assert ldacbtSupport -> bluezSupport;
+
 let
   mesonEnableFeature = b: if b then "enabled" else "disabled";
 
@@ -144,7 +148,8 @@ let
     ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
     ++ lib.optionals libcameraSupport [ libcamera libdrm ]
     ++ lib.optional ffmpegSupport ffmpeg
-    ++ lib.optionals bluezSupport [ bluez libfreeaptx ldacbt liblc3 sbc fdk_aac libopus ]
+    ++ lib.optionals bluezSupport [ bluez libfreeaptx liblc3 sbc fdk_aac libopus ]
+    ++ lib.optional ldacbtSupport ldacbt
     ++ lib.optional nativeModemManagerSupport modemmanager
     ++ lib.optional pulseTunnelSupport libpulseaudio
     ++ lib.optional zeroconfSupport avahi
@@ -184,6 +189,7 @@ let
       # source code is not easily obtainable
       "-Dbluez5-codec-lc3plus=disabled"
       "-Dbluez5-codec-lc3=${mesonEnableFeature bluezSupport}"
+      "-Dbluez5-codec-ldac=${mesonEnableFeature ldacbtSupport}"
       "-Dsysconfdir=/etc"
       "-Dpipewire_confdata_dir=${placeholder "lib"}/share/pipewire"
       "-Draop=${mesonEnableFeature raopSupport}"