2021-01-05 17:05:55 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, perf, nix-update-script
|
2020-04-24 23:36:52 +00:00
|
|
|
, Security
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "cargo-flamegraph";
|
2023-01-11 07:51:40 +00:00
|
|
|
version = "0.6.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "flamegraph-rs";
|
|
|
|
repo = "flamegraph";
|
|
|
|
rev = "v${version}";
|
2023-01-11 07:51:40 +00:00
|
|
|
sha256 = "sha256-LYoyMEALxeUQQI2pBL1u0Q9rrwyy6N6Dg5bNxhJiVrM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
cargoSha256 = "sha256-t8+bjTRQMuXTYhgW1NuC3MXsRh2SMeycyyq4x1nb9MU=";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = lib.optionals stdenv.isLinux [ makeWrapper ];
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
Security
|
|
|
|
];
|
|
|
|
|
|
|
|
postFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
wrapProgram $out/bin/cargo-flamegraph \
|
2021-01-05 17:05:55 +00:00
|
|
|
--set-default PERF ${perf}/bin/perf
|
2020-04-24 23:36:52 +00:00
|
|
|
wrapProgram $out/bin/flamegraph \
|
2021-01-05 17:05:55 +00:00
|
|
|
--set-default PERF ${perf}/bin/perf
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
2021-01-05 17:05:55 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Easy flamegraphs for Rust projects and everything else, without Perl or pipes <3";
|
2022-12-17 10:02:37 +00:00
|
|
|
homepage = "https://github.com/flamegraph-rs/flamegraph";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
|
|
|
maintainers = with maintainers; [ killercup ];
|
|
|
|
};
|
|
|
|
}
|