From a620edff970d716ebb1aa37d445569780fa7fb42 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sat, 14 Sep 2024 18:38:36 +0200 Subject: [PATCH 1/3] maestro: refactor prefer finalAttrs instead of rec maestro: add metadata --- pkgs/by-name/ma/maestro/package.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/ma/maestro/package.nix b/pkgs/by-name/ma/maestro/package.nix index 37adfb274d29..45f596d73e22 100644 --- a/pkgs/by-name/ma/maestro/package.nix +++ b/pkgs/by-name/ma/maestro/package.nix @@ -7,12 +7,12 @@ jre_headless, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "maestro"; version = "1.37.9"; src = fetchurl { - url = "https://github.com/mobile-dev-inc/maestro/releases/download/cli-${version}/maestro.zip"; + url = "https://github.com/mobile-dev-inc/maestro/releases/download/cli-${finalAttrs.version}/maestro.zip"; hash = "sha256-bWZuD2+v6molwW1ef2a3djBnVfYscBjILLGXeeSUmoU="; }; @@ -38,7 +38,9 @@ stdenv.mkDerivation rec { homepage = "https://maestro.mobile.dev/"; license = licenses.asl20; platforms = lib.platforms.all; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; changelog = "https://github.com/mobile-dev-inc/maestro/blob/main/CHANGELOG.md"; maintainers = with maintainers; [ SubhrajyotiSen ]; + mainProgram = "maestro"; }; -} +}) From d0f192a58336d56170698b24fb807da3d87e53a5 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sat, 14 Sep 2024 18:35:49 +0200 Subject: [PATCH 2/3] maestro: add script to auto update to the latest stable version use the following comamnd to update ```sh nix-update --use-update-script maestro ``` --- pkgs/by-name/ma/maestro/package.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/by-name/ma/maestro/package.nix b/pkgs/by-name/ma/maestro/package.nix index 45f596d73e22..31be50e0c20c 100644 --- a/pkgs/by-name/ma/maestro/package.nix +++ b/pkgs/by-name/ma/maestro/package.nix @@ -5,6 +5,7 @@ unzip, makeWrapper, jre_headless, + writeScript, }: stdenv.mkDerivation (finalAttrs: { @@ -33,6 +34,16 @@ stdenv.mkDerivation (finalAttrs: { wrapProgram $out/bin/maestro --prefix PATH : "${lib.makeBinPath [ jre_headless ]}" ''; + passthru.updateScript = writeScript "update-maestro" '' + #!/usr/bin/env nix-shell + #!nix-shell -i bash -p curl jq common-updater-scripts + set -o errexit -o nounset -o pipefail + + NEW_VERSION=$(curl --silent https://api.github.com/repos/mobile-dev-inc/maestro/releases | jq 'first(.[].tag_name | ltrimstr("cli-") | select(contains("dev.") | not))' --raw-output) + + update-source-version "maestro" "$NEW_VERSION" --print-changes + ''; + meta = with lib; { description = "Mobile UI Automation tool"; homepage = "https://maestro.mobile.dev/"; From 011eee0c557963d0e46bf7729cb573f31d4ed4a2 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sat, 14 Sep 2024 19:35:55 +0200 Subject: [PATCH 3/3] maestro: 1.37.9 -> 1.38.1 --- pkgs/by-name/ma/maestro/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ma/maestro/package.nix b/pkgs/by-name/ma/maestro/package.nix index 31be50e0c20c..e0f83c3ba4d1 100644 --- a/pkgs/by-name/ma/maestro/package.nix +++ b/pkgs/by-name/ma/maestro/package.nix @@ -10,11 +10,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "maestro"; - version = "1.37.9"; + version = "1.38.1"; src = fetchurl { url = "https://github.com/mobile-dev-inc/maestro/releases/download/cli-${finalAttrs.version}/maestro.zip"; - hash = "sha256-bWZuD2+v6molwW1ef2a3djBnVfYscBjILLGXeeSUmoU="; + hash = "sha256-AogEVg8R73x5Q/LxZamGbFacCqB8JZeERqyf+UPXBx0="; }; dontUnpack = true;