Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / aggdraw / default.nix
blobef44979c4394c0606e08c3f2cecb188f92170184
1 { lib
2 , fetchFromGitHub
3 , fetchpatch
4 , buildPythonPackage
5 , packaging
6 , setuptools
7 , pkgconfig
8 , freetype
9 , pytest
10 , python
11 , pillow
12 , numpy
15 buildPythonPackage rec {
16   pname = "aggdraw";
17   version = "1.3.16";
18   format = "pyproject";
20   src = fetchFromGitHub {
21     owner = "pytroll";
22     repo = pname;
23     rev = "v${version}";
24     hash = "sha256-2yajhuRyQ7BqghbSgPClW3inpw4TW2DhgQbomcRFx94=";
25   };
27   patches = [
28     # Removes `register` storage class specifier, which is not allowed in C++17.
29     (fetchpatch {
30       url = "https://github.com/pytroll/aggdraw/commit/157ed49803567e8c3eeb7dfeff4c116db35747f7.patch";
31       hash = "sha256-QSzpO90u5oSBWUzehRFbXgZ1ApEfLlfp11MUx6w11aI=";
32     })
33   ];
35   nativeBuildInputs = [
36     packaging
37     setuptools
38     pkgconfig
39   ];
41   buildInputs = [
42     freetype
43   ];
45   nativeCheckInputs = [
46     numpy
47     pillow
48     pytest
49   ];
51   checkPhase = ''
52     runHook preCheck
53     ${python.interpreter} selftest.py
54     runHook postCheck
55   '';
57   pythonImportsCheck = [ "aggdraw" ];
59   meta = with lib; {
60     description = "High quality drawing interface for PIL";
61     homepage = "https://github.com/pytroll/aggdraw";
62     license = licenses.mit;
63     maintainers = with maintainers; [ onny ];
64   };