about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/analysis/qcachegrind/default.nix
blob: d9f39667ceff1e631c1a60b16ce00a0bbc3b3fd5 (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
34
35
36
37
38
39
40
{ stdenv, qmake, qtbase, perl, python, php, kcachegrind }:

let
  name = stdenv.lib.replaceStrings ["kcachegrind"] ["qcachegrind"] kcachegrind.name;

in stdenv.mkDerivation {
  inherit name;

  src = kcachegrind.src;

  buildInputs = [ qtbase perl python php ];

  nativeBuildInputs = [ qmake ];

  postInstall = ''
     mkdir -p $out/bin
     cp -p converters/dprof2calltree $out/bin/dprof2calltree
     cp -p converters/hotshot2calltree.cmake $out/bin/hotshot2calltree
     cp -p converters/memprof2calltree $out/bin/memprof2calltree
     cp -p converters/op2calltree $out/bin/op2calltree
     cp -p converters/pprof2calltree $out/bin/pprof2calltree
     chmod -R +x $out/bin/
  '' + (if stdenv.isDarwin then ''
    mkdir -p $out/Applications
    cp cgview/cgview.app/Contents/MacOS/cgview $out/bin
    cp -a qcachegrind/qcachegrind.app $out/Applications
  '' else ''
    install qcachegrind/qcachegrind cgview/cgview -t "$out/bin"
    install -Dm644 qcachegrind/qcachegrind.desktop -t "$out/share/applications"
    install -Dm644 kcachegrind/32-apps-kcachegrind.png "$out/share/icons/hicolor/32x32/apps/kcachegrind.png"
    install -Dm644 kcachegrind/48-apps-kcachegrind.png "$out/share/icons/hicolor/48x48/apps/kcachegrind.png"
  '');

  meta = with stdenv.lib; {
    description = "A Qt GUI to visualize profiling data";
    license = licenses.gpl2;
    platforms = platforms.unix;
    maintainers = with maintainers; [ periklis ];
  };
}