1{ lib
2, fetchFromGitHub
3, buildPythonApplication
4, python
5, graphviz
6}:
7
8buildPythonApplication rec {
9 pname = "gprof2dot";
10 version = "2021.02.21";
11
12 src = fetchFromGitHub {
13 owner = "jrfonseca";
14 repo = "gprof2dot";
15 rev = version;
16 sha256 = "1jjhsjf5fdi1fkn7mvhnzkh6cynl8gcjrygd3cya5mmda3akhzic";
17 };
18
19 makeWrapperArgs = [
20 "--prefix PATH : ${lib.makeBinPath [ graphviz ]}"
21 ];
22
23 # Needed so dot is on path of the test script
24 checkInputs = [ graphviz ];
25
26 checkPhase = ''
27 runHook preCheck
28
29 # if options not specified, will use unwrapped gprof2dot from original source
30 ${python.interpreter} tests/test.py --python bash --gprof2dot $out/bin/gprof2dot
31
32 runHook postCheck
33 '';
34
35 meta = with lib; {
36 homepage = "https://github.com/jrfonseca/gprof2dot";
37 description = "Python script to convert the output from many profilers into a dot graph";
38 license = licenses.lgpl3Plus;
39 maintainers = [ maintainers.pmiddend ];
40 };
41}