2019-09-14 10:49:38 +02:00
|
|
|
{ stdenv, fetchurl, fetchFromGitHub, fetchpatch, pkgconfig, mkDerivation
|
|
|
|
, qtbase, qttools, qtsvg, qmake, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
|
2017-03-31 22:11:16 +02:00
|
|
|
, alsaLib, python
|
2015-04-26 08:32:04 +02:00
|
|
|
, jackSupport ? false, libjack2 ? null
|
2015-04-08 13:49:23 +02:00
|
|
|
, speechdSupport ? false, speechd ? null
|
2015-04-26 08:32:04 +02:00
|
|
|
, pulseSupport ? false, libpulseaudio ? null
|
2019-09-14 10:49:38 +02:00
|
|
|
, iceSupport ? false, zeroc-ice ? null
|
2014-01-31 02:01:22 +01:00
|
|
|
}:
|
|
|
|
|
2015-04-26 08:32:04 +02:00
|
|
|
assert jackSupport -> libjack2 != null;
|
2014-01-31 02:01:22 +01:00
|
|
|
assert speechdSupport -> speechd != null;
|
2015-04-26 08:32:04 +02:00
|
|
|
assert pulseSupport -> libpulseaudio != null;
|
2019-09-14 10:49:38 +02:00
|
|
|
assert iceSupport -> zeroc-ice != null;
|
2014-01-31 02:01:22 +01:00
|
|
|
|
2015-10-04 07:21:11 +02:00
|
|
|
with stdenv.lib;
|
2014-01-31 02:01:22 +01:00
|
|
|
let
|
2019-09-14 10:49:38 +02:00
|
|
|
generic = overrides: source: mkDerivation (source // overrides // {
|
2015-10-04 07:21:11 +02:00
|
|
|
name = "${overrides.type}-${source.version}";
|
|
|
|
|
2018-01-31 16:41:15 +01:00
|
|
|
patches = (source.patches or []) ++ optional jackSupport ./mumble-jack-support.patch;
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig python qmake ]
|
2015-10-04 07:21:11 +02:00
|
|
|
++ (overrides.nativeBuildInputs or [ ]);
|
2019-04-22 23:48:14 +02:00
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
buildInputs = [ boost protobuf avahi ]
|
2015-10-04 07:21:11 +02:00
|
|
|
++ (overrides.buildInputs or [ ]);
|
|
|
|
|
2016-04-17 01:38:29 +02:00
|
|
|
qmakeFlags = [
|
2018-09-25 12:43:44 +02:00
|
|
|
"CONFIG+=c++11"
|
2015-10-04 07:21:11 +02:00
|
|
|
"CONFIG+=shared"
|
|
|
|
"CONFIG+=no-g15"
|
|
|
|
"CONFIG+=packaged"
|
|
|
|
"CONFIG+=no-update"
|
|
|
|
"CONFIG+=no-embed-qt-translations"
|
2015-10-12 16:04:49 +02:00
|
|
|
"CONFIG+=bundled-celt"
|
2015-10-04 07:21:11 +02:00
|
|
|
"CONFIG+=no-bundled-opus"
|
|
|
|
"CONFIG+=no-bundled-speex"
|
|
|
|
] ++ optional (!speechdSupport) "CONFIG+=no-speechd"
|
|
|
|
++ optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
|
|
|
|
++ (overrides.configureFlags or [ ]);
|
|
|
|
|
2016-04-17 01:38:29 +02:00
|
|
|
preConfigure = ''
|
2019-07-31 23:12:51 +02:00
|
|
|
qmakeFlags="$qmakeFlags DEFINES+=PLUGIN_PATH=$out/lib/mumble"
|
2017-03-31 22:11:16 +02:00
|
|
|
patchShebangs scripts
|
2015-10-04 07:21:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "release" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
2019-07-31 23:12:51 +02:00
|
|
|
runHook preInstall
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2019-07-31 23:12:51 +02:00
|
|
|
${overrides.installPhase}
|
|
|
|
|
|
|
|
# doc stuff
|
2015-10-04 07:21:11 +02:00
|
|
|
mkdir -p $out/share/man/man1
|
2019-07-31 23:12:51 +02:00
|
|
|
install -Dm644 man/mum* $out/share/man/man1/
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2016-01-03 01:30:32 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-10-04 07:21:11 +02:00
|
|
|
meta = {
|
|
|
|
description = "Low-latency, high quality voice chat software";
|
2017-09-04 01:48:44 +02:00
|
|
|
homepage = https://mumble.info;
|
2015-10-04 07:21:11 +02:00
|
|
|
license = licenses.bsd3;
|
2019-03-12 23:45:33 +01:00
|
|
|
maintainers = with maintainers; [ ];
|
2015-10-04 07:21:11 +02:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
client = source: generic {
|
|
|
|
type = "mumble";
|
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
nativeBuildInputs = [ qttools ];
|
|
|
|
buildInputs = [ libopus libsndfile speex qtsvg ]
|
2015-10-04 07:21:11 +02:00
|
|
|
++ optional stdenv.isLinux alsaLib
|
|
|
|
++ optional jackSupport libjack2
|
|
|
|
++ optional speechdSupport speechd
|
|
|
|
++ optional pulseSupport libpulseaudio;
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CONFIG+=no-server"
|
|
|
|
];
|
|
|
|
|
2016-04-23 01:21:34 +02:00
|
|
|
NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher";
|
|
|
|
|
2015-10-04 07:21:11 +02:00
|
|
|
installPhase = ''
|
2019-07-31 23:12:51 +02: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 07:21:11 +02:00
|
|
|
'';
|
|
|
|
} source;
|
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
server = source: generic {
|
2015-10-04 07:21:11 +02:00
|
|
|
type = "murmur";
|
|
|
|
|
|
|
|
postPatch = optional iceSupport ''
|
2019-09-14 10:49:38 +02:00
|
|
|
grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc-ice.dev}/share/ice/,g'
|
2015-10-04 07:21:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CONFIG+=no-client"
|
2019-09-06 18:09:28 +02:00
|
|
|
] ++ optional (!iceSupport) "CONFIG+=no-ice";
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
buildInputs = [ libcap ] ++ optional iceSupport zeroc-ice;
|
2019-07-31 23:12:51 +02:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
# bin stuff
|
|
|
|
install -Dm755 release/murmurd $out/bin/murmurd
|
|
|
|
'';
|
2019-09-06 18:09:28 +02:00
|
|
|
} source;
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2019-09-14 10:49:38 +02:00
|
|
|
source = rec {
|
|
|
|
version = "1.3.0";
|
2015-10-04 07:21:11 +02:00
|
|
|
|
2016-04-23 01:22:03 +02:00
|
|
|
# Needs submodules
|
2018-07-07 17:53:35 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "mumble-voip";
|
|
|
|
repo = "mumble";
|
2019-07-31 23:12:51 +02:00
|
|
|
rev = version;
|
2019-09-14 10:49:38 +02:00
|
|
|
sha256 = "0g5ri84gg0x3crhpxlzawf9s9l4hdna6aqw6qbdpx1hjlf5k6g8k";
|
2018-07-07 17:53:35 +02:00
|
|
|
fetchSubmodules = true;
|
2015-10-04 07:21:11 +02:00
|
|
|
};
|
2011-02-10 20:23:27 +01:00
|
|
|
};
|
2015-10-04 07:21:11 +02:00
|
|
|
in {
|
2019-09-14 10:49:38 +02:00
|
|
|
mumble = client source;
|
|
|
|
murmur = server source;
|
2011-02-10 20:23:27 +01:00
|
|
|
}
|