2019-03-19 09:20:05 +00:00
|
|
|
{ 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 = [ pytest pytestrunner glibcLocales ];
|
|
|
|
propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test $out/${python.sitePackages}
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
2019-05-22 12:03:39 +01:00
|
|
|
# OSError: dlopen() failed to load a library: gdk-pixbuf-2.0 / gdk-pixbuf-2.0-0
|
2019-03-19 09:20:05 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = dlopen_patch;
|
|
|
|
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
|
|
|
cairo = cairo.out;
|
|
|
|
glib = glib.out;
|
2019-05-22 12:03:39 +01:00
|
|
|
gdk_pixbuf = gdk-pixbuf.out;
|
2019-03-19 09:20:05 +00:00
|
|
|
})
|
|
|
|
./fix_test_scaled_font.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/SimonSapin/cairocffi";
|
2019-03-19 09:20:05 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [];
|
|
|
|
description = "cffi-based cairo bindings for Python";
|
|
|
|
};
|
|
|
|
}
|