@@ -1,22 +1,15 @@
1−{ lib, stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkg-config, qt5
1+{ lib, stdenv, fetchFromGitHub, pkg-config, qt5
22, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
33, alsaLib, python3
44, rnnoise
5−, jackSupport ? false, libjack2 ? null
6−, speechdSupport ? false, speechd ? null
7−, pulseSupport ? false, libpulseaudio ? null
8−, iceSupport ? false, zeroc-ice ? null
9−, grpcSupport ? false, grpc ? null, c-ares ? null, abseil-cpp ? null, which ? null
5+, jackSupport ? false, libjack2
6+, speechdSupport ? false, speechd
7+, pulseSupport ? false, libpulseaudio
8+, iceSupport ? false, zeroc-ice
9+, grpcSupport ? false, grpc, c-ares, abseil-cpp, which
1010, nixosTests
1111}:
1212
13−assert jackSupport -> libjack2 != null;
14−assert speechdSupport -> speechd != null;
15−assert pulseSupport -> libpulseaudio != null;
16−assert iceSupport -> zeroc-ice != null;
17−assert grpcSupport -> (grpc != null && c-ares != null && abseil-cpp != null && which != null);
18−
19−with lib;
2013let
2114 generic = overrides: source: qt5.mkDerivation (source // overrides // {
2215 pname = overrides.type;
@@ -42,8 +35,8 @@ let
4235 "CONFIG+=no-bundled-opus"
4336 "CONFIG+=no-bundled-speex"
4437 "DEFINES+=PLUGIN_PATH=${placeholder "out"}/lib/mumble"
45− ] ++ optional (!speechdSupport) "CONFIG+=no-speechd"
46− ++ optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
38+ ] ++ lib.optional (!speechdSupport) "CONFIG+=no-speechd"
39+ ++ lib.optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
4740 ++ (overrides.configureFlags or [ ]);
4841
4942 preConfigure = ''
@@ -64,11 +57,9 @@ let
6457 runHook postInstall
6558 '';
6659
67− enableParallelBuilding = true;
68−
6960 passthru.tests.connectivity = nixosTests.mumble;
7061
71− meta = {
62+ meta = with lib; {
7263 description = "Low-latency, high quality voice chat software";
7364 homepage = "https://mumble.info";
7465 license = licenses.bsd3;
@@ -82,16 +73,16 @@ let
8273
8374 nativeBuildInputs = [ qt5.qttools ];
8475 buildInputs = [ libopus libsndfile speex qt5.qtsvg rnnoise ]
85− ++ optional stdenv.isLinux alsaLib
86− ++ optional jackSupport libjack2
87− ++ optional speechdSupport speechd
88− ++ optional pulseSupport libpulseaudio;
76+ ++ lib.optional stdenv.isLinux alsaLib
77+ ++ lib.optional jackSupport libjack2
78+ ++ lib.optional speechdSupport speechd
79+ ++ lib.optional pulseSupport libpulseaudio;
8980
9081 configureFlags = [
9182 "CONFIG+=no-server"
9283 ];
9384
94− NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher";
85+ NIX_CFLAGS_COMPILE = lib.optional speechdSupport "-I${speechd}/include/speech-dispatcher";
9586
9687 installPhase = ''
9788 # bin stuff
@@ -113,18 +104,18 @@ let
113104 server = source: generic {
114105 type = "murmur";
115106
116− postPatch = optional iceSupport ''
107+ postPatch = lib.optional iceSupport ''
117108 grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
118109 '';
119110
120111 configureFlags = [
121112 "CONFIG+=no-client"
122− ] ++ optional (!iceSupport) "CONFIG+=no-ice"
123− ++ optional grpcSupport "CONFIG+=grpc";
113+ ] ++ lib.optional (!iceSupport) "CONFIG+=no-ice"
114+ ++ lib.optional grpcSupport "CONFIG+=grpc";
124115
125116 buildInputs = [ libcap ]
126− ++ optional iceSupport zeroc-ice
127− ++ optionals grpcSupport [ grpc c-ares abseil-cpp which ];
117+ ++ lib.optional iceSupport zeroc-ice
118+ ++ lib.optionals grpcSupport [ grpc c-ares abseil-cpp which ];
128119
129120 installPhase = ''
130121 # bin stuff