nixpkgs/pkgs/applications/networking/instant-messengers/zoom-us/default.nix

99 lines
2.6 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, system, makeWrapper, makeDesktopItem, autoPatchelfHook
# Dynamic libraries
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
, qtlocation, qtquickcontrols2, qtscript, qtwebchannel, qtwebengine
# Runtime
, libjpeg_turbo, pciutils, procps
, pulseaudioSupport ? true, libpulseaudio ? null
}:
assert pulseaudioSupport -> libpulseaudio != null;
let
inherit (stdenv.lib) concatStringsSep makeBinPath optional optionalString;
version = "2.2.128200.0702";
srcs = {
x86_64-linux = fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
sha256 = "0n9kyj94bj35gbpwiz4kq7hc8pwfqwnfqf003g4c8gx5pda3g56w";
};
};
in stdenv.mkDerivation {
name = "zoom-us-${version}";
src = srcs.${system};
nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
buildInputs = [
dbus glib libGL libX11 libXfixes libuuid libxcb qtbase qtdeclarative
qtlocation qtquickcontrols2 qtscript qtwebchannel qtwebengine
libjpeg_turbo pciutils procps
];
runtimeDependencies = optional pulseaudioSupport libpulseaudio;
# Don't remove runtimeDependencies from RPATH via patchelf --shrink-rpath
dontPatchELF = true;
installPhase =
let
files = concatStringsSep " " [
"*.pcm"
"*.png"
"ZXMPPROOT.cer"
"ZoomLauncher"
"config-dump.sh"
"qtdiag"
"timezones"
"translations"
"version.txt"
"zcacert.pem"
"zoom"
"zoom.sh"
"zoomlinux"
"zopen"
];
in ''
runHook preInstall
packagePath=$out/share/zoom-us
mkdir -p $packagePath $out/bin
cp -ar ${files} $packagePath
# TODO Patch this somehow; tries to dlopen './libturbojpeg.so' from cwd
ln -s $(readlink -e "${libjpeg_turbo.out}/lib/libturbojpeg.so") $packagePath/libturbojpeg.so
makeWrapper $packagePath/zoom $out/bin/zoom-us \
--prefix PATH : "${makeBinPath [ pciutils procps ]}" \
--set QSG_INFO 1 \
--run "cd $packagePath"
runHook postInstall
'';
2018-03-16 19:03:15 +00:00
postInstall = (makeDesktopItem {
name = "zoom-us";
exec = "$out/bin/zoom-us %U";
icon = "$out/share/zoom-us/application-x-zoom.png";
desktopName = "Zoom";
genericName = "Video Conference";
categories = "Network;Application;";
mimeType = "x-scheme-handler/zoommtg;";
}).buildCommand;
passthru.updateScript = ./update.sh;
meta = {
homepage = https://zoom.us/;
description = "zoom.us video conferencing application";
license = stdenv.lib.licenses.unfree;
platforms = builtins.attrNames srcs;
maintainers = with stdenv.lib.maintainers; [ danbst ];
};
}