From e9f23698d0562cd4dce6abd9d28fa70ad3550db6 Mon Sep 17 00:00:00 2001 From: Gaetan Lepage Date: Fri, 3 Jan 2025 21:35:47 +0100 Subject: [PATCH] helix: 24.07 -> 25.01 Diff: https://github.com/helix-editor/helix/compare/None...25.01 --- pkgs/by-name/he/helix/package.nix | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/he/helix/package.nix b/pkgs/by-name/he/helix/package.nix index 1a918acf6e31..549e1ca1b2ba 100644 --- a/pkgs/by-name/he/helix/package.nix +++ b/pkgs/by-name/he/helix/package.nix @@ -4,21 +4,23 @@ rustPlatform, git, installShellFiles, + versionCheckHook, + nix-update-script, }: rustPlatform.buildRustPackage rec { pname = "helix"; - version = "24.07"; + version = "25.01"; # This release tarball includes source code for the tree-sitter grammars, # which is not ordinarily part of the repository. src = fetchzip { url = "https://github.com/helix-editor/helix/releases/download/${version}/helix-${version}-source.tar.xz"; - hash = "sha256-R8foMx7YJ01ZS75275xPQ52Ns2EB3OPop10F4nicmoA="; + hash = "sha256-HyDsHimDug+8vX0wfon4pK0DEYH5402CDinp3EZpaWs="; stripRoot = false; }; - cargoHash = "sha256-Y8zqdS8vl2koXmgFY0hZWWP1ZAO8JgwkoPTYPVpkWsA="; + cargoHash = "sha256-G3gJRI12JFk+A4DP65TOcD9jBJvNrb4aPr9V9uv4JP0="; nativeBuildInputs = [ git @@ -39,12 +41,28 @@ rustPlatform.buildRustPackage rec { cp contrib/helix.png $out/share/icons/hicolor/256x256/apps ''; - meta = with lib; { + nativeInstallCheckInputs = [ + versionCheckHook + ]; + # `hx --version` outputs 25.1 instead of 25.01 + preVersionCheck = '' + export version=${lib.replaceStrings [ ".0" ] [ "." ] version} + ''; + versionCheckProgram = "${placeholder "out"}/bin/hx"; + versionCheckProgramArg = [ "--version" ]; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + + meta = { description = "Post-modern modal text editor"; homepage = "https://helix-editor.com"; - license = licenses.mpl20; + changelog = "https://github.com/helix-editor/helix/blob/${version}/CHANGELOG.md"; + license = lib.licenses.mpl20; mainProgram = "hx"; - maintainers = with maintainers; [ + maintainers = with lib.maintainers; [ danth yusdacra zowoq