2021-10-17 09:34:42 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
2023-07-15 17:15:38 +00:00
|
|
|
, fetchFromGitHub
|
2021-10-17 09:34:42 +00:00
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "hyperfine";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "1.17.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sharkdp";
|
|
|
|
repo = "hyperfine";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-IUjOklkEiy/U2HjjMt1X1uSpIkTAYOPiPQ+70xvvxKA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
cargoHash = "sha256-VjkcQueBODEADHdWOts2f3Zjar43hi0UXzVhvkK4o8I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = lib.optional stdenv.isDarwin Security;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-06-02 18:00:15 +00:00
|
|
|
postInstall = ''
|
|
|
|
installManPage doc/hyperfine.1
|
|
|
|
|
|
|
|
installShellCompletion \
|
|
|
|
$releaseDir/build/hyperfine-*/out/hyperfine.{bash,fish} \
|
|
|
|
--zsh $releaseDir/build/hyperfine-*/out/_hyperfine
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Command-line benchmarking tool";
|
2021-10-17 09:34:42 +00:00
|
|
|
homepage = "https://github.com/sharkdp/hyperfine";
|
|
|
|
changelog = "https://github.com/sharkdp/hyperfine/blob/v${version}/CHANGELOG.md";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = with maintainers; [ figsoda thoughtpolice ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|