Accepting request 134275 from devel:languages:python
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
This commit is contained in:
committed by
Git OBS Bridge
parent
8f89f71fa6
commit
bd09936185
@@ -6,46 +6,16 @@ Subject: [python3] fix build. PYcairo_IMPORT doesn't exists anymore
|
||||
---
|
||||
(limited to 'gi/pygi-foreign-cairo.c')
|
||||
|
||||
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
|
||||
index 10d5643..8353294 100644
|
||||
--- a/gi/pygi-foreign-cairo.c
|
||||
+++ b/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"
|
||||
|
||||
@@ -115,7 +115,12 @@ cairo_surface_release (GIBaseInfo *base_info,
|
||||
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*) PyCObject_Import("cairo", "CAPI");
|
||||
+#endif
|
||||
+
|
||||
if (Pycairo_CAPI == NULL)
|
||||
return PYGLIB_MODULE_ERROR_RETURN;
|
||||
|
||||
--
|
||||
cgit v0.9
|
||||
From 426c7109d4c0dbf0d56cc075f97f33b3451f79a8 Mon Sep 17 00:00:00 2001
|
||||
From: John (J5) Palmieri <johnp@redhat.com>
|
||||
Date: Wed, 27 Apr 2011 19:47:19 +0000
|
||||
Subject: use PyCapsule when importing pycairo/require pycairo 1.10.0 for python3 builds
|
||||
|
||||
* PyCObject is deprecated and pycairo 1.10.0 is first release to fix this issue
|
||||
---
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 0cc920b..fb69237 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -17,7 +17,8 @@ m4_define(pygobject_version, pygobject_major_version.pygobject_minor_version.pyg
|
||||
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)
|
||||
@@ -55,7 +25,7 @@ index 0cc920b..fb69237 100644
|
||||
m4_define(glib_required_version, 2.24.0)
|
||||
m4_define(gio_required_version, 2.24.0)
|
||||
m4_define(giounix_required_version, 2.22.4)
|
||||
@@ -226,9 +227,15 @@ if test "$enable_introspection" != no; then
|
||||
@@ -248,9 +249,15 @@ if test "$enable_introspection" != no; t
|
||||
AC_SUBST(GI_DATADIR)
|
||||
|
||||
if test "$enable_cairo" != no; then
|
||||
@@ -74,18 +44,29 @@ index 0cc920b..fb69237 100644
|
||||
fi
|
||||
fi
|
||||
AM_CONDITIONAL(ENABLE_INTROSPECTION, test "$enable_introspection" = "yes")
|
||||
diff --git a/gi/pygi-foreign-cairo.c b/gi/pygi-foreign-cairo.c
|
||||
index 8353294..af84733 100644
|
||||
--- a/gi/pygi-foreign-cairo.c
|
||||
+++ b/gi/pygi-foreign-cairo.c
|
||||
@@ -118,7 +118,7 @@ PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
|
||||
#if PY_VERSION_HEX < 0x03000000
|
||||
Pycairo_IMPORT;
|
||||
#else
|
||||
- Pycairo_CAPI = (Pycairo_CAPI_t*) PyCObject_Import("cairo", "CAPI");
|
||||
+ Pycairo_CAPI = (Pycairo_CAPI_t*) PyCapsule_Import("cairo.CAPI", 0);
|
||||
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)
|
||||
--
|
||||
cgit v0.9
|
||||
return PYGLIB_MODULE_ERROR_RETURN;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user