From 876b195ecc9f596c9f84670a511fb047c201b0f6 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 9 Apr 2022 11:31:22 +0100 Subject: [PATCH] mame: add updateScript --- pkgs/applications/emulators/mame/default.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/applications/emulators/mame/default.nix b/pkgs/applications/emulators/mame/default.nix index ce3fb3d06aed..b9172ab7f91e 100644 --- a/pkgs/applications/emulators/mame/default.nix +++ b/pkgs/applications/emulators/mame/default.nix @@ -18,6 +18,7 @@ , SDL2 , SDL2_ttf , which +, writeScript }: let @@ -93,6 +94,16 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; + passthru.updateScript = writeScript "mame-update-script" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl common-updater-scripts jq + + set -eu -o pipefail + + latest_version=$(curl -s https://api.github.com/repos/mamedev/mame/releases/latest | jq --raw-output .tag_name) + update-source-version mame "''${latest_version/mame0/0.}" + ''; + meta = with lib; { description = "Is a multi-purpose emulation framework"; homepage = "https://www.mamedev.org/";