From 8dcb8d4a440ae95e12e42750ea22698570af63aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=AErekc=C3=A4H=20nitraM=E2=80=AE?= Date: Wed, 5 Mar 2025 08:35:25 +0100 Subject: [PATCH] mumble: use lib helpers for cmake options where it makes them simpler These are the cases where bools have to be converted to options, so the helpers help make the code shorter and easier to read. --- .../networking/mumble/default.nix | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix index 64229c71ae43..7fbfb493737e 100644 --- a/pkgs/applications/networking/mumble/default.nix +++ b/pkgs/applications/networking/mumble/default.nix @@ -107,22 +107,22 @@ let ++ lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire; - cmakeFlags = - [ - "-D server=OFF" - "-D bundled-celt=ON" - "-D bundled-opus=OFF" - "-D bundled-speex=OFF" - "-D bundle-qt-translations=OFF" - "-D update=OFF" - "-D overlay-xcompile=OFF" - "-D oss=OFF" - "-D warnings-as-errors=OFF" # conversion error workaround - ] - ++ lib.optional (!speechdSupport) "-D speechd=OFF" - ++ lib.optional (!pulseSupport) "-D pulseaudio=OFF" - ++ lib.optional (!pipewireSupport) "-D pipewire=OFF" - ++ lib.optional jackSupport "-D alsa=OFF -D jackaudio=ON"; + cmakeFlags = [ + "-D server=OFF" + "-D bundled-celt=ON" + "-D bundled-opus=OFF" + "-D bundled-speex=OFF" + "-D bundle-qt-translations=OFF" + "-D update=OFF" + "-D overlay-xcompile=OFF" + "-D oss=OFF" + "-D warnings-as-errors=OFF" # conversion error workaround + (lib.cmakeBool "speechd" speechdSupport) + (lib.cmakeBool "pulseaudio" pulseSupport) + (lib.cmakeBool "pipewire" pipewireSupport) + (lib.cmakeBool "jackaudio" jackSupport) + (lib.cmakeBool "alsa" (!jackSupport)) + ]; env.NIX_CFLAGS_COMPILE = lib.optionalString speechdSupport "-I${speechd-minimal}/include/speech-dispatcher"; @@ -144,8 +144,8 @@ let cmakeFlags = [ "-D client=OFF" + (lib.cmakeBool "ice" iceSupport) ] - ++ lib.optional (!iceSupport) "-D ice=OFF" ++ lib.optionals iceSupport [ "-D Ice_HOME=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}" "-D CMAKE_PREFIX_PATH=${lib.getDev zeroc-ice};${lib.getLib zeroc-ice}"