summary refs log tree commit diff
path: root/pkgs/development/tools/flamegraph/default.nix
blob: 3a64d741de5c471a4083a00fa48134c8c6c56cf6 (plain) (blame)
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
{ lib, stdenv, fetchFromGitHub, perl }:

stdenv.mkDerivation rec {
  pname = "FlameGraph";
  version = "2019-02-16";

  src = fetchFromGitHub {
    owner = "brendangregg";
    repo = pname;
    rev = "1b1c6deede9c33c5134c920bdb7a44cc5528e9a7";
    sha256 = "1flvkmv2gbb003d51myl7r0wyhyw1bk9p7v19xagb8xjj4ci947b";
  };

  buildInputs = [ perl ];

  installPhase = ''
    runHook preInstall

    mkdir -p $out/bin
    for x in $src/*.pl $src/*.awk $src/dev/*.pl $src/dev/*.d; do
      cp $x $out/bin
    done

    runHook postInstall
  '';

  meta = with lib; {
    license = with licenses; [ asl20 cddl gpl2Plus ];
    homepage = "http://www.brendangregg.com/flamegraphs.html";
    description = "Visualization for profiled code";
    platforms = platforms.unix;
  };
}