Merge pull request #119126 from fabaff/pycomfoconnect
[NixPkgs.git] / pkgs / development / python-modules / python-fontconfig / default.nix
blob88778ff794eafeeb4f7b501207217f7bd348871d
1 { lib, buildPythonPackage, fetchPypi, fontconfig, python, cython, freefont_ttf, makeFontsConf }:
3 let
4   fontsConf = makeFontsConf {
5     fontDirectories = [ freefont_ttf ];
6   };
7 in buildPythonPackage rec {
8   pname = "Python-fontconfig";
9   version = "0.5.1";
11   src = fetchPypi {
12     inherit pname version;
13     sha256 = "154rfd0ygcbj9y8m32n537b457yijpfx9dvmf76vi0rg4ikf7kxp";
14   };
16   buildInputs = [ fontconfig ];
17   nativeBuildInputs = [ cython ];
19   preBuild = ''
20     ${python.interpreter} setup.py build_ext -i
21   '';
23   checkPhase = ''
24     export FONTCONFIG_FILE=${fontsConf};
25     echo y | ${python.interpreter} test/test.py
26   '';
28   meta = {
29     homepage = "https://github.com/Vayn/python-fontconfig";
30     description = "Python binding for Fontconfig";
31     license = lib.licenses.gpl3;
32     maintainers = with lib.maintainers; [ gnidorah ];
33   };