@@ -1,5 +1,8 @@
1+# FIXME: make gdk_pixbuf dependency optional
12{ buildPythonPackage
2−, fetchurl
3+, fetchPypi
4+, lib
5+, substituteAll
36, makeFontsConf
47, freefont_ttf
58, pytest
@@ -8,16 +11,16 @@
811, cffi
912, withXcffib ? false, xcffib
1013, python
11−, fetchpatch
1214, glib
1315, gdk_pixbuf }:
1416
1517buildPythonPackage rec {
16− name = "cairocffi-0.7.2";
18+ pname = "cairocffi";
19+ version = "0.8.0";
1720
18− src = fetchurl {
19− url = "mirror://pypi/c/cairocffi/${name}.tar.gz";
20− sha256 = "e42b4256d27bd960cbf3b91a6c55d602defcdbc2a73f7317849c80279feeb975";
21+ src = fetchPypi {
22+ inherit pname version;
23+ sha256 = "0i9m3p39g9wrkpjvpawch2qmnmm3cnim7niz3nmmbcp2hrkixwk5";
2124 };
2225
2326 LC_ALL = "en_US.UTF-8";
@@ -35,31 +38,21 @@ buildPythonPackage rec {
3538 py.test $out/${python.sitePackages}
3639 '';
3740
38− # FIXME: make gdk_pixbuf dependency optional
39− # Happens with 0.7.1 and 0.7.2
40− # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0
41−
4241 patches = [
43− # This patch from PR substituted upstream
44− (fetchpatch {
45− url = "https://github.com/avnik/cairocffi/commit/2266882e263c5efc87350cf016d117b2ec6a1d59.patch";
46− sha256 = "0gb570z3ivf1b0ixsk526n3h29m8c5rhjsiyam7rr3x80dp65cdl";
42+ # OSError: dlopen() failed to load a library: gdk_pixbuf-2.0 / gdk_pixbuf-2.0-0
43+ (substituteAll {
44+ src = ./dlopen-paths.patch;
45+ cairo = cairo.out;
46+ glib = glib.out;
47+ gdk_pixbuf = gdk_pixbuf.out;
4748 })
48−
49− ./dlopen-paths.patch
5049 ./fix_test_scaled_font.patch
5150 ];
5251
53− postPatch = ''
54− # Hardcode cairo library path
55− substituteInPlace cairocffi/__init__.py --subst-var-by cairo ${cairo.out}
56− substituteInPlace cairocffi/__init__.py --subst-var-by glib ${glib.out}
57− substituteInPlace cairocffi/__init__.py --subst-var-by gdk_pixbuf ${gdk_pixbuf.out}
58− '';
59−
60− meta = {
52+ meta = with lib; {
6153 homepage = https://github.com/SimonSapin/cairocffi;
62− license = "bsd";
54+ license = licenses.bsd3;
55+ maintainers = with maintainers; [];
6356 description = "cffi-based cairo bindings for Python";
6457 };
6558}