mumble: cleanup ? null and assertion, remove not required enableParallelBuilding due to qmake

This commit is contained in:
Sandro Jäckel 2021-02-22 08:25:35 +01:00
parent ba0626eb7c
commit c560f7954e
No known key found for this signature in database
GPG Key ID: 3AF5A43A3EECC2E5

View File

@ -2,21 +2,14 @@
, avahi, boost, libopus, libsndfile, protobuf, speex, libcap , avahi, boost, libopus, libsndfile, protobuf, speex, libcap
, alsaLib, python3 , alsaLib, python3
, rnnoise , rnnoise
, jackSupport ? false, libjack2 ? null , jackSupport ? false, libjack2
, speechdSupport ? false, speechd ? null , speechdSupport ? false, speechd
, pulseSupport ? false, libpulseaudio ? null , pulseSupport ? false, libpulseaudio
, iceSupport ? false, zeroc-ice ? null , iceSupport ? false, zeroc-ice
, grpcSupport ? false, grpc ? null, c-ares ? null, abseil-cpp ? null, which ? null , grpcSupport ? false, grpc, c-ares, abseil-cpp, which
, nixosTests , 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 let
generic = overrides: source: qt5.mkDerivation (source // overrides // { generic = overrides: source: qt5.mkDerivation (source // overrides // {
pname = overrides.type; pname = overrides.type;
@ -42,8 +35,8 @@ let
"CONFIG+=no-bundled-opus" "CONFIG+=no-bundled-opus"
"CONFIG+=no-bundled-speex" "CONFIG+=no-bundled-speex"
"DEFINES+=PLUGIN_PATH=${placeholder "out"}/lib/mumble" "DEFINES+=PLUGIN_PATH=${placeholder "out"}/lib/mumble"
] ++ optional (!speechdSupport) "CONFIG+=no-speechd" ] ++ lib.optional (!speechdSupport) "CONFIG+=no-speechd"
++ optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio" ++ lib.optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
++ (overrides.configureFlags or [ ]); ++ (overrides.configureFlags or [ ]);
preConfigure = '' preConfigure = ''
@ -64,11 +57,9 @@ let
runHook postInstall runHook postInstall
''; '';
enableParallelBuilding = true;
passthru.tests.connectivity = nixosTests.mumble; passthru.tests.connectivity = nixosTests.mumble;
meta = { meta = with lib; {
description = "Low-latency, high quality voice chat software"; description = "Low-latency, high quality voice chat software";
homepage = "https://mumble.info"; homepage = "https://mumble.info";
license = licenses.bsd3; license = licenses.bsd3;
@ -82,16 +73,16 @@ let
nativeBuildInputs = [ qt5.qttools ]; nativeBuildInputs = [ qt5.qttools ];
buildInputs = [ libopus libsndfile speex qt5.qtsvg rnnoise ] buildInputs = [ libopus libsndfile speex qt5.qtsvg rnnoise ]
++ optional stdenv.isLinux alsaLib ++ lib.optional stdenv.isLinux alsaLib
++ optional jackSupport libjack2 ++ lib.optional jackSupport libjack2
++ optional speechdSupport speechd ++ lib.optional speechdSupport speechd
++ optional pulseSupport libpulseaudio; ++ lib.optional pulseSupport libpulseaudio;
configureFlags = [ configureFlags = [
"CONFIG+=no-server" "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 = '' installPhase = ''
# bin stuff # bin stuff
@ -113,18 +104,18 @@ let
server = source: generic { server = source: generic {
type = "murmur"; 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' grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
''; '';
configureFlags = [ configureFlags = [
"CONFIG+=no-client" "CONFIG+=no-client"
] ++ optional (!iceSupport) "CONFIG+=no-ice" ] ++ lib.optional (!iceSupport) "CONFIG+=no-ice"
++ optional grpcSupport "CONFIG+=grpc"; ++ lib.optional grpcSupport "CONFIG+=grpc";
buildInputs = [ libcap ] buildInputs = [ libcap ]
++ optional iceSupport zeroc-ice ++ lib.optional iceSupport zeroc-ice
++ optionals grpcSupport [ grpc c-ares abseil-cpp which ]; ++ lib.optionals grpcSupport [ grpc c-ares abseil-cpp which ];
installPhase = '' installPhase = ''
# bin stuff # bin stuff