From 97fe54215d9d1c3631540889124fcff57608aed5 Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 4 Feb 2025 13:35:55 +0100 Subject: [PATCH 1/2] hashrat: refactor --- pkgs/by-name/ha/hashrat/package.nix | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/ha/hashrat/package.nix b/pkgs/by-name/ha/hashrat/package.nix index e63122a05ef7..728d4d64aae0 100644 --- a/pkgs/by-name/ha/hashrat/package.nix +++ b/pkgs/by-name/ha/hashrat/package.nix @@ -3,16 +3,18 @@ stdenv, fetchFromGitHub, fetchpatch, + versionCheckHook, + nix-update-script, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "hashrat"; version = "1.22"; src = fetchFromGitHub { owner = "ColumPaget"; repo = "Hashrat"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-mjjK315OUUFVdUY+zcCvm7yeo7XxourR1sghWbeFT7c="; }; @@ -29,16 +31,23 @@ stdenv.mkDerivation rec { makeFlags = [ "PREFIX=$(out)" ]; - meta = with lib; { + nativeInstallCheckInputs = [ versionCheckHook ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru.updateScript = nix-update-script { }; + + meta = { description = "Command-line hash-generation utility"; mainProgram = "hashrat"; longDescription = '' Hashing tool supporting md5,sha1,sha256,sha512,whirlpool,jh and hmac versions of these. Includes recursive file hashing and other features. ''; - homepage = "http://www.cjpaget.co.uk/Code/Hashrat"; - license = licenses.gpl3Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ zendo ]; + homepage = "https://github.com/ColumPaget/Hashrat"; + changelog = "https://github.com/ColumPaget/Hashrat/blob/v${finalAttrs.version}/CHANGELOG"; + license = lib.licenses.gpl3Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ zendo ]; }; -} +}) From 06514608e1baf39ae29c0ac6bee1bbba862b9a8d Mon Sep 17 00:00:00 2001 From: Defelo Date: Tue, 4 Feb 2025 13:40:02 +0100 Subject: [PATCH 2/2] hashrat: 1.22 -> 1.23 --- pkgs/by-name/ha/hashrat/package.nix | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/pkgs/by-name/ha/hashrat/package.nix b/pkgs/by-name/ha/hashrat/package.nix index 728d4d64aae0..3c215d1e2474 100644 --- a/pkgs/by-name/ha/hashrat/package.nix +++ b/pkgs/by-name/ha/hashrat/package.nix @@ -2,31 +2,21 @@ lib, stdenv, fetchFromGitHub, - fetchpatch, versionCheckHook, nix-update-script, }: stdenv.mkDerivation (finalAttrs: { pname = "hashrat"; - version = "1.22"; + version = "1.23"; src = fetchFromGitHub { owner = "ColumPaget"; repo = "Hashrat"; tag = "v${finalAttrs.version}"; - hash = "sha256-mjjK315OUUFVdUY+zcCvm7yeo7XxourR1sghWbeFT7c="; + hash = "sha256-dDtn01eoODgRtsbEdtuXhib3fZLosP8ajJBGaG8Skss="; }; - patches = [ - # fix cross compilation by replacing hardcoded ar with AC_PROG_AR - # https://github.com/ColumPaget/Hashrat/pull/27 - (fetchpatch { - url = "https://github.com/ColumPaget/Hashrat/commit/a82615e02021245850a1703e613055da2520c8fd.patch"; - hash = "sha256-tjyhM2ahZBRoRP8WjyQhrI3l20oaqMtfYmOeAZVEZqU="; - }) - ]; - configureFlags = [ "--enable-xattr" ]; makeFlags = [ "PREFIX=$(out)" ];