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