vigra: add updateScript

This commit is contained in:
kyehn
2025-08-31 07:24:37 +08:00
parent 8c5f803260
commit a65acb5301

View File

@@ -12,6 +12,9 @@
libtiff,
openexr,
python3,
writeShellScript,
jq,
nix-update,
}:
let
@@ -69,6 +72,10 @@ stdenv.mkDerivation (finalAttrs: {
doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform;
});
};
updateScript = writeShellScript "update-vigra" ''
latestVersion=$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --fail --silent https://api.github.com/repos/ukoethe/vigra/releases/latest | ${lib.getExe jq} --raw-output .tag_name | sed -E 's/Version-([0-9]+)-([0-9]+)-([0-9]+)/\1.\2.\3/')
${lib.getExe nix-update} vigra --version $latestVersion
'';
};
meta = with lib; {