Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / cairocffi / default.nix
blobfb0a81e202d97b6c3803b5e2497a169cb61c54be
1 # FIXME: make gdk-pixbuf dependency optional
2 { stdenv
3 , buildPythonPackage
4 , pythonOlder
5 , fetchPypi
6 , lib
7 , substituteAll
8 , makeFontsConf
9 , freefont_ttf
10 , pikepdf
11 , pytestCheckHook
12 , cairo
13 , cffi
14 , flit-core
15 , numpy
16 , withXcffib ? false
17 , xcffib
18 , glib
19 , gdk-pixbuf
22 buildPythonPackage rec {
23   pname = "cairocffi";
24   version = "1.6.1";
25   format = "pyproject";
27   disabled = pythonOlder "3.7";
29   src = fetchPypi {
30     inherit pname version;
31     hash = "sha256-eOa75HNXZAxFPQvpKfpJzQXM4uEobz0qHKnL2n79uLc=";
32   };
34   patches = [
35     # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0
36     (substituteAll {
37       src = ./dlopen-paths.patch;
38       ext = stdenv.hostPlatform.extensions.sharedLibrary;
39       cairo = cairo.out;
40       glib = glib.out;
41       gdk_pixbuf = gdk-pixbuf.out;
42     })
43     ./fix_test_scaled_font.patch
44   ];
46   nativeBuildInputs = [
47     flit-core
48   ];
50   propagatedBuildInputs = [ cairo cffi ]
51     ++ lib.optional withXcffib xcffib;
53   nativeCheckInputs = [
54     numpy
55     pikepdf
56     pytestCheckHook
57   ];
59   pythonImportsCheck = [
60     "cairocffi"
61   ];
63   meta = with lib; {
64     changelog = "https://github.com/Kozea/cairocffi/blob/v${version}/NEWS.rst";
65     homepage = "https://github.com/SimonSapin/cairocffi";
66     license = licenses.bsd3;
67     maintainers = with maintainers; [ ];
68     description = "cffi-based cairo bindings for Python";
69   };