2015-10-04 07:21:11 +02:00
|
|
|
{ stdenv, fetchurl, fetchgit, pkgconfig
|
2016-04-17 01:38:29 +02:00
|
|
|
, qt4, qmake4Hook, qt5, 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
|
2015-10-04 07:21:11 +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;
|
2015-10-04 07:21:11 +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
|
2015-10-04 07:21:11 +02:00
|
|
|
generic = overrides: source: stdenv.mkDerivation (source // overrides // {
|
|
|
|
name = "${overrides.type}-${source.version}";
|
|
|
|
|
|
|
|
patches = optional jackSupport ./mumble-jack-support.patch;
|
|
|
|
|
2017-03-31 22:11:16 +02:00
|
|
|
nativeBuildInputs = [ pkgconfig python ]
|
2017-06-02 17:40:19 +02:00
|
|
|
++ { qt4 = [ qmake4Hook ]; qt5 = [ qt5.qmake ]; }."qt${toString source.qtVersion}"
|
2015-10-04 07:21:11 +02:00
|
|
|
++ (overrides.nativeBuildInputs or [ ]);
|
|
|
|
buildInputs = [ boost protobuf avahi ]
|
2015-11-11 05:08:58 +01:00
|
|
|
++ { qt4 = [ qt4 ]; qt5 = [ qt5.qtbase ]; }."qt${toString source.qtVersion}"
|
2015-10-04 07:21:11 +02:00
|
|
|
++ (overrides.buildInputs or [ ]);
|
|
|
|
|
2016-04-17 01:38:29 +02:00
|
|
|
qmakeFlags = [
|
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"
|
2016-09-25 11:24:43 +02:00
|
|
|
++ optional (!iceSupport) "CONFIG+=no-ice"
|
2015-10-04 07:21:11 +02:00
|
|
|
++ (overrides.configureFlags or [ ]);
|
|
|
|
|
2016-04-17 01:38:29 +02:00
|
|
|
preConfigure = ''
|
|
|
|
qmakeFlags="$qmakeFlags DEFINES+=PLUGIN_PATH=$out/lib"
|
2017-03-31 22:11:16 +02:00
|
|
|
patchShebangs scripts
|
2015-10-04 07:21:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
makeFlags = [ "release" ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/{lib,bin}
|
|
|
|
find release -type f -not -name \*.\* -exec cp {} $out/bin \;
|
|
|
|
find release -type f -name \*.\* -exec cp {} $out/lib \;
|
|
|
|
|
|
|
|
mkdir -p $out/share/man/man1
|
|
|
|
cp man/mum* $out/share/man/man1
|
|
|
|
'' + (overrides.installPhase or "");
|
|
|
|
|
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;
|
|
|
|
maintainers = with maintainers; [ viric jgeerds wkennington ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
client = source: generic {
|
|
|
|
type = "mumble";
|
|
|
|
|
2017-05-17 21:26:11 +02:00
|
|
|
nativeBuildInputs = optionals (source.qtVersion == 5) [ qt5.qttools ];
|
2015-10-12 16:04:49 +02:00
|
|
|
buildInputs = [ libopus libsndfile speex ]
|
2015-11-11 05:08:58 +01:00
|
|
|
++ optional (source.qtVersion == 5) qt5.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 = ''
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp scripts/mumble.desktop $out/share/applications
|
|
|
|
|
|
|
|
mkdir -p $out/share/icons{,/hicolor/scalable/apps}
|
|
|
|
cp icons/mumble.svg $out/share/icons
|
|
|
|
ln -s $out/share/icon/mumble.svg $out/share/icons/hicolor/scalable/apps
|
|
|
|
'';
|
|
|
|
} source;
|
|
|
|
|
|
|
|
server = generic {
|
|
|
|
type = "murmur";
|
|
|
|
|
|
|
|
postPatch = optional iceSupport ''
|
2015-12-31 20:01:41 +01:00
|
|
|
grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc_ice}/,g'
|
2015-10-04 07:21:11 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"CONFIG+=no-client"
|
|
|
|
];
|
|
|
|
|
2016-10-01 22:38:06 +02:00
|
|
|
buildInputs = [ libcap ] ++ optional iceSupport zeroc_ice;
|
2015-10-04 07:21:11 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
stableSource = rec {
|
2017-02-23 23:28:06 +01:00
|
|
|
version = "1.2.19";
|
2015-10-04 07:21:11 +02:00
|
|
|
qtVersion = 4;
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mumble-voip/mumble/releases/download/${version}/mumble-${version}.tar.gz";
|
2017-02-23 23:28:06 +01:00
|
|
|
sha256 = "1s60vaici3v034jzzi20x23hsj6mkjlc0glipjq4hffrg9qgnizh";
|
2015-10-04 07:21:11 +02:00
|
|
|
};
|
2011-02-10 20:23:27 +01:00
|
|
|
};
|
|
|
|
|
2015-10-04 07:21:11 +02:00
|
|
|
gitSource = rec {
|
2017-05-28 13:04:21 +02:00
|
|
|
version = "2017-05-25";
|
2015-10-04 07:21:11 +02:00
|
|
|
qtVersion = 5;
|
|
|
|
|
2016-04-23 01:22:03 +02:00
|
|
|
# Needs submodules
|
2015-10-04 07:21:11 +02:00
|
|
|
src = fetchgit {
|
|
|
|
url = "https://github.com/mumble-voip/mumble";
|
2017-05-28 13:04:21 +02:00
|
|
|
rev = "3754898ac94ed3f1e86408114917d1b4c06f17b3";
|
|
|
|
sha256 = "1qh49x3y7m0c0h0gcs6amkf8nb75p6g611zwn19mbplwmi7h9y8f";
|
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 {
|
|
|
|
mumble = client stableSource;
|
|
|
|
mumble_git = client gitSource;
|
|
|
|
murmur = server stableSource;
|
2017-03-30 15:42:26 +02:00
|
|
|
murmur_git = (server gitSource).overrideAttrs (old: {
|
2017-05-01 10:44:47 +02:00
|
|
|
meta = old.meta // { broken = iceSupport; };
|
2017-03-30 15:42:26 +02:00
|
|
|
});
|
2011-02-10 20:23:27 +01:00
|
|
|
}
|