2021-01-16 15:13:18 +03:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
2022-07-01 19:36:34 +03:00
|
|
|
, pipewire
|
2021-01-16 15:13:18 +03:00
|
|
|
, makeWrapper
|
2022-04-05 02:42:04 +03:00
|
|
|
, xar
|
|
|
|
, cpio
|
2021-08-05 16:33:44 +03:00
|
|
|
# Dynamic libraries
|
2021-06-10 05:57:09 +03:00
|
|
|
, alsa-lib
|
2021-01-16 15:13:18 +03:00
|
|
|
, atk
|
2022-03-28 17:17:59 +03:00
|
|
|
, at-spi2-atk
|
|
|
|
, at-spi2-core
|
2021-01-16 15:13:18 +03:00
|
|
|
, cairo
|
2022-03-28 17:17:59 +03:00
|
|
|
, cups
|
2021-01-16 15:13:18 +03:00
|
|
|
, dbus
|
2022-03-28 17:17:59 +03:00
|
|
|
, expat
|
|
|
|
, libdrm
|
2021-01-16 15:13:18 +03:00
|
|
|
, libGL
|
|
|
|
, fontconfig
|
|
|
|
, freetype
|
|
|
|
, gtk3
|
|
|
|
, gdk-pixbuf
|
|
|
|
, glib
|
2022-03-28 17:17:59 +03:00
|
|
|
, mesa
|
|
|
|
, nspr
|
|
|
|
, nss
|
2021-01-16 15:13:18 +03:00
|
|
|
, pango
|
|
|
|
, wayland
|
|
|
|
, xorg
|
|
|
|
, libxkbcommon
|
2022-04-04 22:00:40 +03:00
|
|
|
, udev
|
2021-01-16 15:13:18 +03:00
|
|
|
, zlib
|
2023-01-27 00:55:19 +03:00
|
|
|
, libkrb5
|
2021-08-05 16:33:44 +03:00
|
|
|
# Runtime
|
2021-01-16 15:13:18 +03:00
|
|
|
, coreutils
|
|
|
|
, pciutils
|
|
|
|
, procps
|
|
|
|
, util-linux
|
2021-08-05 16:33:44 +03:00
|
|
|
, pulseaudioSupport ? true
|
|
|
|
, libpulseaudio
|
2018-06-30 20:03:17 +03:00
|
|
|
}:
|
2017-06-07 12:01:01 +03:00
|
|
|
|
|
|
|
let
|
2022-04-05 02:42:04 +03:00
|
|
|
inherit (stdenv.hostPlatform) system;
|
|
|
|
throwSystem = throw "Unsupported system: ${system}";
|
|
|
|
|
2022-03-25 05:38:23 +03:00
|
|
|
# Zoom versions are released at different times for each platform
|
2022-08-29 09:41:18 +03:00
|
|
|
# and often with different versions. We write them on three lines
|
|
|
|
# like this (rather than using {}) so that the updater script can
|
|
|
|
# find where to edit them.
|
2023-01-20 16:49:07 +03:00
|
|
|
versions.aarch64-darwin = "5.13.6.14918";
|
|
|
|
versions.x86_64-darwin = "5.13.6.14918";
|
|
|
|
versions.x86_64-linux = "5.13.5.431";
|
2022-04-05 02:42:04 +03:00
|
|
|
|
2017-06-07 12:01:01 +03:00
|
|
|
srcs = {
|
2022-04-05 02:42:04 +03:00
|
|
|
aarch64-darwin = fetchurl {
|
2022-08-29 09:41:18 +03:00
|
|
|
url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64";
|
|
|
|
name = "zoomusInstallerFull.pkg";
|
2023-01-20 16:49:07 +03:00
|
|
|
hash = "sha256-QY9z1bTKtL32HE4XWnBIvCNmDF+3x5N9BdfqJA+24fA=";
|
2022-04-05 02:42:04 +03:00
|
|
|
};
|
|
|
|
x86_64-darwin = fetchurl {
|
2022-08-29 09:41:18 +03:00
|
|
|
url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg";
|
2023-01-20 16:49:07 +03:00
|
|
|
hash = "sha256-eSPKzxDPXCbME0eTTDlfsI5KM5qRm79JTtnGJvpiS98=";
|
2022-04-05 02:42:04 +03:00
|
|
|
};
|
2017-06-07 12:01:01 +03:00
|
|
|
x86_64-linux = fetchurl {
|
2022-08-29 09:41:18 +03:00
|
|
|
url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz";
|
2023-01-20 16:49:07 +03:00
|
|
|
hash = "sha256-R0IMV/+R7AGFy/ZvNyyvIBv10t1x1U1X6jdHoo6UHKY=";
|
2017-06-07 12:01:01 +03:00
|
|
|
};
|
|
|
|
};
|
2021-01-16 15:13:18 +03:00
|
|
|
|
|
|
|
libs = lib.makeLibraryPath ([
|
|
|
|
# $ LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$PWD ldd zoom | grep 'not found'
|
2021-06-10 05:57:09 +03:00
|
|
|
alsa-lib
|
2021-01-16 15:13:18 +03:00
|
|
|
atk
|
2022-03-28 17:17:59 +03:00
|
|
|
at-spi2-atk
|
|
|
|
at-spi2-core
|
2021-01-16 15:13:18 +03:00
|
|
|
cairo
|
2022-03-28 17:17:59 +03:00
|
|
|
cups
|
2021-01-16 15:13:18 +03:00
|
|
|
dbus
|
2022-03-28 17:17:59 +03:00
|
|
|
expat
|
|
|
|
libdrm
|
2021-01-16 15:13:18 +03:00
|
|
|
libGL
|
2022-07-01 19:36:34 +03:00
|
|
|
pipewire
|
2021-01-16 15:13:18 +03:00
|
|
|
fontconfig
|
|
|
|
freetype
|
|
|
|
gtk3
|
|
|
|
gdk-pixbuf
|
|
|
|
glib
|
2022-03-28 17:17:59 +03:00
|
|
|
mesa
|
|
|
|
nspr
|
|
|
|
nss
|
2021-01-16 15:13:18 +03:00
|
|
|
pango
|
|
|
|
stdenv.cc.cc
|
|
|
|
wayland
|
|
|
|
xorg.libX11
|
|
|
|
xorg.libxcb
|
|
|
|
xorg.libXcomposite
|
2022-03-28 17:17:59 +03:00
|
|
|
xorg.libXdamage
|
2021-01-16 15:13:18 +03:00
|
|
|
xorg.libXext
|
|
|
|
libxkbcommon
|
2022-03-28 17:17:59 +03:00
|
|
|
xorg.libXrandr
|
2021-01-16 15:13:18 +03:00
|
|
|
xorg.libXrender
|
2022-03-28 17:17:59 +03:00
|
|
|
xorg.libxshmfence
|
2021-01-16 15:13:18 +03:00
|
|
|
xorg.xcbutilimage
|
|
|
|
xorg.xcbutilkeysyms
|
2023-01-27 00:55:19 +03:00
|
|
|
xorg.xcbutilrenderutil
|
|
|
|
xorg.xcbutilwm
|
2021-01-16 15:13:18 +03:00
|
|
|
xorg.libXfixes
|
|
|
|
xorg.libXtst
|
2022-04-04 22:00:40 +03:00
|
|
|
udev
|
|
|
|
zlib
|
2023-01-27 00:55:19 +03:00
|
|
|
libkrb5
|
2021-01-16 15:13:18 +03:00
|
|
|
] ++ lib.optional (pulseaudioSupport) libpulseaudio);
|
|
|
|
|
2021-08-05 16:33:44 +03:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2021-03-04 14:40:17 +03:00
|
|
|
pname = "zoom";
|
2022-08-29 09:41:18 +03:00
|
|
|
version = versions.${system} or throwSystem;
|
2021-08-05 16:33:44 +03:00
|
|
|
|
2022-04-26 18:38:13 +03:00
|
|
|
src = srcs.${system} or throwSystem;
|
2021-01-16 15:13:18 +03:00
|
|
|
|
2022-04-26 18:34:44 +03:00
|
|
|
dontUnpack = stdenv.isLinux;
|
2022-04-05 02:42:04 +03:00
|
|
|
unpackPhase = lib.optionalString stdenv.isDarwin ''
|
|
|
|
xar -xf $src
|
|
|
|
zcat < zoomus.pkg/Payload | cpio -i
|
|
|
|
'';
|
2021-04-22 19:32:52 +03:00
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
2022-04-05 02:42:04 +03:00
|
|
|
]
|
|
|
|
++ lib.optionals stdenv.isDarwin [
|
|
|
|
xar
|
|
|
|
cpio
|
2019-07-29 23:34:40 +03:00
|
|
|
];
|
2017-06-07 12:01:01 +03:00
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-04-25 21:13:04 +03:00
|
|
|
${rec {
|
|
|
|
aarch64-darwin = ''
|
2022-04-28 02:47:23 +03:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
cp -R zoom.us.app $out/Applications/
|
2022-04-25 21:13:04 +03:00
|
|
|
'';
|
|
|
|
# darwin steps same on both architectures
|
|
|
|
x86_64-darwin = aarch64-darwin;
|
|
|
|
x86_64-linux = ''
|
|
|
|
mkdir $out
|
|
|
|
tar -C $out -xf $src
|
|
|
|
mv $out/usr/* $out/
|
|
|
|
'';
|
2022-04-26 18:38:13 +03:00
|
|
|
}.${system} or throwSystem}
|
2021-01-16 15:13:18 +03:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
2019-08-01 04:32:19 +03:00
|
|
|
|
2022-04-05 02:42:04 +03:00
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
2019-08-01 04:32:19 +03:00
|
|
|
# Desktop File
|
2021-01-16 15:13:18 +03:00
|
|
|
substituteInPlace $out/share/applications/Zoom.desktop \
|
|
|
|
--replace "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom"
|
2019-08-01 04:32:19 +03:00
|
|
|
|
2022-08-29 02:28:00 +03:00
|
|
|
for i in aomhost zopen zoom ZoomLauncher; do
|
2021-01-16 15:13:18 +03:00
|
|
|
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/$i
|
2019-08-01 04:32:19 +03:00
|
|
|
done
|
2019-07-29 23:34:40 +03:00
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
# ZoomLauncher sets LD_LIBRARY_PATH before execing zoom
|
2022-05-16 20:32:31 +03:00
|
|
|
# IPC breaks if the executable name does not end in 'zoom'
|
|
|
|
mv $out/opt/zoom/zoom $out/opt/zoom/.zoom
|
|
|
|
makeWrapper $out/opt/zoom/.zoom $out/opt/zoom/zoom \
|
2021-01-16 15:13:18 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libs}
|
2019-12-19 21:49:06 +03:00
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
rm $out/bin/zoom
|
2019-12-19 21:49:06 +03:00
|
|
|
# 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:
|
2021-08-10 19:34:49 +03:00
|
|
|
# Clear Qt paths to prevent tripping over "foreign" Qt resources.
|
|
|
|
# Clear Qt screen scaling settings to prevent over-scaling.
|
2021-01-16 15:13:18 +03:00
|
|
|
makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \
|
2022-03-14 21:06:00 +03:00
|
|
|
--chdir "$out/opt/zoom" \
|
2021-03-15 00:38:37 +03:00
|
|
|
--unset QML2_IMPORT_PATH \
|
|
|
|
--unset QT_PLUGIN_PATH \
|
2021-08-10 19:34:49 +03:00
|
|
|
--unset QT_SCREEN_SCALE_FACTORS \
|
2021-03-15 21:41:52 +03:00
|
|
|
--prefix PATH : ${lib.makeBinPath [ coreutils glib.dev pciutils procps util-linux ]} \
|
2021-01-16 15:13:18 +03:00
|
|
|
--prefix LD_LIBRARY_PATH ":" ${libs}
|
2019-12-19 21:49:06 +03:00
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
# Backwards compatiblity: we used to call it zoom-us
|
|
|
|
ln -s $out/bin/{zoom,zoom-us}
|
2019-12-19 21:49:06 +03:00
|
|
|
'';
|
|
|
|
|
2021-01-16 15:13:18 +03:00
|
|
|
# already done
|
|
|
|
dontPatchELF = true;
|
|
|
|
|
2018-06-30 20:03:17 +03:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-08-05 16:33:44 +03:00
|
|
|
meta = with lib; {
|
2019-12-19 21:49:06 +03:00
|
|
|
homepage = "https://zoom.us/";
|
2017-06-07 12:01:01 +03:00
|
|
|
description = "zoom.us video conferencing application";
|
2022-06-05 01:19:25 +03:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2021-08-05 16:33:44 +03:00
|
|
|
license = licenses.unfree;
|
2017-08-03 06:53:46 +03:00
|
|
|
platforms = builtins.attrNames srcs;
|
2021-08-05 16:33:44 +03:00
|
|
|
maintainers = with maintainers; [ danbst tadfisher doronbehar ];
|
2017-06-07 12:01:01 +03:00
|
|
|
};
|
|
|
|
}
|