Create python3-gobject source package, sharing the same original .spec to build python3 module. Please add a python-gobject3 link in devel:languages:python OBS-URL: https://build.opensuse.org/request/show/74061 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-gobject?expand=0&rev=8
92 lines
2.9 KiB
Diff
92 lines
2.9 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')
|
|
|
|
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
|
|
|
|
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)
|
|
@@ -226,9 +227,15 @@ if test "$enable_introspection" != no; then
|
|
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")
|
|
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);
|
|
#endif
|
|
|
|
if (Pycairo_CAPI == NULL)
|
|
--
|
|
cgit v0.9
|