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