2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, rustPlatform
|
|
|
|
, fetchCrate
|
|
|
|
, jq
|
|
|
|
, moreutils
|
|
|
|
, stdenv
|
|
|
|
, darwin
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "samply";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.12.0";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchCrate {
|
|
|
|
inherit pname version;
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-7bf1lDIZGhRpvnn8rHNwzH2GBY8CwtYCjuRAUTQgbsA=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
cargoHash = "sha256-QGvtKx+l6+UxdlziHnF63geAvW55RRlatK2/J8LR0Ck=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
# the dependencies linux-perf-data and linux-perf-event-reader contains both README.md and Readme.md,
|
|
|
|
# which causes a hash mismatch on systems with a case-insensitive filesystem
|
|
|
|
# this removes the readme files and updates cargo's checksum file accordingly
|
|
|
|
depsExtraArgs = {
|
|
|
|
nativeBuildInputs = [
|
|
|
|
jq
|
|
|
|
moreutils
|
|
|
|
];
|
|
|
|
|
|
|
|
postBuild = ''
|
|
|
|
for crate in linux-perf-data linux-perf-event-reader; do
|
|
|
|
pushd $name/$crate
|
|
|
|
|
|
|
|
rm -f README.md Readme.md
|
|
|
|
jq 'del(.files."README.md") | del(.files."Readme.md")' \
|
|
|
|
.cargo-checksum.json -c \
|
|
|
|
| sponge .cargo-checksum.json
|
|
|
|
|
|
|
|
popd
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.apple_sdk.frameworks.CoreServices
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A command line profiler for macOS and Linux";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "samply";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://github.com/mstange/samply";
|
|
|
|
changelog = "https://github.com/mstange/samply/releases/tag/samply-v${version}";
|
|
|
|
license = with licenses; [ asl20 mit ];
|
|
|
|
maintainers = with maintainers; [ figsoda ];
|
|
|
|
};
|
|
|
|
}
|