kora-icon-theme: 1.6.1 -> 1.6.2 (#363744)
[NixPkgs.git] / pkgs / development / tools / rbspy / default.nix
bloba989d85fd6b77813c696349389bc01660f2b09f1
2   lib,
3   stdenv,
4   rustPlatform,
5   fetchFromGitHub,
6   ruby,
7   which,
8   nix-update-script,
9 }:
11 rustPlatform.buildRustPackage rec {
12   pname = "rbspy";
13   version = "0.27.0";
15   src = fetchFromGitHub {
16     owner = "rbspy";
17     repo = "rbspy";
18     rev = "refs/tags/v${version}";
19     hash = "sha256-K5zDM7HhSNklCMoj3yh5lf0HTITOl2UYXW0QCxDF2GU=";
20   };
22   cargoHash = "sha256-2yYv7Pp6UqHTPrmG4BM0py3GoPYYJW7e9LQSrgxx/3A=";
24   # error: linker `aarch64-linux-gnu-gcc` not found
25   postPatch = ''
26     rm .cargo/config
27   '';
29   doCheck = true;
31   # The current implementation of rbspy fails to detect the version of ruby
32   # from nixpkgs during tests.
33   preCheck = ''
34     substituteInPlace src/core/process.rs \
35       --replace /usr/bin/which '${which}/bin/which'
36     substituteInPlace src/sampler/mod.rs \
37       --replace /usr/bin/which '${which}/bin/which'
38   '';
40   checkFlags = [
41     "--skip=test_get_trace"
42     "--skip=test_get_trace_when_process_has_exited"
43     "--skip=test_sample_single_process"
44     "--skip=test_sample_single_process_with_time_limit"
45     "--skip=test_sample_subprocesses"
46   ];
48   nativeBuildInputs = [
49     ruby
50     which
51   ] ++ lib.optional stdenv.hostPlatform.isDarwin rustPlatform.bindgenHook;
53   passthru.updateScript = nix-update-script { };
55   meta = with lib; {
56     homepage = "https://rbspy.github.io/";
57     description = "Sampling CPU Profiler for Ruby";
58     mainProgram = "rbspy";
59     changelog = "https://github.com/rbspy/rbspy/releases/tag/v${version}";
60     license = licenses.mit;
61     maintainers = with maintainers; [ viraptor ];
62     platforms = platforms.linux ++ platforms.darwin;
63   };