2019-12-19 18:49:06 +00:00
|
|
|
{ stdenv, fetchurl, mkDerivation, autoPatchelfHook, bash
|
2019-08-01 02:32:54 +01:00
|
|
|
, fetchFromGitHub
|
2018-07-05 21:42:44 +01:00
|
|
|
# Dynamic libraries
|
|
|
|
, dbus, glib, libGL, libX11, libXfixes, libuuid, libxcb, qtbase, qtdeclarative
|
2020-03-01 18:55:17 +00:00
|
|
|
, qtgraphicaleffects, qtimageformats, qtlocation, qtquickcontrols
|
|
|
|
, qtquickcontrols2, qtscript, qtsvg , qttools, qtwayland, qtwebchannel
|
|
|
|
, qtwebengine
|
2018-07-05 21:42:44 +01:00
|
|
|
# Runtime
|
2020-02-14 14:16:02 +00:00
|
|
|
, coreutils, libjpeg_turbo, pciutils, procps, utillinux
|
2018-07-05 21:42:44 +01:00
|
|
|
, pulseaudioSupport ? true, libpulseaudio ? null
|
2018-06-30 18:03:17 +01:00
|
|
|
}:
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2018-07-05 21:42:44 +01:00
|
|
|
assert pulseaudioSupport -> libpulseaudio != null;
|
|
|
|
|
2017-06-07 10:01:01 +01:00
|
|
|
let
|
2018-07-20 20:36:12 +01:00
|
|
|
inherit (stdenv.lib) concatStringsSep makeBinPath optional;
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2020-07-07 12:58:17 +01:00
|
|
|
version = "5.1.422789.0705";
|
2017-06-07 10:01:01 +01:00
|
|
|
srcs = {
|
|
|
|
x86_64-linux = fetchurl {
|
|
|
|
url = "https://zoom.us/client/${version}/zoom_x86_64.tar.xz";
|
2020-07-07 12:58:17 +01:00
|
|
|
sha256 = "1sc454xadxsbxxyb68qi7ac20yq0vymzzw1i07z19c9idfpjy75f";
|
2017-06-07 10:01:01 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2019-08-01 02:32:19 +01:00
|
|
|
# Used for icons, appdata, and desktop file.
|
|
|
|
desktopIntegration = fetchFromGitHub {
|
|
|
|
owner = "flathub";
|
|
|
|
repo = "us.zoom.Zoom";
|
|
|
|
rev = "0d294e1fdd2a4ef4e05d414bc680511f24d835d7";
|
|
|
|
sha256 = "0rm188844a10v8d6zgl2pnwsliwknawj09b02iabrvjw5w1lp6wl";
|
|
|
|
};
|
|
|
|
|
2019-07-29 21:34:40 +01:00
|
|
|
in mkDerivation {
|
2019-08-13 22:52:01 +01:00
|
|
|
pname = "zoom-us";
|
|
|
|
inherit version;
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2018-08-20 20:11:29 +01:00
|
|
|
src = srcs.${stdenv.hostPlatform.system};
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2019-08-01 02:32:54 +01:00
|
|
|
nativeBuildInputs = [ autoPatchelfHook ];
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2018-06-30 18:03:17 +01:00
|
|
|
buildInputs = [
|
2020-03-01 18:55:17 +00:00
|
|
|
dbus glib libGL libX11 libXfixes libuuid libxcb libjpeg_turbo qtbase
|
|
|
|
qtdeclarative qtgraphicaleffects qtlocation qtquickcontrols qtquickcontrols2
|
|
|
|
qtscript qtwebchannel qtwebengine qtimageformats qtsvg qttools qtwayland
|
2019-07-29 21:34:40 +01:00
|
|
|
];
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2018-07-05 21:42:44 +01:00
|
|
|
runtimeDependencies = optional pulseaudioSupport libpulseaudio;
|
|
|
|
|
2018-06-30 18:03:17 +01:00
|
|
|
installPhase =
|
|
|
|
let
|
2018-07-05 21:42:44 +01:00
|
|
|
files = concatStringsSep " " [
|
2018-06-30 18:03:17 +01:00
|
|
|
"*.pcm"
|
|
|
|
"*.png"
|
|
|
|
"ZoomLauncher"
|
|
|
|
"config-dump.sh"
|
|
|
|
"timezones"
|
|
|
|
"translations"
|
|
|
|
"version.txt"
|
|
|
|
"zcacert.pem"
|
|
|
|
"zoom"
|
|
|
|
"zoom.sh"
|
|
|
|
"zopen"
|
|
|
|
];
|
|
|
|
in ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2019-07-29 21:34:40 +01:00
|
|
|
mkdir -p $out/{bin,share/zoom-us}
|
2018-06-30 18:03:17 +01:00
|
|
|
|
2019-07-29 21:34:40 +01:00
|
|
|
cp -ar ${files} $out/share/zoom-us
|
2018-06-30 18:03:17 +01:00
|
|
|
|
2018-07-05 21:42:44 +01:00
|
|
|
# TODO Patch this somehow; tries to dlopen './libturbojpeg.so' from cwd
|
2019-07-29 21:34:40 +01:00
|
|
|
ln -s $(readlink -e "${libjpeg_turbo.out}/lib/libturbojpeg.so") $out/share/zoom-us/libturbojpeg.so
|
2018-06-30 18:03:17 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2017-06-07 10:01:01 +01:00
|
|
|
|
2019-08-01 02:32:19 +01:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/share/{applications,appdata,icons}
|
|
|
|
|
|
|
|
# Desktop File
|
|
|
|
cp ${desktopIntegration}/us.zoom.Zoom.desktop $out/share/applications
|
|
|
|
substituteInPlace $out/share/applications/us.zoom.Zoom.desktop \
|
|
|
|
--replace "Exec=zoom" "Exec=$out/bin/zoom-us"
|
|
|
|
|
|
|
|
# Appdata
|
|
|
|
cp ${desktopIntegration}/us.zoom.Zoom.appdata.xml $out/share/appdata
|
|
|
|
|
|
|
|
# Icons
|
|
|
|
for icon_size in 64 96 128 256; do
|
|
|
|
path=$icon_size'x'$icon_size
|
|
|
|
icon=${desktopIntegration}/us.zoom.Zoom.$icon_size.png
|
|
|
|
|
|
|
|
mkdir -p $out/share/icons/hicolor/$path/apps
|
|
|
|
cp $icon $out/share/icons/hicolor/$path/apps/us.zoom.Zoom.png
|
|
|
|
done
|
2019-07-29 21:34:40 +01:00
|
|
|
'';
|
|
|
|
|
2019-12-19 18:49:06 +00:00
|
|
|
# $out/share/zoom-us isn't in auto-wrap directories list, need manual wrapping
|
|
|
|
dontWrapQtApps = true;
|
|
|
|
|
2019-07-29 21:34:40 +01:00
|
|
|
qtWrapperArgs = [
|
|
|
|
''--prefix PATH : ${makeBinPath [ coreutils glib.dev pciutils procps qttools.dev utillinux ]}''
|
2019-12-19 18:49:06 +00:00
|
|
|
# --run "cd ${placeholder "out"}/share/zoom-us"
|
|
|
|
# ^^ unfortunately, breaks run arg into multiple array elements, due to
|
|
|
|
# some bad array propagation. We'll do that in bash below
|
2019-07-29 21:34:40 +01:00
|
|
|
];
|
2018-03-16 19:03:15 +00:00
|
|
|
|
2019-12-19 18:49:06 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Zoom expects "zopen" executable (needed for web login) to be present in CWD. Or does it expect
|
|
|
|
# everybody runs Zoom only after cd to Zoom package directory? Anyway, :facepalm:
|
|
|
|
qtWrapperArgs+=( --run "cd ${placeholder "out"}/share/zoom-us" )
|
|
|
|
|
|
|
|
for app in ZoomLauncher zopen zoom; do
|
|
|
|
wrapQtApp $out/share/zoom-us/$app
|
|
|
|
done
|
|
|
|
|
|
|
|
ln -s $out/share/zoom-us/ZoomLauncher $out/bin/zoom-us
|
|
|
|
'';
|
|
|
|
|
2018-06-30 18:03:17 +01:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2017-06-07 10:01:01 +01:00
|
|
|
meta = {
|
2019-12-19 18:49:06 +00:00
|
|
|
homepage = "https://zoom.us/";
|
2017-06-07 10:01:01 +01:00
|
|
|
description = "zoom.us video conferencing application";
|
|
|
|
license = stdenv.lib.licenses.unfree;
|
2017-08-03 04:53:46 +01:00
|
|
|
platforms = builtins.attrNames srcs;
|
2020-06-18 06:41:56 +01:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ danbst tadfisher doronbehar ];
|
2017-06-07 10:01:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|