Add patch from upstream OBS-URL: https://build.opensuse.org/request/show/134275 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gobject2?expand=0&rev=14
73 lines
2.3 KiB
Diff
73 lines
2.3 KiB
Diff
From 4e5833d0c2fe548617e5ea510f05920fd0caf73b Mon Sep 17 00:00:00 2001
|
|
From: Ignacio Casal Quinteiro <icq@gnome.org>
|
|
Date: Thu, 21 Apr 2011 14:52:20 +0000
|
|
Subject: [python3] fix build. PYcairo_IMPORT doesn't exists anymore
|
|
|
|
---
|
|
(limited to 'gi/pygi-foreign-cairo.c')
|
|
|
|
---
|
|
configure.ac | 15 +++++++++++----
|
|
gi/pygi-foreign-cairo.c | 7 ++++++-
|
|
2 files changed, 17 insertions(+), 5 deletions(-)
|
|
|
|
Index: pygobject-2.28.6/configure.ac
|
|
===================================================================
|
|
--- pygobject-2.28.6.orig/configure.ac
|
|
+++ pygobject-2.28.6/configure.ac
|
|
@@ -17,7 +17,8 @@ m4_define(pygobject_version, pygobject_m
|
|
|
|
dnl versions of packages we require ...
|
|
m4_define(introspection_required_version, 0.10.2)
|
|
-m4_define(pycairo_required_version, 1.2.0)
|
|
+m4_define(py2cairo_required_version, 1.2.0)
|
|
+m4_define(py3cairo_required_version, 1.10.0)
|
|
m4_define(glib_required_version, 2.24.0)
|
|
m4_define(gio_required_version, 2.24.0)
|
|
m4_define(giounix_required_version, 2.22.4)
|
|
@@ -248,9 +249,15 @@ if test "$enable_introspection" != no; t
|
|
AC_SUBST(GI_DATADIR)
|
|
|
|
if test "$enable_cairo" != no; then
|
|
- PKG_CHECK_MODULES(PYCAIRO,
|
|
- pycairo >= pycairo_required_version
|
|
- )
|
|
+ if test $build_py3k = true; then
|
|
+ PKG_CHECK_MODULES(PYCAIRO,
|
|
+ py3cairo >= py3cairo_required_version
|
|
+ )
|
|
+ else
|
|
+ PKG_CHECK_MODULES(PYCAIRO,
|
|
+ pycairo >= py2cairo_required_version
|
|
+ )
|
|
+ fi
|
|
fi
|
|
fi
|
|
AM_CONDITIONAL(ENABLE_INTROSPECTION, test "$enable_introspection" = "yes")
|
|
Index: pygobject-2.28.6/gi/pygi-foreign-cairo.c
|
|
===================================================================
|
|
--- pygobject-2.28.6.orig/gi/pygi-foreign-cairo.c
|
|
+++ pygobject-2.28.6/gi/pygi-foreign-cairo.c
|
|
@@ -30,7 +30,7 @@
|
|
#include <pycairo/py3cairo.h>
|
|
#endif
|
|
|
|
-Pycairo_CAPI_t *Pycairo_CAPI;
|
|
+static Pycairo_CAPI_t *Pycairo_CAPI;
|
|
|
|
#include "pygi-foreign.h"
|
|
|
|
@@ -117,7 +117,12 @@ cairo_surface_release (GIBaseInfo *base_
|
|
static PyMethodDef _gi_cairo_functions[] = {};
|
|
PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
|
|
{
|
|
+#if PY_VERSION_HEX < 0x03000000
|
|
Pycairo_IMPORT;
|
|
+#else
|
|
+ Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import("cairo.CAPI", 0);
|
|
+#endif
|
|
+
|
|
if (Pycairo_CAPI == NULL)
|
|
return PYGLIB_MODULE_ERROR_RETURN;
|
|
|