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
, 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, c-ares, abseil-cpp, 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 c-ares abseil-cpp which ];
installPhase = ''
# bin stuff