nixpkgs/pkgs/applications/networking/mumble/default.nix
aszlig b3970e7f5c
mumble: Fix build with boost version 1.66
This is already tracked in upstream issue mumble-voip/mumble#3281 and a
fix has been merged in mumble-voip/mumble@caa187373e.

The patch I'm adding here is using the merged commit
mumble-voip/mumble@ea861fe867 and I've
only added it for the stable release because the patch is already
included in the git version.

@pbogdan also had a similar commit to this
(pbogdan/nixpkgs@8029edea29), but the
patch was applied to both stable and git and thus the git version would
have been broken.

Tested by building mumble and mumble_git and running the mumble NixOS VM
test.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @viric, @jgeerds, @abbradar
Fixes: #33655
2018-01-31 17:39:01 +01:00

147 lines
4.5 KiB
Nix

{ stdenv, fetchurl, fetchgit, fetchpatch, pkgconfig
, qt4, qmake4Hook, qt5, avahi, boost, libopus, libsndfile, protobuf, speex, libcap
, alsaLib, python
, jackSupport ? false, libjack2 ? null
, speechdSupport ? false, speechd ? null
, pulseSupport ? false, libpulseaudio ? null
, iceSupport ? false, zeroc_ice ? null
}:
assert jackSupport -> libjack2 != null;
assert speechdSupport -> speechd != null;
assert pulseSupport -> libpulseaudio != null;
assert iceSupport -> zeroc_ice != null;
with stdenv.lib;
let
generic = overrides: source: stdenv.mkDerivation (source // overrides // {
name = "${overrides.type}-${source.version}";
patches = (source.patches or []) ++ optional jackSupport ./mumble-jack-support.patch;
nativeBuildInputs = [ pkgconfig python ]
++ { qt4 = [ qmake4Hook ]; qt5 = [ qt5.qmake ]; }."qt${toString source.qtVersion}"
++ (overrides.nativeBuildInputs or [ ]);
buildInputs = [ boost protobuf avahi ]
++ { qt4 = [ qt4 ]; qt5 = [ qt5.qtbase ]; }."qt${toString source.qtVersion}"
++ (overrides.buildInputs or [ ]);
qmakeFlags = [
"CONFIG+=shared"
"CONFIG+=no-g15"
"CONFIG+=packaged"
"CONFIG+=no-update"
"CONFIG+=no-embed-qt-translations"
"CONFIG+=bundled-celt"
"CONFIG+=no-bundled-opus"
"CONFIG+=no-bundled-speex"
] ++ optional (!speechdSupport) "CONFIG+=no-speechd"
++ optional jackSupport "CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio"
++ optional (!iceSupport) "CONFIG+=no-ice"
++ (overrides.configureFlags or [ ]);
preConfigure = ''
qmakeFlags="$qmakeFlags DEFINES+=PLUGIN_PATH=$out/lib"
patchShebangs scripts
'';
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 "");
enableParallelBuilding = true;
meta = {
description = "Low-latency, high quality voice chat software";
homepage = https://mumble.info;
license = licenses.bsd3;
maintainers = with maintainers; [ viric jgeerds wkennington ];
platforms = platforms.linux;
};
});
client = source: generic {
type = "mumble";
nativeBuildInputs = optionals (source.qtVersion == 5) [ qt5.qttools ];
buildInputs = [ libopus libsndfile speex ]
++ optional (source.qtVersion == 5) qt5.qtsvg
++ optional stdenv.isLinux alsaLib
++ optional jackSupport libjack2
++ optional speechdSupport speechd
++ optional pulseSupport libpulseaudio;
configureFlags = [
"CONFIG+=no-server"
];
NIX_CFLAGS_COMPILE = optional speechdSupport "-I${speechd}/include/speech-dispatcher";
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/icons/mumble.svg $out/share/icons/hicolor/scalable/apps
'';
} source;
server = generic {
type = "murmur";
postPatch = optional iceSupport ''
grep -Rl '/usr/share/Ice' . | xargs sed -i 's,/usr/share/Ice/,${zeroc_ice}/,g'
'';
configureFlags = [
"CONFIG+=no-client"
];
buildInputs = [ libcap ] ++ optional iceSupport zeroc_ice;
};
stableSource = rec {
version = "1.2.19";
qtVersion = 4;
src = fetchurl {
url = "https://github.com/mumble-voip/mumble/releases/download/${version}/mumble-${version}.tar.gz";
sha256 = "1s60vaici3v034jzzi20x23hsj6mkjlc0glipjq4hffrg9qgnizh";
};
# Fix compile error against boost 1.66 (#33655):
patches = singleton (fetchpatch {
url = "https://github.com/mumble-voip/mumble/commit/"
+ "ea861fe86743c8402bbad77d8d1dd9de8dce447e.patch";
sha256 = "1r50dc8dcl6jmbj4abhnay9div7y56kpmajzqd7ql0pm853agwbh";
});
};
gitSource = rec {
version = "2018-01-12";
qtVersion = 5;
# Needs submodules
src = fetchgit {
url = "https://github.com/mumble-voip/mumble";
rev = "e348e47f4af68eaa8e0f87d1d9fc28c5583e421e";
sha256 = "12z41qfaq6w3i4wcw8pvyb8wwwa8gs3ar5zx6aqx6yssc6513lr3";
};
};
in {
mumble = client stableSource;
mumble_git = client gitSource;
murmur = server stableSource;
murmur_git = (server gitSource).overrideAttrs (old: {
meta = old.meta // { broken = iceSupport; };
});
}