From fd940afc9d27fa77200d6b4a8a32a93dd2a22363 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 29 Mar 2025 15:32:34 +0100 Subject: [PATCH 01/12] zoom-us/test: capitalize comments per https://github.com/NixOS/nixpkgs/pull/381281#discussion_r1956512725 --- pkgs/by-name/zo/zoom-us/test.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/test.nix b/pkgs/by-name/zo/zoom-us/test.nix index 98ededc27563..ecfc2170f91c 100644 --- a/pkgs/by-name/zo/zoom-us/test.nix +++ b/pkgs/by-name/zo/zoom-us/test.nix @@ -22,7 +22,7 @@ let | tee window-names grep -q "Zoom Workplace" window-names } - # don't let zoom eat all RAM, like it did + # Don't let zoom eat all RAM, like it did, cf. # https://github.com/NixOS/nixpkgs/issues/371488 prlimit --{as,data}=$((4*2**30)):$((4*2**30)) zoom-us & for _ in {0..900} ; do @@ -31,8 +31,8 @@ let fi sleep 1 done - # if libraries are missing, the window still appears, - # but disappears again immediatelly; check for that too: + # If libraries are missing, the window still appears, + # but then disappears again immediately; check for that also. sleep 20 is_zoom_window_present ''; From ee0a80d8c3906bbd868733b798f8df17a31b001c Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:21:53 +0200 Subject: [PATCH 02/12] zoom-us: add Qt5 libraries required by vendored files Checking library dependencies with `autoPatchelfHook` uncovered some missing libraries that are required by vendored files. While zoom seems to work alright without those, adding them to the LD_LIBRARY_PATH seems to be The Right Thing and might avoid subtle bugs now or in the future. --- pkgs/by-name/zo/zoom-us/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index e6aedacd4ebd..ba68f895652a 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -26,6 +26,7 @@ nspr, nss, pango, + qt5, wayland, xorg, libxkbcommon, @@ -94,6 +95,12 @@ let nspr nss pango + qt5.qt3d + qt5.qtgamepad + qt5.qtlottie + qt5.qtmultimedia + qt5.qtremoteobjects + qt5.qtxmlpatterns stdenv.cc.cc wayland xorg.libX11 From e46fc400591b6e51b06686676e67fa7d28e9fb40 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Tue, 8 Apr 2025 09:29:32 +0200 Subject: [PATCH 03/12] zoom-us: use relative path in .desktop file https://github.com/NixOS/nixpkgs/issues/308324 https://github.com/NixOS/nixpkgs/pull/348601 --- pkgs/by-name/zo/zoom-us/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index ba68f895652a..63d685c61714 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -186,7 +186,7 @@ stdenv.mkDerivation { + lib.optionalString stdenv.hostPlatform.isLinux '' # Desktop File substituteInPlace $out/share/applications/Zoom.desktop \ - --replace-fail "Exec=/usr/bin/zoom" "Exec=$out/bin/zoom" + --replace-fail Exec={/usr/bin/,}zoom for i in aomhost zopen ZoomLauncher ZoomWebviewHost; do if [ -f $out/opt/zoom/$i ]; then From 69f185ed00bb132d3d9bb1d07f12196cbd4a636d Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:25:09 +0200 Subject: [PATCH 04/12] zoom-us: resolve `with lib;` in `meta` https://github.com/NixOS/nixpkgs/issues/371862 --- pkgs/by-name/zo/zoom-us/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 63d685c61714..3ed6ec71d213 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -237,14 +237,14 @@ stdenv.mkDerivation { passthru.updateScript = ./update.sh; passthru.tests.startwindow = callPackage ./test.nix { }; - meta = with lib; { + meta = { homepage = "https://zoom.us/"; changelog = "https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0061222"; description = "zoom.us video conferencing application"; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.unfree; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; platforms = builtins.attrNames srcs; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ danbst tadfisher ]; From a195cdd1f97966df8658c4c820956a04c4acb92a Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Mon, 7 Apr 2025 09:47:00 +0200 Subject: [PATCH 05/12] zoom-us: use `buildFHSEnv` for `x86_64-linux` While the currently packages Zoom version 6.3.11.7212 is still usabe without FHS environment, the newer version 6.4.1.587 isn't: The dynamic loader trick of commit 3f58227a38fa6f3931ef82541572123dc49958f6 can also be applied to `ZoomLauncher`, making it start again. However, `ZoomWebviewHost` won't work anymore: Apparently it also requires the dynamic loader trick; However, it tries to call itself, calling the dynamic loader, which then doesn't know what to do. The result is Zoom causing high CPU load while the main window is visible, as it endlessly tries to start `ZoomWebviewHost`, which is apparently needed to show the dashboard. The commit at hand wraps Zoom in a `buildFHSEnv`. This is the only possible way to ensure Zoom programs can be executed without altering them with patchelf or wrapping them. In detail: * The derivation that was created before this commit is still needed (also for linus system). It is now moved into a let-in variable (`unpacked`) so it can be used for darwin (still unchanged) and for linux (wrapped by FHS env). Linux-specific wrapping is removed as we now need the zoom directory structure unmodified, as packaged by Zoom. In particular, this removes the `postFixup` section, or rather, keeps only the darwin-specific part. This part of the commit's diff is likely best readable with `git diff --color-words=.`. * As a convenience for later updates, a comment is added that might help searching for missing library dependencies. * The lists of dependencies (`libs` and `binPath`) are merged into a function `linuxGetDependencies`. It is no longer meaningful to keep them separate as the FHS environment merges all those packages into on unified tree. It is also not always clear whether a package is used as "program" or a "library" (e.g. pipewire, or possibly `xdg-desktop-portal`). As required by `buildFHSEnv`, the function `linuxGetDependencies` is called with `pkgs` as its only argument and returns a list of packages that will be made available in the FHS environment. This mechanism is meant to facilitate multi-arch packages (e.g. i686 running on x86-64), so zoom should work alright (on x86_64-linux) if we ignore `pkgs` and just provide our packages as before; but there is no reason to deviate from the mechanism that is provided by `buildFHSEnv`. --- pkgs/by-name/zo/zoom-us/package.nix | 357 +++++++++++++--------------- 1 file changed, 161 insertions(+), 196 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 3ed6ec71d213..1b2b924c986b 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -2,46 +2,12 @@ stdenv, lib, fetchurl, - pipewire, makeWrapper, xar, cpio, - # Dynamic libraries - alsa-lib, - atk, - at-spi2-atk, - at-spi2-core, - cairo, - cups, - dbus, - expat, - libdrm, - libGL, - fontconfig, - freetype, - gtk3, - gdk-pixbuf, - glib, - libgbm, - nspr, - nss, - pango, - qt5, - wayland, - xorg, - libxkbcommon, - udev, - zlib, - libkrb5, - # Runtime - coreutils, - pciutils, - procps, - util-linux, pulseaudioSupport ? true, - libpulseaudio, - pulseaudio, callPackage, + buildFHSEnv, }: let @@ -72,182 +38,181 @@ let }; }; - libs = lib.makeLibraryPath ( - [ - # $ LD_LIBRARY_PATH=$NIX_LD_LIBRARY_PATH:$PWD ldd zoom | grep 'not found' - alsa-lib - atk - at-spi2-atk - at-spi2-core - cairo - cups - dbus - expat - libdrm - libGL - pipewire - fontconfig - freetype - gtk3 - gdk-pixbuf - glib - libgbm - nspr - nss - pango - qt5.qt3d - qt5.qtgamepad - qt5.qtlottie - qt5.qtmultimedia - qt5.qtremoteobjects - qt5.qtxmlpatterns - stdenv.cc.cc - wayland - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXdamage - xorg.libXext - libxkbcommon - xorg.libXrandr - xorg.libXrender - xorg.libxshmfence - xorg.xcbutilimage - xorg.xcbutilkeysyms - xorg.xcbutilrenderutil - xorg.xcbutilwm - xorg.libXfixes - xorg.libXtst - udev - zlib - libkrb5 - ] - ++ lib.optional (pulseaudioSupport) libpulseaudio - ); + unpacked = stdenv.mkDerivation { + pname = "zoom"; + version = versions.${system} or throwSystem; - binPath = lib.makeBinPath ( - [ - coreutils - glib.dev - pciutils - pipewire - procps - util-linux - ] - ++ lib.optional pulseaudioSupport pulseaudio - ); -in -stdenv.mkDerivation { - pname = "zoom"; - version = versions.${system} or throwSystem; + src = srcs.${system} or throwSystem; - src = srcs.${system} or throwSystem; + dontUnpack = stdenv.hostPlatform.isLinux; + unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' + xar -xf $src + zcat < zoomus.pkg/Payload | cpio -i + ''; - dontUnpack = stdenv.hostPlatform.isLinux; - unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' - xar -xf $src - zcat < zoomus.pkg/Payload | cpio -i - ''; - - nativeBuildInputs = - [ + # Note: In order to uncover missing libraries + # on x86_64-linux, add "pkgs" to this file's arguments + # (at the top of this file), then add these attributes here: + # > buildInputs = linuxGetDependencies pkgs; + # > dontAutoPatchelf = true; + # > dontWrapQtApps = true; + # > preFixup = '' + # > addAutoPatchelfSearchPath $out/opt/zoom + # > autoPatchelf $out/opt/zoom/{cef,Qt,*.so*,aomhost,zoom,zopen,ZoomLauncher,ZoomWebviewHost} + # > ''; + # ...and finally "pkgs.autoPatchelfHook" + # to `nativeBuildInputs` right below. + # Then build `zoom-us.unpacked`: + # `autoPatchelfHook` will report missing library files. + nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ makeWrapper - ] - ++ lib.optionals stdenv.hostPlatform.isDarwin [ xar cpio ]; - installPhase = '' - runHook preInstall - ${ - rec { - aarch64-darwin = '' - mkdir -p $out/Applications - cp -R zoom.us.app $out/Applications/ - ''; - # 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/ - ''; + installPhase = '' + runHook preInstall + ${ + rec { + aarch64-darwin = '' + mkdir -p $out/Applications + cp -R zoom.us.app $out/Applications/ + ''; + # 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/ + ''; + } + .${system} or throwSystem } - .${system} or throwSystem - } - runHook postInstall - ''; + runHook postInstall + ''; - postFixup = - lib.optionalString stdenv.hostPlatform.isDarwin '' + postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' makeWrapper $out/Applications/zoom.us.app/Contents/MacOS/zoom.us $out/bin/zoom - '' - + lib.optionalString stdenv.hostPlatform.isLinux '' - # Desktop File - substituteInPlace $out/share/applications/Zoom.desktop \ + ''; + + dontPatchELF = true; + + passthru.updateScript = ./update.sh; + passthru.tests.startwindow = callPackage ./test.nix { }; + + meta = { + homepage = "https://zoom.us/"; + changelog = "https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0061222"; + description = "zoom.us video conferencing application"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.unfree; + platforms = builtins.attrNames srcs; + maintainers = with lib.maintainers; [ + danbst + tadfisher + ]; + mainProgram = "zoom"; + }; + }; + packages.aarch64-darwin = unpacked; + packages.x86_64-darwin = unpacked; + + # linux definitions + + linuxGetDependencies = + pkgs: + [ + pkgs.alsa-lib + pkgs.at-spi2-atk + pkgs.at-spi2-core + pkgs.atk + pkgs.cairo + pkgs.coreutils + pkgs.cups + pkgs.dbus + pkgs.expat + pkgs.fontconfig + pkgs.freetype + pkgs.gdk-pixbuf + pkgs.glib + pkgs.glib.dev + pkgs.gtk3 + pkgs.libGL + pkgs.libdrm + pkgs.libgbm + pkgs.libkrb5 + pkgs.libxkbcommon + pkgs.nspr + pkgs.nss + pkgs.pango + pkgs.pciutils + pkgs.pipewire + pkgs.procps + pkgs.qt5.qt3d + pkgs.qt5.qtgamepad + pkgs.qt5.qtlottie + pkgs.qt5.qtmultimedia + pkgs.qt5.qtremoteobjects + pkgs.qt5.qtxmlpatterns + pkgs.stdenv.cc.cc + pkgs.udev + pkgs.util-linux + pkgs.wayland + pkgs.xorg.libX11 + pkgs.xorg.libXcomposite + pkgs.xorg.libXdamage + pkgs.xorg.libXext + pkgs.xorg.libXfixes + pkgs.xorg.libXrandr + pkgs.xorg.libXrender + pkgs.xorg.libXtst + pkgs.xorg.libxcb + pkgs.xorg.libxshmfence + pkgs.xorg.xcbutilimage + pkgs.xorg.xcbutilkeysyms + pkgs.xorg.xcbutilrenderutil + pkgs.xorg.xcbutilwm + pkgs.zlib + ] + ++ lib.optionals pulseaudioSupport [ + pkgs.libpulseaudio + pkgs.pulseaudio + ]; + + # We add the `unpacked` zoom archive to the FHS env + # and also bind-mount its `/opt` directory. + # This should assist Zoom in finding all its + # files in the places where it expects them to be. + packages.x86_64-linux = buildFHSEnv { + pname = "zoom"; # Will also be the program's name! + version = versions.${system} or throwSystem; + + targetPkgs = pkgs: (linuxGetDependencies pkgs) ++ [ unpacked ]; + extraPreBwrapCmds = '' + cd ${unpacked}/opt/zoom + unset QML2_IMPORT_PATH + unset QT_PLUGIN_PATH + unset QT_SCREEN_SCALE_FACTORS + ''; + extraBwrapArgs = [ "--ro-bind ${unpacked}/opt /opt" ]; + runScript = "/opt/zoom/ZoomLauncher"; + + extraInstallCommands = '' + cp -Rt $out/ ${unpacked}/share + substituteInPlace \ + $out/share/applications/Zoom.desktop \ --replace-fail Exec={/usr/bin/,}zoom - for i in aomhost zopen ZoomLauncher ZoomWebviewHost; do - if [ -f $out/opt/zoom/$i ]; then - patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/$i - fi - done - - # ZoomLauncher sets LD_LIBRARY_PATH before execing zoom - # IPC breaks if the executable name does not end in 'zoom' - # zoom binary does not like being touched by patchelf - # => we call it indirectly via the dynamic linker - # zoom binary inspects /proc/self/exe to find its data files - # => we must place a copy (not symlink) of the linker in zoom's data dir - mv $out/opt/zoom/zoom $out/opt/zoom/.zoom - cp "$(cat $NIX_CC/nix-support/dynamic-linker)" $out/opt/zoom/ld.so - makeWrapper $out/opt/zoom/ld.so $out/opt/zoom/zoom \ - --add-flags $out/opt/zoom/.zoom \ - --prefix LD_LIBRARY_PATH ":" ${libs} - - rm $out/bin/zoom - # 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: - # Clear Qt paths to prevent tripping over "foreign" Qt resources. - # Clear Qt screen scaling settings to prevent over-scaling. - makeWrapper $out/opt/zoom/ZoomLauncher $out/bin/zoom \ - --chdir "$out/opt/zoom" \ - --unset QML2_IMPORT_PATH \ - --unset QT_PLUGIN_PATH \ - --unset QT_SCREEN_SCALE_FACTORS \ - --prefix PATH : ${binPath} \ - --prefix LD_LIBRARY_PATH ":" ${libs} - - if [ -f $out/opt/zoom/ZoomWebviewHost ]; then - wrapProgram $out/opt/zoom/ZoomWebviewHost \ - --unset QML2_IMPORT_PATH \ - --unset QT_PLUGIN_PATH \ - --unset QT_SCREEN_SCALE_FACTORS \ - --prefix LD_LIBRARY_PATH ":" ${libs} - fi - # Backwards compatibility: we used to call it zoom-us ln -s $out/bin/{zoom,zoom-us} ''; - # already done - dontPatchELF = true; - - passthru.updateScript = ./update.sh; - passthru.tests.startwindow = callPackage ./test.nix { }; - - meta = { - homepage = "https://zoom.us/"; - changelog = "https://support.zoom.com/hc/en/article?id=zm_kb&sysparm_article=KB0061222"; - description = "zoom.us video conferencing application"; - sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; - license = lib.licenses.unfree; - platforms = builtins.attrNames srcs; - maintainers = with lib.maintainers; [ - danbst - tadfisher - ]; - mainProgram = "zoom"; + passthru = unpacked.passthru // { + inherit unpacked; + }; + inherit (unpacked) meta; }; -} + +in + +packages.${system} or throwSystem From 872d00d479bed96e7b30be73b197290233efc7d5 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Mon, 7 Apr 2025 19:32:05 +0200 Subject: [PATCH 06/12] zoom-us: simplify environment Zoom seems to work fine without * cd'ing into its `/opt/zoom` directory * unsetting `QML2_IMPORT_PATH` and `QT_SCREEN_SCALE_FACTORS` before starting `ZoomLauncher`. However, unsetting `QT_PLUGIN_PATH` is still required, at least when Zoom is used within plasma 5. --- pkgs/by-name/zo/zoom-us/package.nix | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 1b2b924c986b..465a7fc27b62 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -188,12 +188,7 @@ let version = versions.${system} or throwSystem; targetPkgs = pkgs: (linuxGetDependencies pkgs) ++ [ unpacked ]; - extraPreBwrapCmds = '' - cd ${unpacked}/opt/zoom - unset QML2_IMPORT_PATH - unset QT_PLUGIN_PATH - unset QT_SCREEN_SCALE_FACTORS - ''; + extraPreBwrapCmds = "unset QT_PLUGIN_PATH"; extraBwrapArgs = [ "--ro-bind ${unpacked}/opt /opt" ]; runScript = "/opt/zoom/ZoomLauncher"; From bf5b8fdb47194431fab22a02130871ba39f69d85 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Mon, 7 Apr 2025 12:04:49 +0200 Subject: [PATCH 07/12] zoom-us: add support for `xdg-desktop-portal` --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 465a7fc27b62..81773f8fd6a5 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -6,6 +6,7 @@ xar, cpio, pulseaudioSupport ? true, + xdgDesktopPortalSupport ? true, callPackage, buildFHSEnv, }: @@ -177,6 +178,17 @@ let ++ lib.optionals pulseaudioSupport [ pkgs.libpulseaudio pkgs.pulseaudio + ] + ++ lib.optionals xdgDesktopPortalSupport [ + pkgs.kdePackages.xdg-desktop-portal-kde + pkgs.lxqt.xdg-desktop-portal-lxqt + pkgs.plasma5Packages.xdg-desktop-portal-kde + pkgs.xdg-desktop-portal + pkgs.xdg-desktop-portal-gnome + pkgs.xdg-desktop-portal-gtk + pkgs.xdg-desktop-portal-hyprland + pkgs.xdg-desktop-portal-wlr + pkgs.xdg-desktop-portal-xapp ]; # We add the `unpacked` zoom archive to the FHS env From 14e3e04dfacc954780457f6f155a04f41405d833 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Thu, 27 Mar 2025 08:47:44 +0000 Subject: [PATCH 08/12] zoom-us: 6.3.11.* -> 6.4.1.* --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 81773f8fd6a5..21870a92b139 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -19,23 +19,23 @@ let # 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. - versions.aarch64-darwin = "6.3.11.50104"; - versions.x86_64-darwin = "6.3.11.50104"; - versions.x86_64-linux = "6.3.11.7212"; + versions.aarch64-darwin = "6.4.1.51520"; + versions.x86_64-darwin = "6.4.1.51520"; + versions.x86_64-linux = "6.4.1.587"; srcs = { aarch64-darwin = fetchurl { url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; name = "zoomusInstallerFull.pkg"; - hash = "sha256-RZVBq2TQcPs+8wx3YwwISVgaPvxS8hP93vxbJMpEhT0="; + hash = "sha256-igPyasH67eDe8hYIHCyZ/dk4P5zBbhYtFdQ2ww/QwO4="; }; x86_64-darwin = fetchurl { url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-OwHVqQZVIQlasehX6UTD1fg1YZDAtvBZSdPq2Ze2JTA="; + hash = "sha256-EBGc64dy9WKyz6UAFGUrzFtrO+lho5xvIK13jzedUXc="; }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; - hash = "sha256-wSXb2v2qXoLXctmjOZpL0SiOP8+ySwpTDpJmPrfQQco="; + hash = "sha256-xShPDJZZSawKag/OrUqTommIM8RwY1K6LVNEdnr2D94="; }; }; From f5b1504ed02799d2ea96a280674c6e0fe4f74c21 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 7 Apr 2025 08:21:18 +0000 Subject: [PATCH 09/12] zoom-us: 6.4.1.* -> 6.4.3.* --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 21870a92b139..8abcd6945057 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -19,23 +19,23 @@ let # 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. - versions.aarch64-darwin = "6.4.1.51520"; - versions.x86_64-darwin = "6.4.1.51520"; - versions.x86_64-linux = "6.4.1.587"; + versions.aarch64-darwin = "6.4.3.52139"; + versions.x86_64-darwin = "6.4.3.52139"; + versions.x86_64-linux = "6.4.3.827"; srcs = { aarch64-darwin = fetchurl { url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; name = "zoomusInstallerFull.pkg"; - hash = "sha256-igPyasH67eDe8hYIHCyZ/dk4P5zBbhYtFdQ2ww/QwO4="; + hash = "sha256-bnuOyENfJLyGPwgPSdbU51SG/OXbMqd3gcwhMZoyIGA="; }; x86_64-darwin = fetchurl { url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-EBGc64dy9WKyz6UAFGUrzFtrO+lho5xvIK13jzedUXc="; + hash = "sha256-L6WYRty3h9wgxp/lkW+BzgwSUcfWxP8h0/dwrkVClfU="; }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; - hash = "sha256-xShPDJZZSawKag/OrUqTommIM8RwY1K6LVNEdnr2D94="; + hash = "sha256-KPTLWlXOEEWGODzolzhnluOq6YQ9+DMC6n80umf/nf0="; }; }; From 03eb2e50a71852e879957dda7f358d0ae1b10bd8 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Wed, 16 Apr 2025 16:58:12 +0000 Subject: [PATCH 10/12] zoom-us: 6.4.3.* -> 6.4.5.* --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 8abcd6945057..2e78b8bb35b8 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -19,23 +19,23 @@ let # 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. - versions.aarch64-darwin = "6.4.3.52139"; - versions.x86_64-darwin = "6.4.3.52139"; - versions.x86_64-linux = "6.4.3.827"; + versions.aarch64-darwin = "6.4.5.53616"; + versions.x86_64-darwin = "6.4.5.53616"; + versions.x86_64-linux = "6.4.5.1259"; srcs = { aarch64-darwin = fetchurl { url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; name = "zoomusInstallerFull.pkg"; - hash = "sha256-bnuOyENfJLyGPwgPSdbU51SG/OXbMqd3gcwhMZoyIGA="; + hash = "sha256-Rd/2MZQ0NwZWQ9g0b99axB1IrNB4HBpf51nQ7UmO9/0="; }; x86_64-darwin = fetchurl { url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-L6WYRty3h9wgxp/lkW+BzgwSUcfWxP8h0/dwrkVClfU="; + hash = "sha256-oBfUPOiuyXAyusCUL4r/aYf0rU/myBu8QlkCnYyVi2w="; }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; - hash = "sha256-KPTLWlXOEEWGODzolzhnluOq6YQ9+DMC6n80umf/nf0="; + hash = "sha256-oAsK92yTaLdi9YfIcMkTevrSsKr2nClcMjOBo5VYIEg="; }; }; From f333de9a36b53d20187b0a0c7c8be3431203e240 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 25 Apr 2025 20:44:17 +0000 Subject: [PATCH 11/12] zoom-us: 6.4.5.* -> 6.4.6.* --- pkgs/by-name/zo/zoom-us/package.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index 2e78b8bb35b8..edcedf74d46a 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -19,23 +19,23 @@ let # 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. - versions.aarch64-darwin = "6.4.5.53616"; - versions.x86_64-darwin = "6.4.5.53616"; - versions.x86_64-linux = "6.4.5.1259"; + versions.aarch64-darwin = "6.4.6.53970"; + versions.x86_64-darwin = "6.4.6.53970"; + versions.x86_64-linux = "6.4.6.1370"; srcs = { aarch64-darwin = fetchurl { url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; name = "zoomusInstallerFull.pkg"; - hash = "sha256-Rd/2MZQ0NwZWQ9g0b99axB1IrNB4HBpf51nQ7UmO9/0="; + hash = "sha256-yNsiFZNte4432d8DUyDhPUOVbLul7gUdvr+3qK/Y+tk="; }; x86_64-darwin = fetchurl { url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-oBfUPOiuyXAyusCUL4r/aYf0rU/myBu8QlkCnYyVi2w="; + hash = "sha256-Ut93qQFFN0d58wXD5r8u0B17HbihFg3FgY3a1L8nsIA="; }; x86_64-linux = fetchurl { url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; - hash = "sha256-oAsK92yTaLdi9YfIcMkTevrSsKr2nClcMjOBo5VYIEg="; + hash = "sha256-Y+8garSqDcKLCVv1cTiqGEfrGKpK3UoXIq8X4E8CF+8="; }; }; From 27f0cbcf5450774981adb4b7ef651678a9cc9d17 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sat, 12 Apr 2025 16:21:30 +0200 Subject: [PATCH 12/12] zoom-us: drop Darwin support --- pkgs/by-name/zo/zoom-us/package.nix | 147 +++++++++------------------- pkgs/by-name/zo/zoom-us/update.sh | 30 +----- 2 files changed, 45 insertions(+), 132 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/package.nix b/pkgs/by-name/zo/zoom-us/package.nix index edcedf74d46a..00ac892e98f0 100644 --- a/pkgs/by-name/zo/zoom-us/package.nix +++ b/pkgs/by-name/zo/zoom-us/package.nix @@ -2,9 +2,6 @@ stdenv, lib, fetchurl, - makeWrapper, - xar, - cpio, pulseaudioSupport ? true, xdgDesktopPortalSupport ? true, callPackage, @@ -12,90 +9,39 @@ }: let - inherit (stdenv.hostPlatform) system; - throwSystem = throw "Unsupported system: ${system}"; + unpacked = stdenv.mkDerivation (finalAttrs: { + pname = "zoom"; + version = "6.4.6.1370"; - # Zoom versions are released at different times for each platform - # 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. - versions.aarch64-darwin = "6.4.6.53970"; - versions.x86_64-darwin = "6.4.6.53970"; - versions.x86_64-linux = "6.4.6.1370"; - - srcs = { - aarch64-darwin = fetchurl { - url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64"; - name = "zoomusInstallerFull.pkg"; - hash = "sha256-yNsiFZNte4432d8DUyDhPUOVbLul7gUdvr+3qK/Y+tk="; - }; - x86_64-darwin = fetchurl { - url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg"; - hash = "sha256-Ut93qQFFN0d58wXD5r8u0B17HbihFg3FgY3a1L8nsIA="; - }; - x86_64-linux = fetchurl { - url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz"; + src = fetchurl { + url = "https://zoom.us/client/${finalAttrs.version}/zoom_x86_64.pkg.tar.xz"; hash = "sha256-Y+8garSqDcKLCVv1cTiqGEfrGKpK3UoXIq8X4E8CF+8="; }; - }; - unpacked = stdenv.mkDerivation { - pname = "zoom"; - version = versions.${system} or throwSystem; + dontUnpack = true; - src = srcs.${system} or throwSystem; - - dontUnpack = stdenv.hostPlatform.isLinux; - unpackPhase = lib.optionalString stdenv.hostPlatform.isDarwin '' - xar -xf $src - zcat < zoomus.pkg/Payload | cpio -i - ''; - - # Note: In order to uncover missing libraries - # on x86_64-linux, add "pkgs" to this file's arguments + # Note: In order to uncover missing libraries, + # add "pkgs" to this file's arguments # (at the top of this file), then add these attributes here: # > buildInputs = linuxGetDependencies pkgs; # > dontAutoPatchelf = true; # > dontWrapQtApps = true; + # > nativeBuildInputs = [ pkgs.autoPatchelfHook ]; # > preFixup = '' # > addAutoPatchelfSearchPath $out/opt/zoom # > autoPatchelf $out/opt/zoom/{cef,Qt,*.so*,aomhost,zoom,zopen,ZoomLauncher,ZoomWebviewHost} # > ''; - # ...and finally "pkgs.autoPatchelfHook" - # to `nativeBuildInputs` right below. # Then build `zoom-us.unpacked`: # `autoPatchelfHook` will report missing library files. - nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ - makeWrapper - xar - cpio - ]; installPhase = '' runHook preInstall - ${ - rec { - aarch64-darwin = '' - mkdir -p $out/Applications - cp -R zoom.us.app $out/Applications/ - ''; - # 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/ - ''; - } - .${system} or throwSystem - } + mkdir $out + tar -C $out -xf $src + mv $out/usr/* $out/ runHook postInstall ''; - postFixup = lib.optionalString stdenv.hostPlatform.isDarwin '' - makeWrapper $out/Applications/zoom.us.app/Contents/MacOS/zoom.us $out/bin/zoom - ''; - dontPatchELF = true; passthru.updateScript = ./update.sh; @@ -107,18 +53,13 @@ let description = "zoom.us video conferencing application"; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; license = lib.licenses.unfree; - platforms = builtins.attrNames srcs; + platforms = [ "x86_64-linux" ]; maintainers = with lib.maintainers; [ danbst tadfisher ]; - mainProgram = "zoom"; }; - }; - packages.aarch64-darwin = unpacked; - packages.x86_64-darwin = unpacked; - - # linux definitions + }); linuxGetDependencies = pkgs: @@ -191,35 +132,35 @@ let pkgs.xdg-desktop-portal-xapp ]; - # We add the `unpacked` zoom archive to the FHS env - # and also bind-mount its `/opt` directory. - # This should assist Zoom in finding all its - # files in the places where it expects them to be. - packages.x86_64-linux = buildFHSEnv { - pname = "zoom"; # Will also be the program's name! - version = versions.${system} or throwSystem; - - targetPkgs = pkgs: (linuxGetDependencies pkgs) ++ [ unpacked ]; - extraPreBwrapCmds = "unset QT_PLUGIN_PATH"; - extraBwrapArgs = [ "--ro-bind ${unpacked}/opt /opt" ]; - runScript = "/opt/zoom/ZoomLauncher"; - - extraInstallCommands = '' - cp -Rt $out/ ${unpacked}/share - substituteInPlace \ - $out/share/applications/Zoom.desktop \ - --replace-fail Exec={/usr/bin/,}zoom - - # Backwards compatibility: we used to call it zoom-us - ln -s $out/bin/{zoom,zoom-us} - ''; - - passthru = unpacked.passthru // { - inherit unpacked; - }; - inherit (unpacked) meta; - }; - in -packages.${system} or throwSystem +# We add the `unpacked` zoom archive to the FHS env +# and also bind-mount its `/opt` directory. +# This should assist Zoom in finding all its +# files in the places where it expects them to be. +buildFHSEnv rec { + pname = "zoom"; # Will also be the program's name! + inherit (unpacked) version; + + targetPkgs = pkgs: (linuxGetDependencies pkgs) ++ [ unpacked ]; + extraPreBwrapCmds = "unset QT_PLUGIN_PATH"; + extraBwrapArgs = [ "--ro-bind ${unpacked}/opt /opt" ]; + runScript = "/opt/zoom/ZoomLauncher"; + + extraInstallCommands = '' + cp -Rt $out/ ${unpacked}/share + substituteInPlace \ + $out/share/applications/Zoom.desktop \ + --replace-fail Exec={/usr/bin/,}zoom + + # Backwards compatibility: we used to call it zoom-us + ln -s $out/bin/{zoom,zoom-us} + ''; + + passthru = unpacked.passthru // { + inherit unpacked; + }; + meta = unpacked.meta // { + mainProgram = pname; + }; +} diff --git a/pkgs/by-name/zo/zoom-us/update.sh b/pkgs/by-name/zo/zoom-us/update.sh index df27da6f3ba4..16d1e8f4fca0 100755 --- a/pkgs/by-name/zo/zoom-us/update.sh +++ b/pkgs/by-name/zo/zoom-us/update.sh @@ -3,32 +3,4 @@ set -eu -o pipefail -scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd) -nixpkgs=$(realpath "$scriptDir"/../../../..) - -echo >&2 "=== Obtaining version data from https://zoom.us/rest/download ..." -linux_data=$(curl -Ls 'https://zoom.us/rest/download?os=linux' | jq .result.downloadVO) -mac_data=$(curl -Ls 'https://zoom.us/rest/download?os=mac' | jq .result.downloadVO) - -version_aarch64_darwin=$(jq -r .zoomArm64.version <<<"$mac_data") -version_x86_64_darwin=$(jq -r .zoom.version <<<"$mac_data") -version_x86_64_linux=$(jq -r .zoom.version <<<"$linux_data") - -echo >&2 "=== Downloading packages and computing hashes..." -# We precalculate the hashes before calling update-source-version -# because it attempts to calculate each architecture's package's hash -# by running `nix-build --system -A zoom-us.src` which -# causes cross compiling headaches; using nix-prefetch-url with -# hard-coded URLs is simpler. Keep these URLs in sync with the ones -# in package.nix where `srcs` is defined. -hash_aarch64_darwin=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_aarch64_darwin}/zoomusInstallerFull.pkg?archType=arm64")) -hash_x86_64_darwin=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_darwin}/zoomusInstallerFull.pkg")) -hash_x86_64_linux=$(nix hash to-sri --type sha256 $(nix-prefetch-url --type sha256 "https://zoom.us/client/${version_x86_64_linux}/zoom_x86_64.pkg.tar.xz")) - -echo >&2 "=== Updating package.nix ..." -# update-source-version expects to be at the root of nixpkgs -(cd "$nixpkgs" && update-source-version zoom-us "$version_aarch64_darwin" $hash_aarch64_darwin --system=aarch64-darwin --version-key=versions.aarch64-darwin) -(cd "$nixpkgs" && update-source-version zoom-us "$version_x86_64_darwin" $hash_x86_64_darwin --system=x86_64-darwin --version-key=versions.x86_64-darwin) -(cd "$nixpkgs" && update-source-version zoom-us "$version_x86_64_linux" $hash_x86_64_linux --system=x86_64-linux --version-key=versions.x86_64-linux) - -echo >&2 "=== Done!" +update-source-version zoom-us $(curl -Ls 'https://zoom.us/rest/download?os=linux' | jq -r .result.downloadVO.zoom.version) --source-key=unpacked.src