2018-02-21 03:01:34 +00:00
|
|
|
# FIXME: make gdk_pixbuf dependency optional
|
2018-06-06 08:17:52 +01:00
|
|
|
{ stdenv
|
|
|
|
, buildPythonPackage
|
2018-02-21 03:01:34 +00:00
|
|
|
, fetchPypi
|
|
|
|
, lib
|
|
|
|
, substituteAll
|
2018-02-21 02:25:23 +00:00
|
|
|
, makeFontsConf
|
|
|
|
, freefont_ttf
|
|
|
|
, pytest
|
|
|
|
, glibcLocales
|
|
|
|
, cairo
|
|
|
|
, cffi
|
|
|
|
, withXcffib ? false, xcffib
|
|
|
|
, python
|
|
|
|
, glib
|
|
|
|
, gdk_pixbuf }:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2018-02-21 03:01:34 +00:00
|
|
|
pname = "cairocffi";
|
2018-06-04 03:00:32 +01:00
|
|
|
version = "0.8.1";
|
2018-02-21 02:25:23 +00:00
|
|
|
|
2018-02-21 03:01:34 +00:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-06-04 03:00:32 +01:00
|
|
|
sha256 = "0y373vafv7q35msg7gqdn7niifr3j4j4n070hflxshahs59irss7";
|
2018-02-21 02:25:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
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 glibcLocales ];
|
|
|
|
propagatedBuildInputs = [ cairo cffi ] ++ lib.optional withXcffib xcffib;
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test $out/${python.sitePackages}
|
|
|
|
'';
|
|
|
|
|
|
|
|
patches = [
|
2018-02-21 03:01:34 +00:00
|
|
|
# OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0
|
|
|
|
(substituteAll {
|
|
|
|
src = ./dlopen-paths.patch;
|
2018-06-06 08:17:52 +01:00
|
|
|
ext = stdenv.hostPlatform.extensions.sharedLibrary;
|
2018-02-21 03:01:34 +00:00
|
|
|
cairo = cairo.out;
|
|
|
|
glib = glib.out;
|
|
|
|
gdk_pixbuf = gdk_pixbuf.out;
|
2018-02-21 02:25:23 +00:00
|
|
|
})
|
|
|
|
./fix_test_scaled_font.patch
|
2018-06-04 03:35:39 +01:00
|
|
|
./cairocffi-0.8.1-cairo-1.15.12.patch
|
2018-02-21 02:25:23 +00:00
|
|
|
];
|
|
|
|
|
2018-02-21 03:01:34 +00:00
|
|
|
meta = with lib; {
|
2018-02-21 02:25:23 +00:00
|
|
|
homepage = https://github.com/SimonSapin/cairocffi;
|
2018-02-21 03:01:34 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [];
|
2018-02-21 02:25:23 +00:00
|
|
|
description = "cffi-based cairo bindings for Python";
|
|
|
|
};
|
|
|
|
}
|