summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO32
-rw-r--r--01_cairo_region.patch80
-rw-r--r--PKGBUILD51
3 files changed, 163 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..125318d44a1e
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,32 @@
+pkgbase = pygobject
+ pkgver = 3.16.2
+ pkgrel = 1
+ url = https://live.gnome.org/PyGObject
+ arch = i686
+ arch = x86_64
+ license = LGPL
+ makedepends = python
+ makedepends = python2
+ makedepends = python-cairo
+ makedepends = python2-cairo
+ makedepends = gobject-introspection
+ makedepends = gnome-common
+ source = http://ftp.gnome.org/pub/gnome/sources/pygobject/3.16/pygobject-3.16.2.tar.xz
+ source = 01_cairo_region.patch
+ sha256sums = de620e00fe7ecb788aa2dc0d664e41f71b8e718e728168e8d982cf193a9e7e64
+ sha256sums = 194fc7946beb01d02a3fba587a214f2f38da56e3b63ecc9b7de37da210488919
+
+pkgname = python-gobject-patched
+ pkgdesc = Python 3 bindings for GObject, with a patch for cairo
+ depends = gobject-introspection-runtime
+ depends = pygobject-devel=3.16.2
+ depends = python
+ depends = cairo
+
+pkgname = python2-gobject-patched
+ pkgdesc = Python 2 bindings for GObject, with a patch for cairo
+ depends = gobject-introspection-runtime
+ depends = pygobject-devel=3.16.2
+ depends = python2
+ depends = cairo
+
diff --git a/01_cairo_region.patch b/01_cairo_region.patch
new file mode 100644
index 000000000000..8d1a06f01d58
--- /dev/null
+++ b/01_cairo_region.patch
@@ -0,0 +1,80 @@
+From 132daac42d49e14686b05e8dad64b3652084d240 Mon Sep 17 00:00:00 2001
+From: Shyouzou Sugitani <shy@users.sourceforge.jp>
+Date: Wed, 13 Jun 2012 23:44:11 +0900
+Subject: [PATCH] add a foreign type for cairo_region_t.
+
+* the patch in https://bugs.freedesktop.org/show_bug.cgi?id=44336
+ is required for pycairo
+
+Bug: https://bugzilla.gnome.org/show_bug.cgi?id=667959
+Bug-Ubuntu: https://launchpad.net/bugs/1028115
+---
+ gi/pygi-foreign-cairo.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
+ 1 file changed, 44 insertions(+)
+
+Index: pygobject/gi/pygi-foreign-cairo.c
+===================================================================
+--- pygobject.orig/gi/pygi-foreign-cairo.c
++++ pygobject/gi/pygi-foreign-cairo.c
+@@ -368,6 +368,46 @@ cairo_pattern_from_gvalue (const GValue
+ }
+
+
++#if PY_VERSION_HEX >= 0x03000000
++static PyObject *
++cairo_region_to_arg (PyObject *value,
++ GIInterfaceInfo *interface_info,
++ GITransfer transfer,
++ GIArgument *arg)
++{
++ cairo_region_t *region;
++
++ g_assert (transfer == GI_TRANSFER_NOTHING);
++
++ region = ( (PycairoRegion*) value)->region;
++ if (!region) {
++ PyErr_SetString (PyExc_ValueError, "Region instance wrapping a NULL region");
++ return NULL;
++ }
++
++ arg->v_pointer = region;
++ Py_RETURN_NONE;
++}
++
++static PyObject *
++cairo_region_from_arg (GIInterfaceInfo *interface_info, gpointer data)
++{
++ cairo_region_t *region = (cairo_region_t*) data;
++
++ cairo_region_reference (region);
++
++ return PycairoRegion_FromRegion (region);
++}
++
++static PyObject *
++cairo_region_release (GIBaseInfo *base_info,
++ gpointer struct_)
++{
++ cairo_region_destroy ( (cairo_region_t*) struct_);
++ Py_RETURN_NONE;
++}
++#endif
++
+ static PyMethodDef _gi_cairo_functions[] = { {0,} };
+ PYGLIB_MODULE_START(_gi_cairo, "_gi_cairo")
+ {
+@@ -406,6 +446,14 @@ PYGLIB_MODULE_START(_gi_cairo, "_gi_cair
+ cairo_font_options_from_arg,
+ cairo_font_options_release);
+
++#if PY_VERSION_HEX >= 0x03000000
++ pygi_register_foreign_struct ("cairo",
++ "Region",
++ cairo_region_to_arg,
++ cairo_region_from_arg,
++ cairo_region_release);
++#endif
++
+ pyg_register_gtype_custom (CAIRO_GOBJECT_TYPE_CONTEXT,
+ cairo_context_from_gvalue,
+ cairo_context_to_gvalue);
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..12b28b1a4263
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,51 @@
+# $Id: PKGBUILD 241024 2015-06-18 22:16:52Z heftig $
+# Maintainer: Ionut Biru <ibiru@archlinux.org>
+
+pkgbase=pygobject
+pkgname=(python-gobject-patched python2-gobject-patched)
+pkgver=3.16.2
+pkgrel=1
+arch=(i686 x86_64)
+url="https://live.gnome.org/PyGObject"
+license=(LGPL)
+makedepends=(python python2 python-cairo python2-cairo gobject-introspection gnome-common)
+source=("http://ftp.gnome.org/pub/gnome/sources/$pkgbase/${pkgver:0:4}/$pkgbase-$pkgver.tar.xz"
+ "01_cairo_region.patch")
+sha256sums=('de620e00fe7ecb788aa2dc0d664e41f71b8e718e728168e8d982cf193a9e7e64'
+ '194fc7946beb01d02a3fba587a214f2f38da56e3b63ecc9b7de37da210488919')
+
+prepare() {
+ mkdir -p build-py2 build-py3
+ cd ${pkgbase}-${pkgver}
+ sed -i '/Werror=format/d' configure # gcc 4.8
+ patch -Np1 -i ../01_cairo_region.patch
+}
+
+build() {
+ cd build-py2
+ ../${pkgbase}-${pkgver}/configure --prefix=/usr --with-python=/usr/bin/python2
+ make
+
+ cd ../build-py3
+ ../${pkgbase}-${pkgver}/configure --prefix=/usr
+ make
+}
+
+package_python-gobject-patched() {
+ pkgdesc="Python 3 bindings for GObject, with a patch for cairo"
+ depends=('gobject-introspection-runtime' "pygobject-devel=$pkgver" 'python' 'cairo')
+
+ cd build-py3
+ make DESTDIR="$pkgdir" install
+ rm -r "$pkgdir"/usr/{include,lib/pkgconfig}
+}
+
+package_python2-gobject-patched() {
+ pkgdesc="Python 2 bindings for GObject, with a patch for cairo"
+ depends=('gobject-introspection-runtime' "pygobject-devel=$pkgver" 'python2' 'cairo')
+
+ cd build-py2
+ make DESTDIR="$pkgdir" install
+ rm -r "$pkgdir"/usr/{include,lib/pkgconfig}
+ python2 -m compileall "$pkgdir"//usr/lib/python2.7/site-packages/gi
+}