diff --git a/pkgs/by-name/sp/sparkle/package.nix b/pkgs/by-name/sp/sparkle/package.nix index 6ebb29124fef..406b801fe134 100644 --- a/pkgs/by-name/sp/sparkle/package.nix +++ b/pkgs/by-name/sp/sparkle/package.nix @@ -16,7 +16,7 @@ stdenv.mkDerivation (finalAttrs: { pname = "sparkle"; - version = "1.6.2"; + version = "1.6.4"; src = let @@ -31,8 +31,8 @@ stdenv.mkDerivation (finalAttrs: { fetchurl { url = "https://github.com/xishang0128/sparkle/releases/download/${finalAttrs.version}/sparkle-linux-${finalAttrs.version}-${arch}.deb"; hash = selectSystem { - x86_64-linux = "sha256-lUsKTEtUevBKmz21gu/AEAGXCmp0zcdSafRdncLBlQk="; - aarch64-linux = "sha256-sdsrUnOnvZYxs9tHSFf1k4sgJ9anp9P4s3Wz4oJY5ZU="; + x86_64-linux = "sha256-Q2TWrYNz3BAV8rBflxMuIQOogs+QJmmEidnGSOXaZgQ="; + aarch64-linux = "sha256-m/aAnAJpu9ycXECQJNrCpwFN76kWGFKvWfLXiJQbrWE="; }; }; @@ -57,8 +57,8 @@ stdenv.mkDerivation (finalAttrs: { cp -r opt $out/opt cp -r usr/share $out/share substituteInPlace $out/share/applications/sparkle.desktop \ - --replace-fail "/opt/Sparkle/sparkle" "sparkle" - ln -s $out/opt/Sparkle/sparkle $out/bin/sparkle + --replace-fail "/opt/sparkle/sparkle" "sparkle" + ln -s $out/opt/sparkle/sparkle $out/bin/sparkle runHook postInstall ''; @@ -71,7 +71,7 @@ stdenv.mkDerivation (finalAttrs: { udev libayatana-appindicator ] - } $out/opt/Sparkle/sparkle + } $out/opt/sparkle/sparkle ''; passthru.updateScript = ./update.sh; diff --git a/pkgs/by-name/sp/sparkle/update.sh b/pkgs/by-name/sp/sparkle/update.sh index 76c09d502e29..2aa1a555d142 100755 --- a/pkgs/by-name/sp/sparkle/update.sh +++ b/pkgs/by-name/sp/sparkle/update.sh @@ -1,9 +1,8 @@ #!/usr/bin/env nix-shell -#!nix-shell -i bash -p bash nix curl coreutils common-updater-scripts nix-update +#!nix-shell -i bash -p bash nix curl coreutils common-updater-scripts nix-update jq currentVersion=$(nix-instantiate --eval -E "with import ./. {}; sparkle.version or (lib.getVersion sparkle)" | tr -d '"') -nix-update sparkle -latestVersion=$(nix-instantiate --eval -E "with import ./. {}; sparkle.version or (lib.getVersion sparkle)" | tr -d '"') +latestVersion=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/xishang0128/sparkle/releases/latest | jq --raw-output .tag_name) echo "latest version: $latestVersion" echo "current version: $currentVersion" @@ -13,5 +12,6 @@ if [[ "$latestVersion" == "$currentVersion" ]]; then exit 0 fi +nix-update sparkle --version $latestVersion --system x86_64-linux hash=$(nix hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import ./. {}; sparkle.src.url" --system aarch64-linux | tr -d '"'))) update-source-version sparkle $latestVersion $hash --system=aarch64-linux --ignore-same-version