From 30ac05c8b282fe03eb34befdf1c121594e572b91 Mon Sep 17 00:00:00 2001 From: emaryn Date: Tue, 15 Apr 2025 23:58:31 +0800 Subject: [PATCH] ahoy: 2.2.0 -> 2.4.0 --- pkgs/by-name/ah/ahoy/package.nix | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pkgs/by-name/ah/ahoy/package.nix b/pkgs/by-name/ah/ahoy/package.nix index a1bd10628946..3ce01640ca15 100644 --- a/pkgs/by-name/ah/ahoy/package.nix +++ b/pkgs/by-name/ah/ahoy/package.nix @@ -2,33 +2,42 @@ lib, fetchFromGitHub, buildGoModule, + versionCheckHook, nix-update-script, }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "ahoy"; - version = "2.2.0"; + version = "2.4.0"; src = fetchFromGitHub { owner = "ahoy-cli"; repo = "ahoy"; - tag = "v${version}"; - hash = "sha256-xwjfY9HudxVz3xEEyRPtWysbojtan56ABBL3KgG0J/8="; + tag = "v${finalAttrs.version}"; + hash = "sha256-wYsPutdO9ZkXQu4mrFV56mrJTeSFF/3oRaHO0ia7DHk="; }; + sourceRoot = "${finalAttrs.src.name}/v2"; + # vendor folder exists vendorHash = null; - passthru = { - updateScript = nix-update-script { }; - }; + ldflags = [ "-X main.version=${finalAttrs.version}" ]; + + doInstallCheck = true; + + nativeInstallCheckInputs = [ versionCheckHook ]; + + versionCheckProgramArg = "--version"; + + passthru.updateScript = nix-update-script { }; meta = { description = "Create self-documenting cli programs from YAML files"; homepage = "https://github.com/ahoy-cli/ahoy"; - changelog = "https://github.com/ahoy-cli/ahoy/releases/tag/v${version}"; + changelog = "https://github.com/ahoy-cli/ahoy/releases/tag/v${finalAttrs.version}"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ genga898 ]; mainProgram = "ahoy"; }; -} +})