summary refs log blame commit diff
path: root/pkgs/development/tools/analysis/qcachegrind/default.nix
blob: 5ce79a092488344b4184690c179468c82c84a18b (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                                                
 


                                

                        
 
                                            
 
                                               
 

                        


                                                            
                                                                   







                                                                

                                                               
                                                                               

                                                                                                            

      



                                    
                    
                                                         
                                



                                                 
{ lib, stdenv, qmake, qtbase, perl, python2, php, kcachegrind, wrapQtAppsHook }:

stdenv.mkDerivation {
  pname = "qcachegrind";
  version = kcachegrind.version;

  src = kcachegrind.src;

  buildInputs = [ qtbase perl python2 php ];

  nativeBuildInputs = [ qmake wrapQtAppsHook ];

  dontWrapQtApps = true;

  postInstall = ''
     mkdir -p $out/bin
     cp -p converters/dprof2calltree $out/bin/dprof2calltree
     cp -p converters/hotshot2calltree.in $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"
  '');

  preFixup = ''
    wrapQtApp "$out/bin/qcachegrind"
  '';

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