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