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