zoom-us: 5.11.{1.8356,3.3882} -> 5.11.{9.10046,10.4400}

This commit is contained in:
Keshav Kini 2022-08-28 23:41:18 -07:00
parent e0602af03c
commit 7aabe71f78
8 changed files with 42 additions and 42 deletions

View file

@ -1 +0,0 @@
"0cwplzza8vv4nzxf35i2p4gfnna4dpgp0ddqbpdxl8cxrikq5rji"

View file

@ -44,24 +44,26 @@ let
throwSystem = throw "Unsupported system: ${system}"; throwSystem = throw "Unsupported system: ${system}";
# Zoom versions are released at different times for each platform # Zoom versions are released at different times for each platform
version = { # and often with different versions. We write them on three lines
aarch64-darwin =import ./arm64-darwin-version.nix; # like this (rather than using {}) so that the updater script can
x86_64-darwin = import ./x86_64-darwin-version.nix; # find where to edit them.
x86_64-linux = import ./x86_64-linux-version.nix; versions.aarch64-darwin = "5.11.9.10046";
}.${system} or throwSystem; versions.x86_64-darwin = "5.11.9.10046";
versions.x86_64-linux = "5.11.10.4400";
srcs = { srcs = {
aarch64-darwin = fetchurl { aarch64-darwin = fetchurl {
url = "https://zoom.us/client/${version}/Zoom.pkg?archType=arm64"; url = "https://zoom.us/client/${versions.aarch64-darwin}/zoomusInstallerFull.pkg?archType=arm64";
sha256 = import ./arm64-darwin-sha.nix; name = "zoomusInstallerFull.pkg";
hash = "sha256-Z+K811azMRnhptZ1UvM+o5IgE0F4p9BrntJC9IgPU7U=";
}; };
x86_64-darwin = fetchurl { x86_64-darwin = fetchurl {
url = "https://zoom.us/client/${version}/Zoom.pkg"; url = "https://zoom.us/client/${versions.x86_64-darwin}/zoomusInstallerFull.pkg";
sha256 = import ./x86_64-darwin-sha.nix; hash = "sha256-7U7qT3xlm5LqcJByMWxhZnqs6XBzylEGhqTNUgiaXJY=";
}; };
x86_64-linux = fetchurl { x86_64-linux = fetchurl {
url = "https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz"; url = "https://zoom.us/client/${versions.x86_64-linux}/zoom_x86_64.pkg.tar.xz";
sha256 = import ./x86_64-linux-sha.nix; hash = "sha256-Pi1MtuCHzkQACamsNOIS6pbM03L1CmyosbpdrYVNCkQ=";
}; };
}; };
@ -109,7 +111,7 @@ let
in in
stdenv.mkDerivation rec { stdenv.mkDerivation rec {
pname = "zoom"; pname = "zoom";
inherit version; version = versions.${system} or throwSystem;
src = srcs.${system} or throwSystem; src = srcs.${system} or throwSystem;

View file

@ -1,30 +1,34 @@
#!/usr/bin/env nix-shell #!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl pup #!nix-shell -i bash -p common-updater-scripts curl jq
set -eu -o pipefail set -eu -o pipefail
dirname="$(dirname "$0")" scriptDir=$(cd "${BASH_SOURCE[0]%/*}" && pwd)
nixpkgs=$(realpath "$scriptDir"/../../../../..)
uname="$(uname)" 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)
if [[ "$uname" == "Linux" ]]; then version_aarch64_darwin=$(jq -r .zoomArm64.version <<<"$mac_data")
version="$(curl -Ls https://zoom.us/download\?os\=linux | \ version_x86_64_darwin=$(jq -r .zoom.version <<<"$mac_data")
pup '.linux-ver-text text{}' | \ version_x86_64_linux=$(jq -r .zoom.version <<<"$linux_data")
awk -F'[ ().]' '{printf $2"."$3"."$4"."$6"\n"}')"
printf '"%s"\n' ${version} > $dirname/x86_64-linux-version.nix echo >&2 "=== Downloading packages and computing hashes..."
printf '"%s"\n' \ # We precalculate the hashes before calling update-source-version
$(nix-prefetch-url https://zoom.us/client/${version}/zoom_x86_64.pkg.tar.xz) > \ # because it attempts to calculate each architecture's package's hash
$dirname/x86_64-linux-sha.nix # by running `nix-build --system <architecture> -A zoom-us.src` which
elif [[ $uname == "Darwin" ]]; then # causes cross compiling headaches; using nix-prefetch-url with
# The 1st line might be empty # hard-coded URLs is simpler. Keep these URLs in sync with the ones
# 2nd line is the version of the conference room application # in default.nix where `srcs` is defined.
version="$(curl -Ls https://zoom.us/download\?os\=mac | \ 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"))
pup '.ver text{}' | \ 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"))
sed '/^$/d' |\ 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"))
head -1 | \
awk -F'[ ().]' '{printf $2"."$3"."$4"."$6"\n"}')" echo >&2 "=== Updating default.nix ..."
printf '"%s"\n' ${version} > "$dirname/$(uname -m)-darwin-version.nix" # update-source-version expects to be at the root of nixpkgs
printf '"%s"\n' \ (cd "$nixpkgs" && update-source-version zoom-us "$version_aarch64_darwin" $hash_aarch64_darwin --system=aarch64-darwin --version-key=versions.aarch64-darwin)
$(nix-prefetch-url "https://zoom.us/client/${version}/Zoom.pkg?archType=$(uname -m)") > \ (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)
"$dirname/$(uname -m)-darwin-sha.nix" (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)
fi
echo >&2 "=== Done!"

View file

@ -1 +0,0 @@
"12s4z80n1qk1vcp5vppabj6fxanm4q7pjj7mggalmjbj6984fsza"

View file

@ -1 +0,0 @@
"09x0l50frck8v2zhgp84m57q3kj74chk37sc69mpbhwy0s6vg980"