2021-02-22 07:25:23 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, pkg-config, qt5
|
2019-10-08 00:44:48 +01:00
|
|
|
, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
|
2021-06-10 03:57:09 +01:00
|
|
|
, alsa-lib, python3
|
2019-11-06 02:20:09 +00:00
|
|
|
, rnnoise
|
2021-02-22 07:25:35 +00:00
|
|
|
, jackSupport ? false, libjack2
|
|
|
|
, speechdSupport ? false, speechd
|
|
|
|
, pulseSupport ? false, libpulseaudio
|
|
|
|
, iceSupport ? false, zeroc-ice
|
2021-03-13 23:15:33 +00:00
|
|
|
, grpcSupport ? false, grpc, which
|
2020-04-16 08:21:21 +01:00
|
|
|
, nixosTests
|
2014-01-31 01:01:22 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2019-10-08 00:44:48 +01:00
|
|
|
generic = overrides: source: qt5.mkDerivation (source // overrides // {
|
2019-12-09 12:18:39 +00:00
|
|
|
pname = overrides.type;
|
|
|
|
version = source.version;
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2020-02-19 13:01:22 +00:00
|
|
|
patches = (source.patches or [])
|
|
|
|
++ [ ./fix-rnnoise-argument.patch ];
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2021-01-25 08:49:31 +00:00
|
|
|
nativeBuildInputs = [ pkg-config python3 qt5.qmake ]
|
2015-10-04 06:21:11 +01:00
|
|
|
++ (overrides.nativeBuildInputs or [ ]);
|
2019-04-22 22:48:14 +01:00
|
|
|
|
2019-09-14 09:49:38 +01:00
|
|
|
buildInputs = [ boost protobuf avahi ]
|
2015-10-04 06:21:11 +01:00
|
|
|
++ (overrides.buildInputs or [ ]);
|
|
|
|
|
2016-04-17 00:38:29 +01:00
|
|
|
qmakeFlags = [
|
2018-09-25 11:43:44 +01:00
|
|
|
"CONFIG+=c++11"
|
2015-10-04 06:21:11 +01:00
|
|
|
"CONFIG+=shared"
|
|
|
|
"CONFIG+=no-g15"
|
|
|
|
"CONFIG+=packaged"
|
|
|
|
"CONFIG+=no-update"
|
|
|
|
"CONFIG+=no-embed-qt-translations"
|
2015-10-12 15:04:49 +01:00
|
|
|
"CONFIG+=bundled-celt"
|
2015-10-04 06:21:11 +01:00
|
|
|
"CONFIG+=no-bundled-opus"
|
|
|
|
"CONFIG+=no-bundled-speex"
|
2020-01-25 20:51:35 +00:00
|
|
|
"DEFINES+=PLUGIN_PATH=${placeholder "out"}/lib/mumble"
|
2021-02-22 07:25:35 +00:00
|
|
|
] ++ lib.optional (!speechdSupport) "CONFIG+=no-speechd"
|
|
|
|
++ lib.optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
|
2015-10-04 06:21:11 +01:00
|
|
|
++ (overrides.configureFlags or [ ]);
|
|
|
|
|
2016-04-17 00:38:29 +01:00
|
|
|
preConfigure = ''
|
2017-03-31 21:11:16 +01:00
|
|
|
patchShebangs scripts
|
2015-10-04 06:21:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "release" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-07-31 22:12:51 +01:00
|
|
|
runHook preInstall
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2019-07-31 22:12:51 +01:00
|
|
|
${overrides.installPhase}
|
|
|
|
|
|
|
|
# doc stuff
|
2015-10-04 06:21:11 +01:00
|
|
|
mkdir -p $out/share/man/man1
|
2019-07-31 22:12:51 +01:00
|
|
|
install -Dm644 man/mum* $out/share/man/man1/
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2020-04-16 08:21:21 +01:00
|
|
|
passthru.tests.connectivity = nixosTests.mumble;
|
|
|
|
|
2021-02-22 07:25:35 +00:00
|
|
|
meta = with lib; {
|
2015-10-04 06:21:11 +01:00
|
|
|
description = "Low-latency, high quality voice chat software";
|
2019-12-09 12:18:39 +00:00
|
|
|
homepage = "https://mumble.info";
|
2015-10-04 06:21:11 +01:00
|
|
|
license = licenses.bsd3;
|
2020-01-25 21:05:14 +00:00
|
|
|
maintainers = with maintainers; [ petabyteboy infinisil ];
|
2015-10-04 06:21:11 +01:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
client = source: generic {
|
|
|
|
type = "mumble";
|
|
|
|
|
2019-10-08 00:44:48 +01:00
|
|
|
nativeBuildInputs = [ qt5.qttools ];
|
2019-11-06 02:20:09 +00:00
|
|
|
buildInputs = [ libopus libsndfile speex qt5.qtsvg rnnoise ]
|
2021-06-10 03:57:09 +01:00
|
|
|
++ lib.optional stdenv.isLinux alsa-lib
|
2021-02-22 07:25:35 +00:00
|
|
|
++ lib.optional jackSupport libjack2
|
|
|
|
++ lib.optional speechdSupport speechd
|
|
|
|
++ lib.optional pulseSupport libpulseaudio;
|
2015-10-04 06:21:11 +01:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CONFIG+=no-server"
|
|
|
|
];
|
|
|
|
|
2021-02-22 07:25:35 +00:00
|
|
|
NIX_CFLAGS_COMPILE = lib.optional speechdSupport "-I${speechd}/include/speech-dispatcher";
|
2016-04-23 00:21:34 +01:00
|
|
|
|
2015-10-04 06:21:11 +01:00
|
|
|
installPhase = ''
|
2019-07-31 22:12:51 +01:00
|
|
|
# bin stuff
|
|
|
|
install -Dm755 release/mumble $out/bin/mumble
|
|
|
|
install -Dm755 scripts/mumble-overlay $out/bin/mumble-overlay
|
|
|
|
|
|
|
|
# lib stuff
|
|
|
|
mkdir -p $out/lib/mumble
|
|
|
|
cp -P release/libmumble.so* $out/lib
|
|
|
|
cp -P release/libcelt* $out/lib/mumble
|
|
|
|
cp -P release/plugins/* $out/lib/mumble
|
|
|
|
|
|
|
|
# icons
|
|
|
|
install -Dm644 scripts/mumble.desktop $out/share/applications/mumble.desktop
|
|
|
|
install -Dm644 icons/mumble.svg $out/share/icons/hicolor/scalable/apps/mumble.svg
|
2015-10-04 06:21:11 +01:00
|
|
|
'';
|
|
|
|
} source;
|
|
|
|
|
2019-09-14 09:49:38 +01:00
|
|
|
server = source: generic {
|
2015-10-04 06:21:11 +01:00
|
|
|
type = "murmur";
|
|
|
|
|
2021-02-22 07:25:35 +00:00
|
|
|
postPatch = lib.optional iceSupport ''
|
2019-09-14 09:49:38 +01:00
|
|
|
grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
|
2015-10-04 06:21:11 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CONFIG+=no-client"
|
2021-02-22 07:25:35 +00:00
|
|
|
] ++ lib.optional (!iceSupport) "CONFIG+=no-ice"
|
|
|
|
++ lib.optional grpcSupport "CONFIG+=grpc";
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2020-08-28 21:11:27 +01:00
|
|
|
buildInputs = [ libcap ]
|
2021-02-22 07:25:35 +00:00
|
|
|
++ lib.optional iceSupport zeroc-ice
|
2021-03-13 23:15:33 +00:00
|
|
|
++ lib.optionals grpcSupport [ grpc which ];
|
2019-07-31 22:12:51 +01:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# bin stuff
|
|
|
|
install -Dm755 release/murmurd $out/bin/murmurd
|
|
|
|
'';
|
2019-09-06 17:09:28 +01:00
|
|
|
} source;
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2019-09-14 09:49:38 +01:00
|
|
|
source = rec {
|
2021-02-10 06:26:54 +00:00
|
|
|
version = "1.3.4";
|
2015-10-04 06:21:11 +01:00
|
|
|
|
2016-04-23 00:22:03 +01:00
|
|
|
# Needs submodules
|
2018-07-07 16:53:35 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mumble-voip";
|
|
|
|
repo = "mumble";
|
2019-07-31 22:12:51 +01:00
|
|
|
rev = version;
|
2021-02-10 08:44:47 +00:00
|
|
|
sha256 = "sha256-njovShQpW0JNeeE8VugdmGzDk3fKG8/fcJoBgdyTZug=";
|
2018-07-07 16:53:35 +01:00
|
|
|
fetchSubmodules = true;
|
2015-10-04 06:21:11 +01:00
|
|
|
};
|
2011-02-10 19:23:27 +00:00
|
|
|
};
|
2015-10-04 06:21:11 +01:00
|
|
|
in {
|
2019-09-14 09:49:38 +01:00
|
|
|
mumble = client source;
|
|
|
|
murmur = server source;
|
2011-02-10 19:23:27 +00:00
|
|
|
}
|