depot/third_party/nixpkgs/pkgs/development/python-modules/cairocffi/generic.nix
Default email 849ee4d900 Project import generated by Copybara.
GitOrigin-RevId: 9e377a6ce42dccd9b624ae4ce8f978dc892ba0e2
2021-04-08 18:26:57 +02:00

51 lines
1.1 KiB
Nix

{ version
, sha256
, dlopen_patch
, disabled ? false
, ...
}@args:
with args;
buildPythonPackage rec {
pname = "cairocffi";
inherit version disabled;
src = fetchPypi {
inherit pname version sha256;
};
LC_ALL = "en_US.UTF-8";
# checkPhase require at least one 'normal' font and one 'monospace',
# otherwise glyph tests fails
FONTCONFIG_FILE = makeFontsConf {
fontDirectories = [ freefont_ttf ];
};
checkInputs = [ numpy pytest pytestrunner glibcLocales ];
propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib;
checkPhase = ''
py.test $out/${python.sitePackages}
'';
patches = [
# OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0
(substituteAll {
src = dlopen_patch;
ext = stdenv.hostPlatform.extensions.sharedLibrary;
cairo = cairo.out;
glib = glib.out;
gdk_pixbuf = gdk-pixbuf.out;
})
./fix_test_scaled_font.patch
];
meta = with lib; {
homepage = "https://github.com/SimonSapin/cairocffi";
license = licenses.bsd3;
maintainers = with maintainers; [];
description = "cffi-based cairo bindings for Python";
};
}