1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 installShellFiles,
6}:
7
8rustPlatform.buildRustPackage rec {
9 pname = "hyperfine";
10 version = "1.19.0";
11
12 src = fetchFromGitHub {
13 owner = "sharkdp";
14 repo = "hyperfine";
15 rev = "v${version}";
16 hash = "sha256-c8yK9U8UWRWUSGGGrAds6zAqxAiBLWq/RcZ6pvYNpgk=";
17 };
18
19 cargoHash = "sha256-eZpGqkowp/R//RqLRk3AIbTpW3i9e+lOWpfdli7S4uE=";
20
21 nativeBuildInputs = [ installShellFiles ];
22
23 postInstall = ''
24 installManPage doc/hyperfine.1
25
26 installShellCompletion \
27 $releaseDir/build/hyperfine-*/out/hyperfine.{bash,fish} \
28 --zsh $releaseDir/build/hyperfine-*/out/_hyperfine
29 '';
30
31 meta = {
32 description = "Command-line benchmarking tool";
33 homepage = "https://github.com/sharkdp/hyperfine";
34 changelog = "https://github.com/sharkdp/hyperfine/blob/v${version}/CHANGELOG.md";
35 license = with lib.licenses; [
36 asl20 # or
37 mit
38 ];
39 maintainers = with lib.maintainers; [
40 figsoda
41 thoughtpolice
42 ];
43 mainProgram = "hyperfine";
44 };
45}