about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/mumble/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/mumble/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/networking/mumble/default.nix47
1 files changed, 19 insertions, 28 deletions
diff --git a/nixpkgs/pkgs/applications/networking/mumble/default.nix b/nixpkgs/pkgs/applications/networking/mumble/default.nix
index 2eeb151bebeb..088391ba48f7 100644
--- a/nixpkgs/pkgs/applications/networking/mumble/default.nix
+++ b/nixpkgs/pkgs/applications/networking/mumble/default.nix
@@ -1,22 +1,15 @@
-{ lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkg-config, qt5
+{ lib, stdenv, fetchFromGitHub, pkg-config, qt5
 , avahi, boost, libopus, libsndfile, protobuf, speex, libcap
 , alsaLib, python3
 , rnnoise
-, jackSupport ? false, libjack2 ? null
-, speechdSupport ? false, speechd ? null
-, pulseSupport ? false, libpulseaudio ? null
-, iceSupport ? false, zeroc-ice ? null
-, grpcSupport ? false, grpc ? null, c-ares ? null, abseil-cpp ? null, which ? null
+, jackSupport ? false, libjack2
+, speechdSupport ? false, speechd
+, pulseSupport ? false, libpulseaudio
+, iceSupport ? false, zeroc-ice
+, grpcSupport ? false, grpc, which
 , nixosTests
 }:
 
-assert jackSupport -> libjack2 != null;
-assert speechdSupport -> speechd != null;
-assert pulseSupport -> libpulseaudio != null;
-assert iceSupport -> zeroc-ice != null;
-assert grpcSupport -> (grpc != null && c-ares != null && abseil-cpp != null && which != null);
-
-with lib;
 let
   generic = overrides: source: qt5.mkDerivation (source // overrides // {
     pname = overrides.type;
@@ -42,8 +35,8 @@ let
       "CONFIG+=no-bundled-opus"
       "CONFIG+=no-bundled-speex"
       "DEFINES+=PLUGIN_PATH=${placeholder "out"}/lib/mumble"
-    ] ++ optional (!speechdSupport) "CONFIG+=no-speechd"
-      ++ optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
+    ] ++ lib.optional (!speechdSupport) "CONFIG+=no-speechd"
+      ++ lib.optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
       ++ (overrides.configureFlags or [ ]);
 
     preConfigure = ''
@@ -64,11 +57,9 @@ let
       runHook postInstall
     '';
 
-    enableParallelBuilding = true;
-
     passthru.tests.connectivity = nixosTests.mumble;
 
-    meta = {
+    meta = with lib; {
       description = "Low-latency, high quality voice chat software";
       homepage = "https://mumble.info";
       license = licenses.bsd3;
@@ -82,16 +73,16 @@ let
 
     nativeBuildInputs = [ qt5.qttools ];
     buildInputs = [ libopus libsndfile speex qt5.qtsvg rnnoise ]
-      ++ optional stdenv.isLinux alsaLib
-      ++ optional jackSupport libjack2
-      ++ optional speechdSupport speechd
-      ++ optional pulseSupport libpulseaudio;
+      ++ lib.optional stdenv.isLinux alsaLib
+      ++ lib.optional jackSupport libjack2
+      ++ lib.optional speechdSupport speechd
+      ++ lib.optional pulseSupport libpulseaudio;
 
     configureFlags = [
       "CONFIG+=no-server"
     ];
 
-    NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher";
+    NIX_CFLAGS_COMPILE = lib.optional speechdSupport "-I${speechd}/include/speech-dispatcher";
 
     installPhase = ''
       # bin stuff
@@ -113,18 +104,18 @@ let
   server = source: generic {
     type = "murmur";
 
-    postPatch = optional iceSupport ''
+    postPatch = lib.optional iceSupport ''
       grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
     '';
 
     configureFlags = [
       "CONFIG+=no-client"
-    ] ++ optional (!iceSupport) "CONFIG+=no-ice"
-      ++ optional grpcSupport "CONFIG+=grpc";
+    ] ++ lib.optional (!iceSupport) "CONFIG+=no-ice"
+      ++ lib.optional grpcSupport "CONFIG+=grpc";
 
     buildInputs = [ libcap ]
-      ++ optional iceSupport zeroc-ice
-      ++ optionals grpcSupport [ grpc c-ares abseil-cpp which ];
+      ++ lib.optional iceSupport zeroc-ice
+      ++ lib.optionals grpcSupport [ grpc which ];
 
     installPhase = ''
       # bin stuff