diff options
Diffstat (limited to 'pkgs/development/python-modules/graphviz/default.nix')
-rw-r--r-- | pkgs/development/python-modules/graphviz/default.nix | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/pkgs/development/python-modules/graphviz/default.nix b/pkgs/development/python-modules/graphviz/default.nix index 3e9ee8b17f7c..572fdcaee51a 100644 --- a/pkgs/development/python-modules/graphviz/default.nix +++ b/pkgs/development/python-modules/graphviz/default.nix @@ -1,25 +1,51 @@ -{ stdenv +{ lib , buildPythonPackage -, fetchPypi -, pkgs +, fetchFromGitHub +, substituteAll +, graphviz +, makeFontsConf +, freefont_ttf +, mock +, pytest +, pytest-mock +, pytestcov }: buildPythonPackage rec { pname = "graphviz"; version = "0.10.1"; - src = fetchPypi { - inherit pname version; - extension = "zip"; - sha256 = "d311be4fddfe832a56986ac5e1d6e8715d7fcb0208560da79d1bb0f72abef41f"; + # patch does not apply to PyPI tarball due to different line endings + src = fetchFromGitHub { + owner = "xflr6"; + repo = "graphviz"; + rev = version; + sha256 = "1vqk4xy45c72la56j24z9jmjp5a0aa2k32fybnlbkzqjvvbl72d8"; }; - propagatedBuildInputs = [ pkgs.graphviz ]; + patches = [ + (substituteAll { + src = ./hardcode-graphviz-path.patch; + inherit graphviz; + }) + ]; - meta = with stdenv.lib; { + # Fontconfig error: Cannot load default config file + FONTCONFIG_FILE = makeFontsConf { + fontDirectories = [ freefont_ttf ]; + }; + + checkInputs = [ mock pytest pytest-mock pytestcov ]; + + checkPhase = '' + pytest + ''; + + meta = with lib; { description = "Simple Python interface for Graphviz"; homepage = https://github.com/xflr6/graphviz; license = licenses.mit; + maintainers = with maintainers; [ dotlambda ]; }; } |