Skip to content

Commit e069bef

Browse files
authored
grandperspective: 3.4.2 -> 3.5.1, add update script (#368605)
2 parents 6205910 + 0cb7e95 commit e069bef

File tree

1 file changed

+30
-7
lines changed

1 file changed

+30
-7
lines changed

pkgs/by-name/gr/grandperspective/package.nix

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,23 @@
44
fetchurl,
55
undmg,
66
makeWrapper,
7+
writeShellApplication,
8+
curl,
9+
cacert,
10+
gnugrep,
11+
common-updater-scripts,
712
}:
813

914
stdenv.mkDerivation (finalAttrs: {
10-
version = "3.4.2";
15+
version = "3.5.1";
1116
pname = "grandperspective";
1217

1318
src = fetchurl {
1419
inherit (finalAttrs) version;
1520
url = "mirror://sourceforge/grandperspectiv/GrandPerspective-${
1621
lib.replaceStrings [ "." ] [ "_" ] finalAttrs.version
1722
}.dmg";
18-
hash = "sha256-ZgyBeQCoixLGCFS8+UFoMilvtswplEC8MzK3BE4ocDg=";
23+
hash = "sha256-ZD6XUtsbwxHe3MYdCH9I/pYBCGgilPhhbYQChr0wCj4=";
1924
};
2025

2126
sourceRoot = "GrandPerspective.app";
@@ -29,7 +34,22 @@ stdenv.mkDerivation (finalAttrs: {
2934
makeWrapper "$out/Applications/GrandPerspective.app/Contents/MacOS/GrandPerspective" "$out/bin/grandperspective"
3035
'';
3136

32-
meta = with lib; {
37+
passthru.updateScript = lib.getExe (writeShellApplication {
38+
name = "grandperspective-update-script";
39+
runtimeInputs = [
40+
curl
41+
cacert
42+
gnugrep
43+
common-updater-scripts
44+
];
45+
text = ''
46+
url="https://sourceforge.net/p/grandperspectiv/documentation/ci/master/tree/CHANGES.txt?format=raw"
47+
version=$(curl -s "$url" | grep -oP 'Version \K[0-9.]+(?=,)' | head -n 1)
48+
update-source-version grandperspective "$version"
49+
'';
50+
});
51+
52+
meta = {
3353
description = "Open-source macOS application to analyze disk usage";
3454
longDescription = ''
3555
GrandPerspective is a small utility application for macOS that graphically shows the disk usage within a file
@@ -39,10 +59,13 @@ stdenv.mkDerivation (finalAttrs: {
3959
'';
4060
mainProgram = "grandperspective";
4161
homepage = "https://grandperspectiv.sourceforge.net";
42-
license = licenses.gpl2Only;
43-
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
44-
maintainers = with maintainers; [ eliandoran ];
45-
platforms = platforms.darwin;
62+
license = lib.licenses.gpl2Only;
63+
sourceProvenance = [ lib.sourceTypes.binaryNativeCode ];
64+
maintainers = with lib.maintainers; [
65+
eliandoran
66+
DimitarNestorov
67+
];
68+
platforms = lib.platforms.darwin;
4669
};
4770

4871
})

0 commit comments

Comments
 (0)