Skip to content

Commit 63ada85

Browse files
authored
qgis: add update script (#384085)
2 parents 5a0df1e + 75de476 commit 63ada85

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

pkgs/applications/gis/qgis/default.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let
2121
in
2222
symlinkJoin rec {
2323

24-
inherit (qgis-unwrapped) version;
24+
inherit (qgis-unwrapped) version src;
2525
name = "qgis-${version}";
2626

2727
paths = [ qgis-unwrapped ];
@@ -47,6 +47,10 @@ symlinkJoin rec {
4747
passthru = {
4848
unwrapped = qgis-unwrapped;
4949
tests.qgis = nixosTests.qgis;
50+
updateScript = [
51+
./update.sh
52+
"qgis"
53+
];
5054
};
5155

5256
meta = qgis-unwrapped.meta;

pkgs/applications/gis/qgis/ltr.nix

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let
2121
in
2222
symlinkJoin rec {
2323

24-
inherit (qgis-ltr-unwrapped) version;
24+
inherit (qgis-ltr-unwrapped) version src;
2525
name = "qgis-${version}";
2626

2727
paths = [ qgis-ltr-unwrapped ];
@@ -48,6 +48,10 @@ symlinkJoin rec {
4848
passthru = {
4949
unwrapped = qgis-ltr-unwrapped;
5050
tests.qgis-ltr = nixosTests.qgis-ltr;
51+
updateScript = [
52+
./update.sh
53+
"qgis-ltr"
54+
];
5155
};
5256

5357
inherit (qgis-ltr-unwrapped) meta;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/usr/bin/env nix-shell
2+
#!nix-shell -i bash -p common-updater-scripts curl jq
3+
4+
set -eu -o pipefail
5+
6+
url="https://version.qgis.org/version.json"
7+
8+
package="$1"
9+
10+
function make_version {
11+
jq --raw-output '[.major, .minor, .patch] | join(".")'
12+
}
13+
14+
if [ "$package" == "qgis" ]; then
15+
version="$(curl --silent $url | jq '.latest' | make_version)"
16+
elif [ "$package" == "qgis-ltr" ]; then
17+
version="$(curl --silent $url | jq '.ltr' | make_version)"
18+
fi
19+
20+
update-source-version "$package" "$version"

0 commit comments

Comments
 (0)