39 , pulseaudioSupport ? true
45 inherit (stdenv.hostPlatform) system;
46 throwSystem = throw "Unsupported system: ${system}";
48 # Zoom versions are released at different times for each platform
49 # and often with different versions. We write them on three lines
50 # like this (rather than using {}) so that the updater script can
51 # find where to edit them.
52 versions.aarch64-darwin = "6.2.3.40682";
53 versions.x86_64-darwin = "6.2.3.40682";
54 versions.x86_64-linux = "6.2.3.2056";
57 aarch64-darwin = fetchurl {
58 url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64";
59 name = "zoomusInstallerFull.pkg";
60 hash = "sha256-kpncl6ZVs/O2TXtBhZ/2049jJuUdYlIaxtLX3wIfpVE=";
62 x86_64-darwin = fetchurl {
63 url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg";
64 hash = "sha256-gB8pM3EYmA5jF2s/XobV5hk71q16x76nG6M20rWatzE=";
66 x86_64-linux = fetchurl {
67 url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz";
68 hash = "sha256-dEQdyYEGXMwABulPHK3fLgHo0ZMF5BT6RnqzD23Al38=";
72 libs = lib.makeLibraryPath ([
73 # $ LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$PWD ldd zoom | grep 'not found'
107 xorg.xcbutilrenderutil
114 ] ++ lib.optional (pulseaudioSupport) libpulseaudio);
116 binPath = lib.makeBinPath ([ coreutils glib.dev pciutils procps util-linux ] ++ lib.optional pulseaudioSupport pulseaudio);
118 stdenv.mkDerivation rec {
120 version = versions.${system} or throwSystem;
122 src = srcs.${system} or throwSystem;
124 dontUnpack = stdenv.hostPlatform.isLinux;
125 unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
127 zcat < zoomus.pkg/Payload | cpio -i
130 nativeBuildInputs = [
133 ++ lib.optionals stdenv.hostPlatform.isDarwin [
142 mkdir -p $out/Applications
143 cp -R zoom.us.app $out/Applications/
145 # darwin steps same on both architectures
146 x86_64-darwin = aarch64-darwin;
152 }.${system} or throwSystem}
156 postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
157 makeWrapper $out/Applications/zoom.us.app/Contents/MacOS/zoom.us $out/bin/zoom
158 '' + lib.optionalString stdenv.hostPlatform.isLinux ''
160 substituteInPlace $out/share/applications/Zoom.desktop \
161 --replace-fail "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom"
163 for i in aomhost zopen zoom ZoomLauncher ZoomWebviewHost; do
164 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/$i
167 # ZoomLauncher sets LD_LIBRARY_PATH before execing zoom
168 # IPC breaks if the executable name does not end in 'zoom'
169 mv $out/opt/zoom/zoom $out/opt/zoom/.zoom
170 makeWrapper $out/opt/zoom/.zoom $out/opt/zoom/zoom \
171 --prefix LD_LIBRARY_PATH ":" ${libs}
174 # Zoom expects "zopen" executable (needed for web login) to be present in CWD. Or does it expect
175 # everybody runs Zoom only after cd to Zoom package directory? Anyway, :facepalm:
176 # Clear Qt paths to prevent tripping over "foreign" Qt resources.
177 # Clear Qt screen scaling settings to prevent over-scaling.
178 makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \
179 --chdir "$out/opt/zoom" \
180 --unset QML2_IMPORT_PATH \
181 --unset QT_PLUGIN_PATH \
182 --unset QT_SCREEN_SCALE_FACTORS \
183 --prefix PATH : ${binPath} \
184 --prefix LD_LIBRARY_PATH ":" ${libs}
186 wrapProgram $out/opt/zoom/ZoomWebviewHost \
187 --unset QML2_IMPORT_PATH \
188 --unset QT_PLUGIN_PATH \
189 --unset QT_SCREEN_SCALE_FACTORS \
190 --prefix LD_LIBRARY_PATH ":" ${libs}
192 # Backwards compatibility: we used to call it zoom-us
193 ln -s $out/bin/{zoom,zoom-us}
199 passthru.updateScript = ./update.sh;
202 homepage = "https://zoom.us/";
203 changelog = "https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0061222";
204 description = "zoom.us video conferencing application";
205 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
206 license = licenses.unfree;
207 platforms = builtins.attrNames srcs;
208 maintainers = with maintainers; [ danbst tadfisher ];
209 mainProgram = "zoom";