haguichi: Add passthru.updateScript

The upstream repo has regular releases and elementaryOS-specific releases.
We only want the regular releases, so filter out the elementaryOS ones in a
custom updateScript.
This commit is contained in:
OPNA2608 2023-02-05 11:26:46 +01:00
parent 42b3a6354f
commit a2093d3ff9
2 changed files with 16 additions and 1 deletions

View File

@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
owner = "ztefn";
repo = "haguichi";
rev = version;
sha256 = "1kgjl9g9lyg00cfx4x28s4xyqsqk5057xv6k2cj6ckg9lkxaixvc";
hash = "sha256-bPeo+qTpTWYkE9PsfgooE2vsO9FIdNIdA+B5ml6i8s0=";
};
nativeBuildInputs = [
@ -44,6 +44,8 @@ stdenv.mkDerivation rec {
patchShebangs meson_post_install.py
'';
passthru.updateScript = ./update.sh;
meta = with lib; {
description = "Graphical frontend for Hamachi on Linux";
homepage = "https://haguichi.net/";

View File

@ -0,0 +1,13 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
set -euo pipefail
version="$(
curl -s https://api.github.com/repos/ztefn/haguichi/releases |
jq '.[] | select(.target_commitish!="elementary") | .tag_name' --raw-output |
sort --version-sort --reverse |
head -n1
)"
update-source-version haguichi "$version"