Unverified Commit c9ac7e44 authored by Dimitar Nestorov's avatar Dimitar Nestorov
Browse files

grandperspective: add update script

parent f6d6becd
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -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 = ''