summary refs log tree commit diff
path: root/pkgs/development/python-modules/python-fontconfig/default.nix
blob: 45c94cdb83b3e0f1d0769c02d9c7237059778198 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
{ lib, buildPythonPackage, fetchPypi, fontconfig, python, cython, freefont_ttf, makeFontsConf }:

let
  fontsConf = makeFontsConf {
    fontDirectories = [ freefont_ttf ];
  };
in buildPythonPackage rec {
  pname = "Python-fontconfig";
  version = "0.5.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "154rfd0ygcbj9y8m32n537b457yijpfx9dvmf76vi0rg4ikf7kxp";
  };

  buildInputs = [ fontconfig ];
  nativeBuildInputs = [ cython ];

  preBuild = ''
    ${python.pythonForBuild.interpreter} setup.py build_ext -i
  '';

  checkPhase = ''
    export FONTCONFIG_FILE=${fontsConf};
    echo y | ${python.interpreter} test/test.py
  '';

  meta = {
    homepage = "https://github.com/Vayn/python-fontconfig";
    description = "Python binding for Fontconfig";
    license = lib.licenses.gpl3;
    maintainers = with lib.maintainers; [ ];
  };
}