[Backport release-26.05] anydesk: fix broken updateScript, fix multi-arch hash update, update 8.0.2 -> 8.0.3 (#535865)

This commit is contained in:
Gergő Gutyina 2026-07-01 09:12:16 +00:00 committed by GitHub
commit c3bc043866
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 22 deletions

View file

@ -4,8 +4,8 @@
fetchurl,
makeWrapper,
makeDesktopItem,
genericUpdater,
writeShellScript,
jq,
atk,
cairo,
gdk-pixbuf,
@ -164,24 +164,7 @@ stdenv.mkDerivation (finalAttrs: {
'';
passthru = {
updateScript = genericUpdater {
versionLister =
let
arch =
if system == "x86_64-linux" then
"amd64"
else if system == "aarch64-linux" then
"arm64"
else
throw "cannot update AnyDesk on ${system}";
in
writeShellScript "anydesk-versionLister" ''
curl -s https://anydesk.com/en/downloads/linux \
| grep "https://[a-z0-9._/-]*-${arch}.tar.gz" -o \
| uniq \
| sed 's,.*/anydesk-\(.*\)-${arch}.tar.gz,\1,g'
'';
};
updateScript = ./update.sh;
};
meta = {

View file

@ -1,5 +1,5 @@
{
"version": "8.0.2",
"x86_64-linux": "sha256-6noMPfe0x6kx/whyd66qcmk7WhEivx3xK5q58Se9Ij0=",
"aarch64-linux": "sha256-wfY+OCx9OyLCmiA29RjnYzcg/pApMIXWT5UrcdcyRYM="
"version": "8.0.3",
"x86_64-linux": "sha256-Mjl17hh5A/pwRAi7giL1SJYlQ61O0SXX+KeH8STZ4bs=",
"aarch64-linux": "sha256-MhAj5cy81uBMoNeFPvOyhBOlJzBgNRHXyCXrpdvF8nE="
}

View file

@ -0,0 +1,39 @@
#!/usr/bin/env -S nix shell nixpkgs#curl nixpkgs#jq nixpkgs#nix --command bash
set -euo pipefail
directory="$(dirname $0 | xargs realpath)"
new_version=$(
curl -s https://rpm.anydesk.com/rhel/x86_64/Packages/ \
| grep -oP 'anydesk_\K[0-9]+\.[0-9]+\.[0-9]+(?=-[0-9]+_x86_64\.rpm)' \
| sort -V \
| tail -1
)
old_version=$(jq -r '.version' "$directory/pin.json")
if [[ "$new_version" == "$old_version" ]]; then
echo "anydesk is already up to date ($old_version)"
exit 0
fi
echo "Updating anydesk: $old_version -> $new_version"
hash_amd64=$(nix hash to-sri --type sha256 \
"$(nix-prefetch-url --type sha256 \
"https://download.anydesk.com/linux/anydesk-${new_version}-amd64.tar.gz")")
hash_arm64=$(nix hash to-sri --type sha256 \
"$(nix-prefetch-url --type sha256 \
"https://download.anydesk.com/rpi/anydesk-${new_version}-arm64.tar.gz")")
cat > "$directory/pin.json" << EOF
{
"version": "$new_version",
"x86_64-linux": "$hash_amd64",
"aarch64-linux": "$hash_arm64"
}
EOF
cat "$directory/pin.json"