From c9ac7e44aafbc42dbbf2f888e79884d0c1d82d2c Mon Sep 17 00:00:00 2001 From: Dimitar Nestorov <8790386+dimitarnestorov@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:44:20 +0200 Subject: [PATCH] grandperspective: add update script --- pkgs/by-name/gr/grandperspective/package.nix | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/pkgs/by-name/gr/grandperspective/package.nix b/pkgs/by-name/gr/grandperspective/package.nix index b444e18b4ef68..4c2e2c098926f 100644 --- a/pkgs/by-name/gr/grandperspective/package.nix +++ b/pkgs/by-name/gr/grandperspective/package.nix @@ -4,6 +4,11 @@ fetchurl, undmg, makeWrapper, + writeShellApplication, + curl, + cacert, + gnugrep, + common-updater-scripts, }: stdenv.mkDerivation (finalAttrs: { @@ -29,6 +34,21 @@ stdenv.mkDerivation (finalAttrs: { makeWrapper "$out/Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective" "$out/bin/grandperspective" ''; + passthru.updateScript = lib.getExe (writeShellApplication { + name = "grandperspective-update-script"; + runtimeInputs = [ + curl + cacert + gnugrep + common-updater-scripts + ]; + text = '' + url="https://sourceforge.net/p/grandperspectiv/documentation/ci/master/tree/CHANGES.txt?format=raw" + version=$(curl -s "$url" | grep -oP 'Version \K[0-9.]+(?=,)' | head -n 1) + update-source-version grandperspective "$version" + ''; + }); + meta = with lib; { description = "Open-source macOS application to analyze disk usage"; longDescription = ''