depot/third_party/nixpkgs/pkgs/development/python-modules/cairocffi/default.nix
Default email d5f4a57cbf Project import generated by Copybara.
GitOrigin-RevId: ce5e4a6ef2e59d89a971bc434ca8ca222b9c7f5e
2023-08-10 09:59:29 +02:00

69 lines
1.4 KiB
Nix

# FIXME: make gdk-pixbuf dependency optional
{ stdenv
, buildPythonPackage
, pythonOlder
, fetchPypi
, lib
, substituteAll
, makeFontsConf
, freefont_ttf
, pikepdf
, pytestCheckHook
, cairo
, cffi
, numpy
, withXcffib ? false
, xcffib
, glib
, gdk-pixbuf
, setuptools
}:
buildPythonPackage rec {
pname = "cairocffi";
version = "1.5.1";
disabled = pythonOlder "3.7";
format = "pyproject";
src = fetchPypi {
inherit pname version;
hash = "sha256-Bxq3ty41MzALC/1VpSBWtP/cHtbmVneeKs7Ztwm4opU=";
};
patches = [
# OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0
(substituteAll {
src = ./dlopen-paths.patch;
ext = stdenv.hostPlatform.extensions.sharedLibrary;
cairo = cairo.out;
glib = glib.out;
gdk_pixbuf = gdk-pixbuf.out;
})
./fix_test_scaled_font.patch
];
nativeBuildInputs = [
setuptools
];
propagatedNativeBuildInputs = [ cffi ];
propagatedBuildInputs = [ cairo cffi ]
++ lib.optional withXcffib xcffib;
nativeCheckInputs = [
numpy
pikepdf
pytestCheckHook
];
meta = with lib; {
changelog = "https://github.com/Kozea/cairocffi/blob/v${version}/NEWS.rst";
homepage = "https://github.com/SimonSapin/cairocffi";
license = licenses.bsd3;
maintainers = with maintainers; [ ];
description = "cffi-based cairo bindings for Python";
};
}