-
-
Notifications
You must be signed in to change notification settings - Fork 15.1k
/
Copy pathdefault.nix
56 lines (47 loc) · 1.42 KB
/
default.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
{ lib
, rustPlatform
, fetchCrate
, jq
, moreutils
, stdenv
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "samply";
version = "0.12.0";
src = fetchCrate {
inherit pname version;
hash = "sha256-7bf1lDIZGhRpvnn8rHNwzH2GBY8CwtYCjuRAUTQgbsA=";
};
cargoHash = "sha256-QGvtKx+l6+UxdlziHnF63geAvW55RRlatK2/J8LR0Ck=";
# 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 = "Command line profiler for macOS and Linux";
mainProgram = "samply";
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 ];
};
}