nixpkgs/pkgs/development/python-modules/cairocffi/generic.nix

52 lines
1.1 KiB
Nix
Raw Normal View History

{ 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
(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;
})
./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";
};
}