2022-03-05 16:20:37 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, qt5, cmake
|
2020-04-24 23:36:52 +00:00
|
|
|
, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
|
2021-06-28 23:13:55 +00:00
|
|
|
, alsa-lib, python3
|
2020-04-24 23:36:52 +00:00
|
|
|
, rnnoise
|
2022-03-05 16:20:37 +00:00
|
|
|
, nixosTests
|
|
|
|
, poco
|
|
|
|
, flac
|
|
|
|
, libogg
|
|
|
|
, libvorbis
|
|
|
|
, grpcSupport ? false, grpc, which
|
|
|
|
, iceSupport ? true, zeroc-ice
|
2021-02-24 18:30:23 +00:00
|
|
|
, jackSupport ? false, libjack2
|
2022-03-05 16:20:37 +00:00
|
|
|
, pipewireSupport ? true, pipewire
|
|
|
|
, pulseSupport ? true, libpulseaudio
|
2021-02-24 18:30:23 +00:00
|
|
|
, speechdSupport ? false, speechd
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2022-03-05 16:20:37 +00:00
|
|
|
generic = overrides: source: stdenv.mkDerivation (source // overrides // {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = overrides.type;
|
|
|
|
version = source.version;
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config python3 qt5.wrapQtAppsHook qt5.qttools ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (overrides.nativeBuildInputs or [ ]);
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
buildInputs = [ avahi boost poco protobuf ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ (overrides.buildInputs or [ ]);
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-D g15=OFF"
|
|
|
|
] ++ (overrides.configureFlags or [ ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs scripts
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.connectivity = nixosTests.mumble;
|
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Low-latency, high quality voice chat software";
|
|
|
|
homepage = "https://mumble.info";
|
|
|
|
license = licenses.bsd3;
|
2021-07-03 03:11:41 +00:00
|
|
|
maintainers = with maintainers; [ petabyteboy infinisil felixsinger ];
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
client = source: generic {
|
|
|
|
type = "mumble";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ qt5.qttools ];
|
2022-03-05 16:20:37 +00:00
|
|
|
buildInputs = [ flac libogg libopus libsndfile libvorbis qt5.qtsvg rnnoise speex ]
|
|
|
|
++ lib.optional (!jackSupport) alsa-lib
|
2021-02-24 18:30:23 +00:00
|
|
|
++ lib.optional jackSupport libjack2
|
|
|
|
++ lib.optional speechdSupport speechd
|
2022-03-05 16:20:37 +00:00
|
|
|
++ lib.optional pulseSupport libpulseaudio
|
|
|
|
++ lib.optional pipewireSupport pipewire;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
2022-03-05 16:20:37 +00:00
|
|
|
"-D server=OFF"
|
|
|
|
"-D bundled-celt=ON"
|
|
|
|
"-D bundled-opus=OFF"
|
|
|
|
"-D bundled-speex=OFF"
|
|
|
|
"-D bundled-rnnoise=OFF"
|
|
|
|
"-D bundle-qt-translations=OFF"
|
|
|
|
"-D update=OFF"
|
|
|
|
"-D overlay-xcompile=OFF"
|
|
|
|
"-D oss=OFF"
|
|
|
|
] ++ 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";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-24 18:30:23 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optional speechdSupport "-I${speechd}/include/speech-dispatcher";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/mumble \
|
|
|
|
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath (lib.optional pulseSupport libpulseaudio ++ lib.optional pipewireSupport pipewire)}"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
} source;
|
|
|
|
|
|
|
|
server = source: generic {
|
|
|
|
type = "murmur";
|
|
|
|
|
|
|
|
configureFlags = [
|
2022-03-05 16:20:37 +00:00
|
|
|
"-D client=OFF"
|
|
|
|
] ++ 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}"
|
|
|
|
"-D Ice_SLICE_DIR=${lib.getDev zeroc-ice}/share/ice/slice"
|
|
|
|
]
|
|
|
|
++ lib.optional grpcSupport "-D grpc=ON";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
buildInputs = [ libcap ]
|
2021-02-24 18:30:23 +00:00
|
|
|
++ lib.optional iceSupport zeroc-ice
|
2021-03-16 09:55:35 +00:00
|
|
|
++ lib.optionals grpcSupport [ grpc which ];
|
2020-04-24 23:36:52 +00:00
|
|
|
} source;
|
|
|
|
|
|
|
|
source = rec {
|
2022-03-05 16:20:37 +00:00
|
|
|
version = "unstable-1.4.231";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Needs submodules
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mumble-voip";
|
|
|
|
repo = "mumble";
|
2022-03-05 16:20:37 +00:00
|
|
|
rev = "9e0e274d6a9d8a9919267e747d05d0500d150560";
|
|
|
|
sha256 = "0whvb4nlf7gjf2v7wsaq0ir18mshhw5wi8c9q9qz43wnh42nn2qi";
|
2020-04-24 23:36:52 +00:00
|
|
|
fetchSubmodules = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
mumble = client source;
|
|
|
|
murmur = server source;
|
|
|
|
}
|