1{ lib, buildPythonPackage, fetchPypi, isPy3k, python, xvfb-run
2, wrapGAppsHook, gobject-introspection, pygobject3, graphviz, gtk3, numpy }:
3
4buildPythonPackage rec {
5 pname = "xdot";
6 version = "1.2";
7
8 src = fetchPypi {
9 inherit pname version;
10 sha256 = "3df91e6c671869bd2a6b2a8883fa3476dbe2ba763bd2a7646cf848a9eba71b70";
11 };
12
13 disabled = !isPy3k;
14 nativeBuildInputs = [ gobject-introspection wrapGAppsHook ];
15 propagatedBuildInputs = [ pygobject3 graphviz gtk3 numpy ];
16 nativeCheckInputs = [ xvfb-run ];
17
18 postInstall = ''
19 wrapProgram "$out/bin/xdot" --prefix PATH : "${lib.makeBinPath [ graphviz ]}"
20 '';
21
22 checkPhase = ''
23 xvfb-run -s '-screen 0 800x600x24' ${python.interpreter} nix_run_setup test
24 '';
25
26 # https://github.com/NixOS/nixpkgs/pull/107872#issuecomment-752175866
27 # cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import)
28 doCheck = false;
29
30 meta = with lib; {
31 description = "An interactive viewer for graphs written in Graphviz's dot";
32 homepage = "https://github.com/jrfonseca/xdot.py";
33 license = licenses.lgpl3Plus;
34 };
35}