1{ lib
2, fetchFromGitHub
3, fetchpatch
4, buildPythonPackage
5, packaging
6, setuptools
7, pkgconfig
8, freetype
9, pytest
10, python
11, pillow
12, numpy
13}:
14
15buildPythonPackage rec {
16 pname = "aggdraw";
17 version = "1.3.16";
18 format = "pyproject";
19
20 src = fetchFromGitHub {
21 owner = "pytroll";
22 repo = pname;
23 rev = "v${version}";
24 hash = "sha256-2yajhuRyQ7BqghbSgPClW3inpw4TW2DhgQbomcRFx94=";
25 };
26
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 ];
34
35 nativeBuildInputs = [
36 packaging
37 setuptools
38 pkgconfig
39 ];
40
41 buildInputs = [
42 freetype
43 ];
44
45 nativeCheckInputs = [
46 numpy
47 pillow
48 pytest
49 ];
50
51 checkPhase = ''
52 runHook preCheck
53 ${python.interpreter} selftest.py
54 runHook postCheck
55 '';
56
57 pythonImportsCheck = [ "aggdraw" ];
58
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 };
65}