From a2093d3ff99d91468781c864f38767153c499e8a Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Sun, 5 Feb 2023 11:26:46 +0100 Subject: [PATCH] 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. --- pkgs/tools/networking/haguichi/default.nix | 4 +++- pkgs/tools/networking/haguichi/update.sh | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 pkgs/tools/networking/haguichi/update.sh diff --git a/pkgs/tools/networking/haguichi/default.nix b/pkgs/tools/networking/haguichi/default.nix index 34ba1da28e4a..deb51191306d 100644 --- a/pkgs/tools/networking/haguichi/default.nix +++ b/pkgs/tools/networking/haguichi/default.nix @@ -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/"; diff --git a/pkgs/tools/networking/haguichi/update.sh b/pkgs/tools/networking/haguichi/update.sh new file mode 100755 index 000000000000..49a76a79d7ae --- /dev/null +++ b/pkgs/tools/networking/haguichi/update.sh @@ -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"