diff options
Diffstat (limited to 'pkgs/development/python-modules/xdot/default.nix')
-rw-r--r-- | pkgs/development/python-modules/xdot/default.nix | 58 |
1 files changed, 42 insertions, 16 deletions
diff --git a/pkgs/development/python-modules/xdot/default.nix b/pkgs/development/python-modules/xdot/default.nix index cd7fdd9a218..3e1ce8b1477 100644 --- a/pkgs/development/python-modules/xdot/default.nix +++ b/pkgs/development/python-modules/xdot/default.nix @@ -1,31 +1,57 @@ -{ lib, buildPythonPackage, fetchPypi, isPy3k, python, xvfb-run -, wrapGAppsHook, gobject-introspection, pygobject3, graphviz, gtk3, numpy }: +{ lib +, buildPythonPackage +, fetchFromGitHub +, python +, xvfb-run +, wrapGAppsHook +, gobject-introspection +, pygobject3 +, graphviz +, gtk3 +, numpy +}: buildPythonPackage rec { pname = "xdot"; - version = "1.2"; + version = "1.3"; - src = fetchPypi { - inherit pname version; - sha256 = "3df91e6c671869bd2a6b2a8883fa3476dbe2ba763bd2a7646cf848a9eba71b70"; + src = fetchFromGitHub { + owner = "jrfonseca"; + repo = "xdot.py"; + rev = version; + hash = "sha256-0UfvN7z7ThlFu825h03Z5Wur9zbiUpvD5cb5gcIhQQI="; }; - disabled = !isPy3k; - nativeBuildInputs = [ gobject-introspection wrapGAppsHook ]; - propagatedBuildInputs = [ pygobject3 graphviz gtk3 numpy ]; - nativeCheckInputs = [ xvfb-run ]; + nativeBuildInputs = [ + gobject-introspection + wrapGAppsHook + ]; + propagatedBuildInputs = [ + pygobject3 + graphviz + gtk3 + numpy + ]; + nativeCheckInputs = [ + xvfb-run + ]; - postInstall = '' - wrapProgram "$out/bin/xdot" --prefix PATH : "${lib.makeBinPath [ graphviz ]}" + dontWrapGApps = true; + # Arguments to be passed to `makeWrapper`, only used by buildPython* + preFixup = '' + makeWrapperArgs+=("''${gappsWrapperArgs[@]}") + makeWrapperArgs+=(--prefix PATH : ${lib.makeBinPath [ graphviz ]}) ''; checkPhase = '' - xvfb-run -s '-screen 0 800x600x24' ${python.interpreter} nix_run_setup test + runHook preCheck + + xvfb-run -s '-screen 0 800x600x24' ${python.interpreter} test.py + + runHook postCheck ''; - # https://github.com/NixOS/nixpkgs/pull/107872#issuecomment-752175866 - # cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) - doCheck = false; + doCheck = true; meta = with lib; { description = "An interactive viewer for graphs written in Graphviz's dot"; |