Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at master 1.5 kB view raw
1# FIXME: make gdk-pixbuf dependency optional 2{ 3 stdenv, 4 buildPythonPackage, 5 pythonOlder, 6 fetchPypi, 7 lib, 8 replaceVars, 9 pikepdf, 10 pytestCheckHook, 11 cairo, 12 cffi, 13 flit-core, 14 numpy, 15 withXcffib ? false, 16 xcffib, 17 glib, 18 gdk-pixbuf, 19}: 20 21buildPythonPackage rec { 22 pname = "cairocffi"; 23 version = "1.7.1"; 24 format = "pyproject"; 25 26 disabled = pythonOlder "3.7"; 27 28 src = fetchPypi { 29 inherit pname version; 30 hash = "sha256-LkjuhkiE7Eo6NL+oyauZmfaIKG63FKFaQ+ydBow2VXs="; 31 }; 32 33 patches = [ 34 # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0 35 (replaceVars ./dlopen-paths.patch { 36 ext = stdenv.hostPlatform.extensions.sharedLibrary; 37 cairo = cairo.out; 38 glib = glib.out; 39 gdk_pixbuf = gdk-pixbuf.out; 40 }) 41 ./fix_test_scaled_font.patch 42 ]; 43 44 nativeBuildInputs = [ flit-core ]; 45 46 propagatedBuildInputs = [ 47 cairo 48 cffi 49 ] 50 ++ lib.optional withXcffib xcffib; 51 52 nativeCheckInputs = [ 53 numpy 54 pikepdf 55 pytestCheckHook 56 ]; 57 58 pythonImportsCheck = [ "cairocffi" ]; 59 60 # Cairo tries to load system fonts by default. 61 # It's surfaced as a Cairo "out of memory" error in tests. 62 __impureHostDeps = [ "/System/Library/Fonts" ]; 63 64 meta = with lib; { 65 changelog = "https://github.com/Kozea/cairocffi/blob/v${version}/NEWS.rst"; 66 homepage = "https://github.com/SimonSapin/cairocffi"; 67 license = licenses.bsd3; 68 maintainers = [ ]; 69 description = "cffi-based cairo bindings for Python"; 70 }; 71}