superfile: 1.1.6 -> 1.1.7 (#371308)
[NixPkgs.git] / pkgs / development / python-modules / cairocffi / default.nix
blobb871515bc42a1dae504de3001528873d54bb86a0
1 # FIXME: make gdk-pixbuf dependency optional
3   stdenv,
4   buildPythonPackage,
5   pythonOlder,
6   fetchPypi,
7   lib,
8   substituteAll,
9   pikepdf,
10   pytestCheckHook,
11   cairo,
12   cffi,
13   flit-core,
14   numpy,
15   withXcffib ? false,
16   xcffib,
17   glib,
18   gdk-pixbuf,
21 buildPythonPackage rec {
22   pname = "cairocffi";
23   version = "1.7.1";
24   format = "pyproject";
26   disabled = pythonOlder "3.7";
28   src = fetchPypi {
29     inherit pname version;
30     hash = "sha256-LkjuhkiE7Eo6NL+oyauZmfaIKG63FKFaQ+ydBow2VXs=";
31   };
33   patches = [
34     # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0
35     (substituteAll {
36       src = ./dlopen-paths.patch;
37       ext = stdenv.hostPlatform.extensions.sharedLibrary;
38       cairo = cairo.out;
39       glib = glib.out;
40       gdk_pixbuf = gdk-pixbuf.out;
41     })
42     ./fix_test_scaled_font.patch
43   ];
45   nativeBuildInputs = [ flit-core ];
47   propagatedBuildInputs = [
48     cairo
49     cffi
50   ] ++ lib.optional withXcffib xcffib;
52   nativeCheckInputs = [
53     numpy
54     pikepdf
55     pytestCheckHook
56   ];
58   pythonImportsCheck = [ "cairocffi" ];
60   meta = with lib; {
61     changelog = "https://github.com/Kozea/cairocffi/blob/v${version}/NEWS.rst";
62     homepage = "https://github.com/SimonSapin/cairocffi";
63     license = licenses.bsd3;
64     maintainers = [ ];
65     description = "cffi-based cairo bindings for Python";
66   };