Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 20.09 1.2 kB view raw
1{ version 2, sha256 3, dlopen_patch 4, disabled ? false 5, ... 6}@args: 7 8with args; 9 10buildPythonPackage rec { 11 pname = "cairocffi"; 12 inherit version disabled; 13 14 src = fetchPypi { 15 inherit pname version sha256; 16 }; 17 18 LC_ALL = "en_US.UTF-8"; 19 20 # checkPhase require at least one 'normal' font and one 'monospace', 21 # otherwise glyph tests fails 22 FONTCONFIG_FILE = makeFontsConf { 23 fontDirectories = [ freefont_ttf ]; 24 }; 25 26 checkInputs = [ pytest pytestrunner glibcLocales ]; 27 propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib; 28 29 checkPhase = '' 30 py.test $out/${python.sitePackages} 31 ''; 32 33 patches = [ 34 # OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0 35 (substituteAll { 36 src = dlopen_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 ]; 44 45 meta = with lib; { 46 homepage = "https://github.com/SimonSapin/cairocffi"; 47 license = licenses.bsd3; 48 maintainers = with maintainers; []; 49 description = "cffi-based cairo bindings for Python"; 50 }; 51}