about summary refs log tree commit diff
path: root/pkgs/development/python-modules/freetype-py/default.nix
blob: ccc048c1fccb69d5a395278f31a6e25eb5f4a245 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
{ lib
, stdenv
, buildPythonPackage
, fetchPypi
, substituteAll
, setuptools-scm
, freetype
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "freetype-py";
  version = "2.1.0.post1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "1k62fx53qrv9nb73mpqi2r11wzbx41qfv5qppvh6rylywnrknf3n";
  };

  patches = [
    (substituteAll {
      src = ./library-paths.patch;
      freetype = "${freetype.out}/lib/libfreetype${stdenv.hostPlatform.extensions.sharedLibrary}";
    })
  ];

  nativeBuildInputs = [ setuptools-scm ];

  propagatedBuildInputs = [ freetype ];

  preCheck = ''
    cd tests
  '';

  nativeCheckInputs = [
    pytestCheckHook
  ];

  pythonImportsCheck =  [ "freetype" ];

  meta = with lib; {
    homepage = "https://github.com/rougier/freetype-py";
    description = "FreeType (high-level Python API)";
    license = licenses.bsd3;
    maintainers = with maintainers; [ goertzenator ];
  };
}