From 9a17278a5cebec1d39d68055fbca320ac805a498 Mon Sep 17 00:00:00 2001 From: Yarny0 <41838844+Yarny0@users.noreply.github.com> Date: Sun, 9 Nov 2025 10:27:10 +0100 Subject: [PATCH] zoom-us: simplify updater script This uses pkgsCross to help the general update script find and update the various zoom versions for the various architectures. That way, we no longer need to calculate the source hashes in the update script. Credits: The commit at hand is inspired by https://github.com/NixOS/nixpkgs/blob/c656e00a21df6c42d6b57e9f8abf6cdf20e7b1ce/pkgs/by-name/ch/chataigne/update.sh#L24 (note: not merged into nixpkgs yet, so that link might disappear), after a friendly note by axelkar https://github.com/NixOS/nixpkgs/pull/429215#discussion_r2255114820 and a helpful hint by magistau https://github.com/NixOS/nixpkgs/pull/429215#discussion_r2506957507 Thanks to both of you! --- pkgs/by-name/zo/zoom-us/update.sh | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/pkgs/by-name/zo/zoom-us/update.sh b/pkgs/by-name/zo/zoom-us/update.sh index d307058ceb5d..25e8d58eb9a2 100755 --- a/pkgs/by-name/zo/zoom-us/update.sh +++ b/pkgs/by-name/zo/zoom-us/update.sh @@ -14,21 +14,10 @@ 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 --extra-experimental-features nix-command 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 --extra-experimental-features nix-command 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 --extra-experimental-features nix-command 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 --source-key=unpacked.src) +(cd "$nixpkgs" && update-source-version --ignore-same-version --print-changes --version-key=versions.aarch64-darwin pkgsCross.aarch64-darwin.zoom-us "$version_aarch64_darwin") +(cd "$nixpkgs" && update-source-version --ignore-same-version --print-changes --version-key=versions.x86_64-darwin pkgsCross.x86_64-darwin.zoom-us "$version_x86_64_darwin") +(cd "$nixpkgs" && update-source-version --ignore-same-version --print-changes --version-key=versions.x86_64-linux pkgsCross.gnu64.zoom-us "$version_x86_64_linux" --source-key=unpacked.src) echo >&2 "=== Done!"