shadershark: simplify update script

Signed-off-by: lucasew <lucas59356@gmail.com>
This commit is contained in:
lucasew 2024-09-16 13:17:47 -03:00
parent 4d3269da01
commit 722137f9ea
2 changed files with 9 additions and 15 deletions

View File

@ -9,6 +9,8 @@
, imagemagick
, makeWrapper
, installShellFiles
, genericUpdater
, writeShellScript
}:
stdenv.mkDerivation (finalAttrs: {
@ -50,7 +52,13 @@ stdenv.mkDerivation (finalAttrs: {
runHook postInstall
'';
passthru.updateScript = [ ./update.sh finalAttrs.src.url ];
passthru.updateScript = genericUpdater {
inherit (finalAttrs) pname version;
versionLister = writeShellScript "shadershark-tags" ''
repo_url=${finalAttrs.src.url}
curl "$repo_url/tags" | grep '/rev/v' | sed 's;.*/rev/v\([^"]*\)[^$]*;\1; #'
'';
};
meta = with lib; {
mainProgram = "shader-shark";

View File

@ -1,14 +0,0 @@
#!/usr/bin/env nix-shell
#! nix-shell -i bash -p curl common-updater-scripts
set -e
repo_url="$1"; shift
data="$(curl "$repo_url/tags")"
rev="$(echo "$data" | grep '/rev/v' | sed 's;.*/rev/v\([^"]*\)[^$]*;\1;' | head -n 1)"
echo "new rev: $rev"
update-source-version shadershark "$rev" \
--print-changes