* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2017-10-15 11:01 Michał Górny
0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2017-10-15 11:01 UTC (permalink / raw
To: gentoo-commits
commit: 2b54ba0b815698d27e932a12b7f0df0f41e761e3
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 15 10:59:54 2017 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Oct 15 11:01:26 2017 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b54ba0b
dev-python/pycairo: Move patches to a dist tarball
Closes: https://bugs.gentoo.org/620566
dev-python/pycairo/Manifest | 1 +
.../pycairo/files/py2cairo-1.10.0-ppc-darwin.patch | 18 -
.../pycairo/files/py2cairo-1.10.0-svg_check.patch | 126 ---
.../pycairo/files/py2cairo-1.10.0-xpyb.patch | 38 -
.../files/pycairo-1.10.0-101_pycairo-region.patch | 917 ---------------------
...pycairo-1.10.0-50_specify-encoding-in-waf.patch | 32 -
.../files/pycairo-1.10.0-80_fix-pickle.patch | 30 -
.../files/pycairo-1.10.0-81_pickling-again.patch | 37 -
.../pycairo/files/pycairo-1.10.0-svg_check.patch | 126 ---
.../pycairo/files/pycairo-1.10.0-waf-py3_4.patch | 11 -
.../pycairo/files/pycairo-1.10.0-waf-unpack.patch | 12 -
dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch | 41 -
dev-python/pycairo/pycairo-1.10.0-r5.ebuild | 27 +-
13 files changed, 15 insertions(+), 1401 deletions(-)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
index 723b16edc34..5577f0d07b8 100644
--- a/dev-python/pycairo/Manifest
+++ b/dev-python/pycairo/Manifest
@@ -1,3 +1,4 @@
DIST py2cairo-1.10.0.tar.bz2 402070 SHA256 d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431 SHA512 cb3d54de9af4134460ce731da8166a3127a642c8a2e6184109437ddec115cd55b8dd2413a5c81700277bfe2f22fcfe268db4f3ba0f7649751e85bb34295f79fc WHIRLPOOL 60b57d55b27f06acd62714ac6ad7973ab973d42995fb536ae800263a2e8c7451a24ccafd96fe30f5bfa26e1ae218934d4fafaafec3e9666a39b33c78672407e2
+DIST pycairo-1.10.0-gentoo-patchset.tar.bz2 9669 SHA256 31b5aef32b5d2fb3d8e1c6f9629e6d78e6b3928a3a1c7e44af2120f38490d00e SHA512 c367a7d8fa771ac900ca3363cb7dfd50de045cf67c73c6e552d05018c6933b13dd5660b033be59e1acf8af79f16253a8e56aaa3f135a262a8148711ae8b7a587 WHIRLPOOL 65890911ee35568fceaa5146bf5e4718011eb2f606dc6c180e7ce612fe2351488c7ad2ea2322ec1ca55eb0f8b6f4fb3fb759152be525d20f80922d707108bc9e
DIST pycairo-1.10.0.tar.bz2 246556 SHA256 9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be SHA512 a03db6f04cea504985f390b0734042390f491f32ae2bee1299dabbafd369fde36bb506ebb941d22bbc11b0d008c4f758baeacf309a7336880529455092db829f WHIRLPOOL e779d56d67ef18bbd052d81acb38d8b610ca4bbf787f4b0e3982633de55ff54d6dfa3e5ce1957321fba09f0ec2d12ce12057335de9d5ff3f84c2bc0530415e76
DIST pycairo-1.15.3.tar.gz 177056 SHA256 8642e36cef66acbfc02760d2b40c716f5f183d073fb063ba28fd29a14044719d SHA512 1fc75d193eacb976f2e5a594aa07409a0f80ccb21921065c1794961143785eed48be1966d2d2d3e2d0428f9b4e956994dd851d21f3c3cb91fbc27b007a901ce8 WHIRLPOOL e9248366c8eb541bc70ad73c9c6eea995a2527d189584a1ec6f6b835fdeae57d1aa63e2deaa9f790042d0670e7d07af8867b111ac107b53befd354c3cfc70ca1
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch b/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch
deleted file mode 100644
index e921ac34acd..00000000000
--- a/dev-python/pycairo/files/py2cairo-1.10.0-ppc-darwin.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-inspired by:
-http://groups.google.com/group/waf-users/browse_thread/thread/2bd6774056c850bc/
-27bfdcac2fb9ec05?lnk=gst#27bfdcac2fb9ec05
-
-we cannot "fix" the buildsystem, since it's bzip2-tarred *sigh*
-
-
---- waf
-+++ waf
-@@ -154,6 +154,8 @@
-
- wafdir = find_lib()
- sys.path.insert(0, wafdir)
-+from waflib.Tools.c_config import MACRO_TO_DESTOS
-+MACRO_TO_DESTOS['__POWERPC__'] = 'darwin'
-
- if __name__ == '__main__':
- import waflib.extras.compat15
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch
deleted file mode 100644
index 4cd755c8d57..00000000000
--- a/dev-python/pycairo/files/py2cairo-1.10.0-svg_check.patch
+++ /dev/null
@@ -1,126 +0,0 @@
---- src/cairomodule.c
-+++ src/cairomodule.c
-@@ -127,7 +127,7 @@
- #else
- 0,
- #endif
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- &PycairoSVGSurface_Type,
- #else
- 0,
-@@ -223,7 +223,7 @@
- if (PyType_Ready(&PycairoPSSurface_Type) < 0)
- return;
- #endif
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- if (PyType_Ready(&PycairoSVGSurface_Type) < 0)
- return;
- #endif
-@@ -305,7 +305,7 @@
- PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type);
- #endif
-
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- Py_INCREF(&PycairoSVGSurface_Type);
- PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type);
- #endif
-@@ -379,7 +379,7 @@
- #else
- PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0);
- #endif
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1);
- #else
- PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0);
---- src/private.h
-+++ src/private.h
-@@ -86,7 +86,7 @@
- extern PyTypeObject PycairoPSSurface_Type;
- #endif
-
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- extern PyTypeObject PycairoSVGSurface_Type;
- #endif
-
---- src/pycairo.h
-+++ src/pycairo.h
-@@ -182,7 +182,7 @@
- #define PycairoPSSurface_Type *(Pycairo_CAPI->PSSurface_Type)
- #endif
-
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- #define PycairoSVGSurface_Type *(Pycairo_CAPI->SVGSurface_Type)
- #endif
-
---- src/surface.c
-+++ src/surface.c
-@@ -83,7 +83,7 @@
- type = &PycairoPSSurface_Type;
- break;
- #endif
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- case CAIRO_SURFACE_TYPE_SVG:
- type = &PycairoSVGSurface_Type;
- break;
-@@ -1015,7 +1015,7 @@
-
-
- /* Class SVGSurface(Surface) ----------------------------------------------- */
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- #include <cairo-svg.h>
-
- static PyObject *
-@@ -1125,7 +1125,7 @@
- 0, /* tp_is_gc */
- 0, /* tp_bases */
- };
--#endif /* CAIRO_HAS_SVG_SURFACE */
-+#endif /* PYCAIRO_ENABLE_SVG */
-
-
- #if CAIRO_HAS_WIN32_SURFACE
---- wscript
-+++ wscript
-@@ -1,6 +1,7 @@
- # -*- python -*-
-
- import os
-+import subprocess
-
- top = '.'
- out = 'build_directory'
-@@ -11,6 +12,17 @@
- cairo_version_required = '1.10.0'
-
-
-+def check_svg():
-+ if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None:
-+ return_code = subprocess.call(['pkg-config', '--exists', 'cairo-svg'])
-+ if return_code == 0:
-+ return True
-+ else:
-+ return False
-+ else:
-+ return False
-+
-+
- def options(ctx):
- print(' %s/options()' %d)
- ctx.tool_options('gnu_dirs')
-@@ -39,6 +51,8 @@
- ctx.define('PYCAIRO_VERSION_MAJOR', version[0])
- ctx.define('PYCAIRO_VERSION_MINOR', version[1])
- ctx.define('PYCAIRO_VERSION_MICRO', version[2])
-+ if check_svg():
-+ ctx.define('PYCAIRO_ENABLE_SVG', 1)
-
- ctx.write_config_header('src/config.h')
-
diff --git a/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch
deleted file mode 100644
index c136cb0c39a..00000000000
--- a/dev-python/pycairo/files/py2cairo-1.10.0-xpyb.patch
+++ /dev/null
@@ -1,38 +0,0 @@
---- py2cairo-1.10.0/wscript
-+++ py2cairo-1.10.0/wscript
-@@ -10,6 +10,7 @@
- APPNAME='py2cairo'
- VERSION='1.10.0'
- cairo_version_required = '1.10.0'
-+xpyb_version_required = '1.3'
-
-
- def check_svg():
-@@ -23,6 +24,17 @@
- return False
-
-
-+def check_xpyb():
-+ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None:
-+ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb'])
-+ if return_code == 0:
-+ return True
-+ else:
-+ return False
-+ else:
-+ return False
-+
-+
- def options(ctx):
- print(' %s/options()' %d)
- ctx.tool_options('gnu_dirs')
-@@ -41,6 +53,9 @@
- ctx.check_python_headers()
- ctx.check_cfg(package='cairo', atleast_version=cairo_version_required,
- args='--cflags --libs')
-+ if check_xpyb():
-+ ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required,
-+ args='--cflags --libs', mandatory=False)
-
- # add gcc options
- if env['CC_NAME'] == 'gcc':
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch b/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch
deleted file mode 100644
index 4143f33cb24..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-101_pycairo-region.patch
+++ /dev/null
@@ -1,917 +0,0 @@
-Description: Add support for cairo_region_t
- This patch fix missing support for cairo_region_t.
-Author: Bug Fly
-Origin: https://bugs.freedesktop.org/attachment.cgi?id=61553
-Bug-Debian: http://bugs.debian.org/688079
-Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/py3cairo/+bug/1028115
-Last-Update: 2012-08-20
-Applied-Upstream: http://cgit.freedesktop.org/pycairo/commit/?id=75e82a1b3f495a3abbc78e50a5c66356d320fb15
-
---- py3cairo-1.10.0+dfsg.orig/doc/pycairo_c_api.rst
-+++ py3cairo-1.10.0+dfsg/doc/pycairo_c_api.rst
-@@ -51,6 +51,8 @@ Objects::
- PycairoGradient
- PycairoLinearGradient
- PycairoRadialGradient
-+ PycairoRectangleInt
-+ PycairoRegion
- PycairoScaledFont
- PycairoSurface
- PycairoImageSurface
-@@ -78,6 +80,8 @@ Types::
- PyTypeObject *Gradient_Type;
- PyTypeObject *LinearGradient_Type;
- PyTypeObject *RadialGradient_Type;
-+ PyTypeObject *RectangleInt_Type;
-+ PyTypeObject *Region_Type;
- PyTypeObject *ScaledFont_Type;
- PyTypeObject *Surface_Type;
- PyTypeObject *ImageSurface_Type;
-@@ -115,6 +119,12 @@ Functions
- .. c:function:: PyObject * PycairoPattern_FromPattern(cairo_pattern_t *pattern, PyObject *base)
-
-
-+.. c:function:: PyObject * PycairoRectangleInt_FromRectangleInt(const cairo_rectangle_int_t *rectangle_int)
-+
-+
-+.. c:function:: PyObject * PycairoRegion_FromRegion(const cairo_region_t *region)
-+
-+
- .. c:function:: PyObject * PycairoScaledFont_FromScaledFont(cairo_scaled_font_t *scaled_font)
-
-
---- py3cairo-1.10.0+dfsg.orig/doc/reference/index.rst
-+++ py3cairo-1.10.0+dfsg/doc/reference/index.rst
-@@ -15,5 +15,6 @@ Reference
- matrix
- paths
- patterns
-+ region
- surfaces
- text
---- /dev/null
-+++ py3cairo-1.10.0+dfsg/doc/reference/region.rst
-@@ -0,0 +1,52 @@
-+.. _region:
-+
-+******
-+Region
-+******
-+Region — Representing a pixel-aligned area
-+
-+.. currentmodule:: cairo
-+
-+
-+class Region()
-+==============
-+*Region* is a simple graphical data type representing an area of
-+integer-aligned rectangles. They are often used on raster surfaces to track
-+areas of interest, such as change or clip areas.
-+
-+
-+.. class:: Region([rectangle_int|rectangle_ints])
-+
-+ :param rectangle_int: a rectangle or a list of rectangle
-+ :type rectangle_int: :class:`RectangleInt` or [:class:`RectangleInt`]
-+
-+ Allocates a new empty region object or a region object with the containing
-+ rectangle(s).
-+
-+
-+ .. method:: copy()
-+
-+ :returns: A newly allocated :class:`Region`.
-+ :raises: :exc:`NoMemory` if memory cannot be allocated.
-+
-+ Allocates a new *Region* object copying the area from original.
-+
-+
-+class RectangleInt()
-+====================
-+*RectangleInt* is a data structure for holding a rectangle with integer
-+coordinates.
-+
-+
-+.. class:: RectangleInt(x=0, y=0, width=0, height=0)
-+
-+ :param x: X coordinate of the left side of the rectangle
-+ :type x: int
-+ :param y: Y coordinate of the the top side of the rectangle
-+ :type y: int
-+ :param width: width of the rectangle
-+ :type width: int
-+ :param height: height of the rectangle
-+ :type height: int
-+
-+ Allocates a new *RectangleInt* object.
---- /dev/null
-+++ py3cairo-1.10.0+dfsg/src/region.c
-@@ -0,0 +1,598 @@
-+/* -*- mode: C; c-basic-offset: 2 -*-
-+ *
-+ * Copyright © 2005,2010 Steve Chaplin
-+ *
-+ * This file is part of pycairo.
-+ *
-+ * Pycairo is free software: you can redistribute it and/or modify it under
-+ * the terms of the GNU Lesser General Public License version 3 as published
-+ * by the Free Software Foundation.
-+ *
-+ * Pycairo is distributed in the hope that it will be useful, but WITHOUT ANY
-+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
-+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for
-+ * more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public License
-+ * along with pycairo. If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#define PY_SSIZE_T_CLEAN
-+#include <Python.h>
-+#include "structmember.h"
-+
-+#include "config.h"
-+#include "private.h"
-+
-+/* PycairoRectangleInt_FromRectangleInt
-+ * Create a new PycairoRectangleInt from a cairo_rectangle_int_t
-+ * rectangle_int - a cairo_rectangle_int_t to 'wrap' into a Python object.
-+ * rectangle_int is unreferenced if the PycairoRectangleInt creation
-+ * fails.
-+ * Return value: New reference or NULL on failure
-+ */
-+PyObject *
-+PycairoRectangleInt_FromRectangleInt (cairo_rectangle_int_t *rectangle_int) {
-+ PyObject *o;
-+
-+ assert (rectangle_int != NULL);
-+
-+ o = PycairoRectangleInt_Type.tp_alloc (&PycairoRectangleInt_Type, 0);
-+ if (o)
-+ ((PycairoRectangleInt *)o)->rectangle_int = *rectangle_int;
-+ return o;
-+}
-+
-+static void
-+rectangle_int_dealloc(PycairoRectangleInt *o) {
-+#ifdef DEBUG
-+ printf("rectangle_int_dealloc start\n");
-+#endif
-+ //o->ob_type->tp_free((PyObject *)o);
-+ Py_TYPE(o)->tp_free(o);
-+#ifdef DEBUG
-+ printf("rectangle_int_dealloc end\n");
-+#endif
-+}
-+
-+static PyObject *
-+rectangle_int_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
-+ static char *kwlist[] = { "x", "y", "width", "height", NULL };
-+ int x, y, w, h;
-+ x = y = w = h = 0;
-+ cairo_rectangle_int_t rect;
-+
-+ if (!PyArg_ParseTupleAndKeywords(args, kwds,
-+ "|iiii:RectangleInt.__new__", kwlist,
-+ &x, &y, &w, &h))
-+ return NULL;
-+
-+ rect.x = x;
-+ rect.y = y;
-+ rect.width = w;
-+ rect.height = h;
-+
-+ return PycairoRectangleInt_FromRectangleInt(&rect);
-+}
-+
-+static PyObject *
-+rectangle_int_str(PycairoRectangleInt *rect_o) {
-+ PyObject *s;
-+ cairo_rectangle_int_t *rect = &(rect_o->rectangle_int);
-+ char buf[80];
-+ PyOS_snprintf(buf, sizeof(buf), "cairo.RectangleInt(%d, %d, %d, %d)",
-+ rect->x, rect->y, rect->width, rect->height);
-+ s = PyUnicode_FromString(buf);
-+ return s;
-+}
-+
-+static PyObject *
-+rectangle_int_richcompare(PycairoRectangleInt *self,
-+ PycairoRectangleInt *other, int op) {
-+ int res = 0;
-+ PyObject *b;
-+
-+ if (op != Py_EQ && op != Py_NE) {
-+ PyErr_SetString(PyExc_TypeError, "Only support testing for == or !=");
-+ return NULL;
-+ }
-+ if (!PyObject_IsInstance((PyObject*)other,
-+ (PyObject*)&PycairoRectangleInt_Type)) {
-+ res = 0;
-+ }
-+ else if (
-+ self->rectangle_int.x == other->rectangle_int.x &&
-+ self->rectangle_int.y == other->rectangle_int.y &&
-+ self->rectangle_int.width == other->rectangle_int.width &&
-+ self->rectangle_int.height == other->rectangle_int.height
-+ )
-+ res = 1;
-+ res = op == Py_NE ? !res : res;
-+ b = res ? Py_True : Py_False;
-+ Py_INCREF(b);
-+
-+ return b;
-+}
-+
-+static PyMemberDef RectangleInt_members[] = {
-+ {"x", T_INT, sizeof(PyObject), 0,
-+ "X coordinate of the left side of the rectangle"},
-+ {"y", T_INT, sizeof(PyObject)+sizeof(int), 0,
-+ "Y coordinate of the the top side of the rectangle"},
-+ {"width", T_INT, sizeof(PyObject)+sizeof(int)*2, 0,
-+ "width of the rectangle"},
-+ {"height", T_INT, sizeof(PyObject)+sizeof(int)*3, 0,
-+ "height of the rectangle"},
-+ {NULL}
-+};
-+
-+PyTypeObject PycairoRectangleInt_Type = {
-+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
-+ "cairo.RectangleInt", /* tp_name */
-+ sizeof(PycairoRectangleInt), /* tp_basicsize */
-+ 0, /* tp_itemsize */
-+ (destructor)rectangle_int_dealloc, /* tp_dealloc */
-+ 0, /* tp_print */
-+ 0, /* tp_getattr */
-+ 0, /* tp_setattr */
-+ 0, /* tp_compare */
-+ 0, /* tp_repr */
-+ 0, /* tp_as_number */
-+ 0, /* tp_as_sequence */
-+ 0, /* tp_as_mapping */
-+ 0, /* tp_hash */
-+ 0, /* tp_call */
-+ (reprfunc)rectangle_int_str, /* tp_str */
-+ 0, /* tp_getattro */
-+ 0, /* tp_setattro */
-+ 0, /* tp_as_buffer */
-+ Py_TPFLAGS_DEFAULT, /* tp_flags */
-+ 0, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ (richcmpfunc)rectangle_int_richcompare, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ 0, /* tp_iter */
-+ 0, /* tp_iternext */
-+ 0, /* tp_methods */
-+ RectangleInt_members, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ 0, /* tp_init */
-+ 0, /* tp_alloc */
-+ (newfunc)rectangle_int_new, /* tp_new */
-+};
-+
-+/* PycairoRegion_FromRegion
-+ * Create a new PycairoRegion from a cairo_region_t
-+ * region - a cairo_region_t to 'wrap' into a Python object.
-+ * region is unreferenced if the PycairoRegion creation fails, or if
-+ * region is in an error status.
-+ * Return value: New reference or NULL on failure
-+ */
-+PyObject *
-+PycairoRegion_FromRegion (cairo_region_t *region) {
-+ PyObject *o;
-+
-+ assert (region != NULL);
-+
-+ if (Pycairo_Check_Status (cairo_region_status(region))) {
-+ cairo_region_destroy (region);
-+ return NULL;
-+ }
-+
-+ o = PycairoRegion_Type.tp_alloc (&PycairoRegion_Type, 0);
-+ if (o)
-+ ((PycairoRegion *)o)->region = region;
-+ else
-+ cairo_region_destroy (region);
-+ return o;
-+}
-+
-+static void
-+region_dealloc(PycairoRegion *o) {
-+#ifdef DEBUG
-+ printf("region_dealloc start\n");
-+#endif
-+ if (o->region) {
-+ cairo_region_destroy(o->region);
-+ o->region = NULL;
-+ }
-+ //o->ob_type->tp_free((PyObject *)o);
-+ Py_TYPE(o)->tp_free(o);
-+#ifdef DEBUG
-+ printf("region_dealloc end\n");
-+#endif
-+}
-+
-+static PyObject *
-+region_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
-+ PyObject *s = NULL;
-+ PycairoRectangleInt *rect_obj = NULL;
-+ cairo_region_t *region = NULL;
-+ cairo_rectangle_int_t *rect = NULL;
-+
-+ if (PyArg_ParseTuple(args, "|O!:Region.__new__",
-+ &PycairoRectangleInt_Type, &rect_obj)) {
-+ if (rect_obj != NULL) {
-+ region = cairo_region_create_rectangle(&(rect_obj->rectangle_int));
-+ }
-+ } else if (!PyArg_ParseTuple(args, "|O:Region.__new__", &s)) {
-+ PyErr_SetString(PyExc_TypeError,
-+ "argument must be a RectangleInt or a sequence of RectangleInt.");
-+ return NULL;
-+ }
-+ PyErr_Clear(); /* Clear possible err in the 1st arg parser. */
-+
-+ /* list of rectangle_int or no args */
-+ if (s != NULL) {
-+ int i;
-+ int rect_size;
-+ PyObject *seq = NULL;
-+ seq = PySequence_Fast (s,
-+ "argument must be a RectangleInt or a sequence of RectangleInt.");
-+ if (seq == NULL) {
-+ return NULL;
-+ }
-+ rect_size = PySequence_Fast_GET_SIZE(seq);
-+ rect = PyMem_Malloc (rect_size * sizeof(cairo_rectangle_int_t));
-+ if (rect == NULL) {
-+ Py_DECREF(seq);
-+ return PyErr_NoMemory();
-+ }
-+
-+ for(i=0; i<rect_size; i++) {
-+ PyObject *obj_tmp = PySequence_Fast_GET_ITEM(seq, i);
-+ if (PyObject_IsInstance(obj_tmp,
-+ (PyObject*)&PycairoRectangleInt_Type) != 1) {
-+ Py_DECREF(seq);
-+ PyMem_Free(rect);
-+ return NULL;
-+ }
-+ rect_obj = (PycairoRectangleInt*) obj_tmp;
-+ rect[i] = rect_obj->rectangle_int;
-+ }
-+
-+ region = cairo_region_create_rectangles(rect, rect_size);
-+
-+ Py_DECREF(seq);
-+ PyMem_Free(rect);
-+ }
-+
-+ if (region == NULL) {
-+ region = cairo_region_create();
-+ }
-+
-+ RETURN_NULL_IF_CAIRO_REGION_ERROR(region);
-+ return PycairoRegion_FromRegion(region);
-+}
-+
-+PyObject *
-+region_copy (PycairoRegion *o) {
-+ cairo_region_t *res;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_copy (o->region);
-+ Py_END_ALLOW_THREADS;
-+ RETURN_NULL_IF_CAIRO_REGION_ERROR(res);
-+ return PycairoRegion_FromRegion(res);
-+}
-+
-+
-+PyObject *
-+region_get_extents (PycairoRegion *o) {
-+ cairo_rectangle_int_t rect;
-+ Py_BEGIN_ALLOW_THREADS;
-+ cairo_region_get_extents(o->region, &rect);
-+ Py_END_ALLOW_THREADS;
-+
-+ return PycairoRectangleInt_FromRectangleInt(&rect);
-+}
-+
-+
-+PyObject *
-+region_num_rectangles (PycairoRegion *o) {
-+ int res;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_num_rectangles(o->region);
-+ Py_END_ALLOW_THREADS;
-+ return Py_BuildValue("i", res);
-+}
-+
-+
-+PyObject *
-+region_get_rectangle (PycairoRegion *o, PyObject *args) {
-+ cairo_rectangle_int_t rect;
-+ int i;
-+ int total;
-+ if (!PyArg_ParseTuple (args, "i:Region.get_rectangle", &i))
-+ return NULL;
-+ total = cairo_region_num_rectangles(o->region);
-+ if (i >= total || i < 0) {
-+ if ( i < 0)
-+ PyErr_SetString(PyExc_ValueError, "index must be a positive number");
-+ else
-+ PyErr_SetString(PyExc_ValueError, "index is to big for the region");
-+ return NULL;
-+ }
-+ Py_BEGIN_ALLOW_THREADS;
-+ cairo_region_get_rectangle(o->region, i, &rect);
-+ Py_END_ALLOW_THREADS;
-+ return PycairoRectangleInt_FromRectangleInt(&rect);
-+}
-+
-+
-+PyObject *
-+region_is_empty (PycairoRegion *o) {
-+ cairo_bool_t res;
-+ PyObject *b;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_is_empty(o->region);
-+ Py_END_ALLOW_THREADS;
-+ b = res ? Py_True : Py_False;
-+ Py_INCREF(b);
-+ return b;
-+}
-+
-+
-+PyObject *
-+region_contains_point (PycairoRegion *o, PyObject *args) {
-+ int x, y;
-+ cairo_bool_t res;
-+ PyObject *b;
-+ if (!PyArg_ParseTuple (args, "ii:Region.contains_point", &x, &y))
-+ return NULL;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_contains_point(o->region, x, y);
-+ Py_END_ALLOW_THREADS;
-+ b = res ? Py_True : Py_False;
-+ Py_INCREF(b);
-+ return b;
-+}
-+
-+
-+PyObject *
-+region_contains_rectangle (PycairoRegion *o, PyObject *args) {
-+ cairo_region_overlap_t res;
-+ PycairoRectangleInt *rect_int;
-+ if (!PyArg_ParseTuple (args, "O!:Region.contains_rectangle",
-+ &PycairoRectangleInt_Type, &rect_int))
-+ return NULL;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_contains_rectangle(o->region, &(rect_int->rectangle_int));
-+ Py_END_ALLOW_THREADS;
-+ return Py_BuildValue("i", res);
-+}
-+
-+
-+PyObject *
-+region_equal (PycairoRegion *o, PyObject *args) {
-+ cairo_bool_t res;
-+ PyObject *b;
-+ PycairoRegion *region_obj;
-+ if (!PyArg_ParseTuple (args, "O!:Region.equal",
-+ &PycairoRegion_Type, ®ion_obj))
-+ return NULL;
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_equal (o->region, region_obj->region);
-+ Py_END_ALLOW_THREADS;
-+ b = res ? Py_True : Py_False;
-+ Py_INCREF(b);
-+ return b;
-+}
-+
-+static PyObject *
-+region_richcompare(PycairoRegion *self, PycairoRegion *other, int op) {
-+ int res = 0;
-+ PyObject *b;
-+
-+ if (op != Py_EQ && op != Py_NE) {
-+ PyErr_SetString(PyExc_TypeError, "Only support testing for == or !=");
-+ return NULL;
-+ }
-+ if (!PyObject_IsInstance((PyObject*)other, (PyObject*)&PycairoRegion_Type)) {
-+ res = 0;
-+ } else {
-+ res = cairo_region_equal (self->region, other->region);
-+ }
-+
-+ res = op == Py_NE ? !res : res;
-+ b = res ? Py_True : Py_False;
-+ Py_INCREF(b);
-+
-+ return b;
-+}
-+
-+PyObject *
-+region_translate (PycairoRegion *o, PyObject *args) {
-+ int x, y;
-+ if (!PyArg_ParseTuple (args, "ii:Region.translate", &x, &y))
-+ return NULL;
-+ Py_BEGIN_ALLOW_THREADS;
-+ cairo_region_translate (o->region, x, y);
-+ Py_END_ALLOW_THREADS;
-+ Py_RETURN_NONE;
-+}
-+
-+
-+PyObject *
-+region_intersect (PycairoRegion *o, PyObject *args) {
-+ cairo_status_t res;
-+ PyObject *other;
-+ if (!PyArg_ParseTuple (args, "O:Region.intersect", &other))
-+ return NULL;
-+
-+ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_intersect(o->region,
-+ ((PycairoRegion *)other)->region);
-+ Py_END_ALLOW_THREADS;
-+ } else if (PyObject_IsInstance(other,
-+ (PyObject*)&PycairoRectangleInt_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_intersect_rectangle(o->region,
-+ &(((PycairoRectangleInt *)other)->rectangle_int));
-+ Py_END_ALLOW_THREADS;
-+ } else {
-+ PyErr_SetString(PyExc_TypeError,
-+ "argument must be a Region or a RectangleInt.");
-+ return NULL;
-+ }
-+
-+ RETURN_NULL_IF_CAIRO_ERROR(res);
-+ Py_RETURN_NONE;
-+}
-+
-+PyObject *
-+region_subtract (PycairoRegion *o, PyObject *args) {
-+ cairo_status_t res;
-+ PyObject *other;
-+ if (!PyArg_ParseTuple (args, "O:Region.subtract", &other))
-+ return NULL;
-+
-+ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_subtract(o->region,
-+ ((PycairoRegion *)other)->region);
-+ Py_END_ALLOW_THREADS;
-+ } else if (PyObject_IsInstance(other,
-+ (PyObject*)&PycairoRectangleInt_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_subtract_rectangle(o->region,
-+ &(((PycairoRectangleInt *)other)->rectangle_int));
-+ Py_END_ALLOW_THREADS;
-+ } else {
-+ PyErr_SetString(PyExc_TypeError,
-+ "argument must be a Region or a RectangleInt.");
-+ return NULL;
-+ }
-+ RETURN_NULL_IF_CAIRO_ERROR(res);
-+ Py_RETURN_NONE;
-+}
-+
-+PyObject *
-+region_union (PycairoRegion *o, PyObject *args) {
-+ cairo_status_t res;
-+ PyObject *other;
-+ if (!PyArg_ParseTuple (args, "O:Region.union", &other))
-+ return NULL;
-+
-+ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_union(o->region,
-+ ((PycairoRegion *)other)->region);
-+ Py_END_ALLOW_THREADS;
-+ } else if (PyObject_IsInstance(other,
-+ (PyObject*)&PycairoRectangleInt_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_union_rectangle(o->region,
-+ &(((PycairoRectangleInt *)other)->rectangle_int));
-+ Py_END_ALLOW_THREADS;
-+ } else {
-+ PyErr_SetString(PyExc_TypeError,
-+ "argument must be a Region or a RectangleInt.");
-+ return NULL;
-+ }
-+ RETURN_NULL_IF_CAIRO_ERROR(res);
-+ Py_RETURN_NONE;
-+}
-+
-+PyObject *
-+region_xor (PycairoRegion *o, PyObject *args) {
-+ cairo_status_t res;
-+ PyObject *other;
-+ if (!PyArg_ParseTuple (args, "O:Region.xorg", &other))
-+ return NULL;
-+
-+ if (PyObject_IsInstance(other, (PyObject*)&PycairoRegion_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_xor(o->region,
-+ ((PycairoRegion *)other)->region);
-+ Py_END_ALLOW_THREADS;
-+ } else if (PyObject_IsInstance(other,
-+ (PyObject*)&PycairoRectangleInt_Type) == 1) {
-+ Py_BEGIN_ALLOW_THREADS;
-+ res = cairo_region_xor_rectangle(o->region,
-+ &(((PycairoRectangleInt *)other)->rectangle_int));
-+ Py_END_ALLOW_THREADS;
-+ } else {
-+ PyErr_SetString(PyExc_TypeError,
-+ "argument must be a Region or a RectangleInt.");
-+ return NULL;
-+ }
-+ RETURN_NULL_IF_CAIRO_ERROR(res);
-+ Py_RETURN_NONE;
-+}
-+
-+static PyMethodDef region_methods[] = {
-+ /* methods never exposed in a language binding:
-+ * cairo_region_destroy()
-+ * cairo_region_get_type()
-+ * cairo_region_reference()
-+ *
-+ * cairo_region_status()
-+ * - not needed since Pycairo handles status checking
-+ *
-+ * _(intersect/subtract/union/xor)_rectangle are merged with the region
-+ * ones.
-+ */
-+ {"copy", (PyCFunction)region_copy, METH_NOARGS },
-+ {"get_extents", (PyCFunction)region_get_extents, METH_NOARGS },
-+ {"num_rectangles", (PyCFunction)region_num_rectangles, METH_NOARGS },
-+ {"get_rectangle", (PyCFunction)region_get_rectangle, METH_VARARGS },
-+ {"is_empty", (PyCFunction)region_is_empty, METH_NOARGS },
-+ {"contains_point", (PyCFunction)region_contains_point, METH_VARARGS },
-+ {"contains_rectangle", (PyCFunction)region_contains_rectangle,
-+ METH_VARARGS },
-+ {"equal", (PyCFunction)region_equal, METH_VARARGS },
-+ {"translate", (PyCFunction)region_translate, METH_VARARGS },
-+ {"intersect", (PyCFunction)region_intersect, METH_VARARGS },
-+ {"subtract", (PyCFunction)region_subtract, METH_VARARGS },
-+ {"union", (PyCFunction)region_union, METH_VARARGS },
-+ {"xor", (PyCFunction)region_xor, METH_VARARGS },
-+ {NULL, NULL, 0, NULL},
-+};
-+
-+PyTypeObject PycairoRegion_Type = {
-+ PyVarObject_HEAD_INIT(&PyType_Type, 0)
-+ "cairo.Region", /* tp_name */
-+ sizeof(PycairoRegion), /* tp_basicsize */
-+ 0, /* tp_itemsize */
-+ (destructor)region_dealloc, /* tp_dealloc */
-+ 0, /* tp_print */
-+ 0, /* tp_getattr */
-+ 0, /* tp_setattr */
-+ 0, /* tp_compare */
-+ 0, /* tp_repr */
-+ 0, /* tp_as_number */
-+ 0, /* tp_as_sequence */
-+ 0, /* tp_as_mapping */
-+ 0, /* tp_hash */
-+ 0, /* tp_call */
-+ 0, /* tp_str */
-+ 0, /* tp_getattro */
-+ 0, /* tp_setattro */
-+ 0, /* tp_as_buffer */
-+ Py_TPFLAGS_DEFAULT, /* tp_flags */
-+ 0, /* tp_doc */
-+ 0, /* tp_traverse */
-+ 0, /* tp_clear */
-+ (richcmpfunc)region_richcompare, /* tp_richcompare */
-+ 0, /* tp_weaklistoffset */
-+ 0, /* tp_iter */
-+ 0, /* tp_iternext */
-+ region_methods, /* tp_methods */
-+ 0, /* tp_members */
-+ 0, /* tp_getset */
-+ 0, /* tp_base */
-+ 0, /* tp_dict */
-+ 0, /* tp_descr_get */
-+ 0, /* tp_descr_set */
-+ 0, /* tp_dictoffset */
-+ 0, /* tp_init */
-+ 0, /* tp_alloc */
-+ (newfunc)region_new, /* tp_new */
-+};
---- py3cairo-1.10.0+dfsg.orig/src/py3cairo.h
-+++ py3cairo-1.10.0+dfsg/src/py3cairo.h
-@@ -67,6 +67,16 @@ typedef struct {
-
- typedef struct {
- PyObject_HEAD
-+ cairo_rectangle_int_t rectangle_int;
-+} PycairoRectangleInt;
-+
-+typedef struct {
-+ PyObject_HEAD
-+ cairo_region_t *region;
-+} PycairoRegion;
-+
-+typedef struct {
-+ PyObject_HEAD
- cairo_scaled_font_t *scaled_font;
- } PycairoScaledFont;
-
-@@ -129,6 +139,14 @@ typedef struct {
-
- /* misc functions */
- int (*Check_Status)(cairo_status_t status);
-+
-+ PyTypeObject *RectangleInt_Type;
-+ PyObject *(*RectangleInt_FromRectangleInt)(
-+ const cairo_rectangle_int_t *rectangle_int);
-+
-+ PyTypeObject *Region_Type;
-+ PyObject *(*Region_FromRegion)(const cairo_region_t *region);
-+
- } Pycairo_CAPI_t;
-
-
-@@ -156,6 +174,13 @@ typedef struct {
- #define PycairoRadialGradient_Type *(Pycairo_CAPI->RadialGradient_Type)
- #define PycairoPattern_FromPattern (Pycairo_CAPI->Pattern_FromPattern)
-
-+#define PycairoRectangleInt_Type *(Pycairo_CAPI->RectangleInt_Type)
-+#define PycairoRectangleInt_FromRectangleInt \
-+ (Pycairo_CAPI->RectangleInt_FromRectangleInt)
-+
-+#define PycairoRegion_Type *(Pycairo_CAPI->Region_Type)
-+#define PycairoRegion_FromRegion (Pycairo_CAPI->Region_FromRegion)
-+
- #define PycairoScaledFont_Type *(Pycairo_CAPI->ScaledFont_Type)
- #define PycairoScaledFont_FromScaledFont \
- (Pycairo_CAPI->ScaledFont_FromScaledFont)
---- py3cairo-1.10.0+dfsg.orig/src/cairomodule.c
-+++ py3cairo-1.10.0+dfsg/src/cairomodule.c
-@@ -141,6 +141,12 @@ static Pycairo_CAPI_t CAPI = {
- PycairoSurface_FromSurface,
-
- Pycairo_Check_Status,
-+
-+ &PycairoRectangleInt_Type,
-+ PycairoRectangleInt_FromRectangleInt,
-+
-+ &PycairoRegion_Type,
-+ PycairoRegion_FromRegion,
- };
-
- static PyObject *
-@@ -230,6 +236,12 @@ PyInit__cairo(void)
- if (PyType_Ready(&PycairoRadialGradient_Type) < 0)
- return NULL;
-
-+ if (PyType_Ready(&PycairoRectangleInt_Type) < 0)
-+ return NULL;
-+
-+ if (PyType_Ready(&PycairoRegion_Type) < 0)
-+ return NULL;
-+
- if (PyType_Ready(&PycairoScaledFont_Type) < 0)
- return NULL;
-
-@@ -315,6 +327,12 @@ PyInit__cairo(void)
- PyModule_AddObject(m, "RadialGradient",
- (PyObject *)&PycairoRadialGradient_Type);
-
-+ Py_INCREF(&PycairoRectangleInt_Type);
-+ PyModule_AddObject(m, "RectangleInt", (PyObject *)&PycairoRectangleInt_Type);
-+
-+ Py_INCREF(&PycairoRegion_Type);
-+ PyModule_AddObject(m, "Region", (PyObject *)&PycairoRegion_Type);
-+
- Py_INCREF(&PycairoScaledFont_Type);
- PyModule_AddObject(m, "ScaledFont", (PyObject *)&PycairoScaledFont_Type);
-
-@@ -519,6 +537,10 @@ PyInit__cairo(void)
- CONSTANT(PS_LEVEL_3);
- #endif
-
-+ CONSTANT(REGION_OVERLAP_IN);
-+ CONSTANT(REGION_OVERLAP_OUT);
-+ CONSTANT(REGION_OVERLAP_PART);
-+
- CONSTANT(SUBPIXEL_ORDER_DEFAULT);
- CONSTANT(SUBPIXEL_ORDER_RGB);
- CONSTANT(SUBPIXEL_ORDER_BGR);
---- py3cairo-1.10.0+dfsg.orig/src/wscript
-+++ py3cairo-1.10.0+dfsg/src/wscript
-@@ -25,6 +25,7 @@ def build(ctx):
- 'font.c',
- 'path.c',
- 'pattern.c',
-+ 'region.c',
- 'matrix.c',
- 'surface.c',
- ],
---- py3cairo-1.10.0+dfsg.orig/src/private.h
-+++ py3cairo-1.10.0+dfsg/src/private.h
-@@ -60,6 +60,13 @@ extern PyTypeObject PycairoLinearGradien
- extern PyTypeObject PycairoRadialGradient_Type;
- PyObject *PycairoPattern_FromPattern (cairo_pattern_t *pattern,
- PyObject *base);
-+
-+extern PyTypeObject PycairoRectangleInt_Type;
-+PyObject *PycairoRectangleInt_FromRectangleInt (
-+ cairo_rectangle_int_t *rectangle_int);
-+
-+extern PyTypeObject PycairoRegion_Type;
-+PyObject *PycairoRegion_FromRegion (cairo_region_t *region);
-
- extern PyTypeObject PycairoScaledFont_Type;
- PyObject *PycairoScaledFont_FromScaledFont (cairo_scaled_font_t *scaled_font);
-@@ -153,6 +160,15 @@ int Pycairo_Check_Status (cairo_status_t
- if (status != CAIRO_STATUS_SUCCESS) { \
- Pycairo_Check_Status (status); \
- return NULL; \
-+ } \
-+ } while (0)
-+
-+#define RETURN_NULL_IF_CAIRO_REGION_ERROR(region) \
-+ do { \
-+ cairo_status_t status = cairo_region_status (region); \
-+ if (status != CAIRO_STATUS_SUCCESS) { \
-+ Pycairo_Check_Status (status); \
-+ return NULL; \
- } \
- } while (0)
-
---- py3cairo-1.10.0+dfsg.orig/test/api_test.py
-+++ py3cairo-1.10.0+dfsg/test/api_test.py
-@@ -84,3 +84,65 @@ def test_surface():
-
- def test_text():
- pass
-+
-+
-+def test_region():
-+ a = cairo.Region()
-+ assert a.is_empty() == True
-+ assert a.num_rectangles() == 0
-+
-+ b = cairo.RectangleInt(1, 2, 10, 12)
-+ d = cairo.RectangleInt(1, 1, 10, 12)
-+ e = cairo.RectangleInt(1, 3, 8, 12)
-+ assert (b.x, b.y, b.width, b.height) == (1, 2, 10, 12)
-+ c = cairo.Region((b, e))
-+ assert not c.is_empty()
-+ assert c.num_rectangles() == 2
-+ assert c.get_rectangle(1).y == 14
-+
-+ ex = c.get_extents()
-+ assert ex == cairo.RectangleInt(1, 2, 10, 13)
-+ assert c.contains_rectangle(d) == cairo.REGION_OVERLAP_PART
-+
-+ c.translate(10, 20)
-+ assert c.contains_rectangle(d) == cairo.REGION_OVERLAP_OUT
-+ assert c.get_rectangle(1) == cairo.RectangleInt(11, 34, 8, 1)
-+
-+ cp = c.copy()
-+ assert c.num_rectangles() == cp.num_rectangles()
-+ assert c.get_rectangle(0) == cp.get_rectangle(0)
-+ assert c == cp
-+ assert 3 != c
-+ assert c != "test"
-+
-+ c = cairo.Region((b, e))
-+ c.intersect(d)
-+ assert c.num_rectangles() == 1
-+ assert c.get_rectangle(0) == cairo.RectangleInt(1, 2, 10, 11)
-+
-+ c = cairo.Region((b, e))
-+ c.subtract(d)
-+ assert c.num_rectangles() == 2
-+ assert c == cairo.Region([
-+ cairo.RectangleInt(1, 13, 10, 1), cairo.RectangleInt(1, 14, 8, 1) ])
-+
-+ d = cairo.Region(d)
-+ c = cairo.Region((b, e))
-+ c.subtract(d)
-+ assert c.num_rectangles() == 2
-+ assert c.get_rectangle(0) == cairo.RectangleInt(1, 13, 10, 1)
-+
-+ c = cairo.Region((b, e))
-+ c.union(d)
-+ assert c.num_rectangles() == 2
-+ assert c == cairo.Region([
-+ cairo.RectangleInt(1, 1, 10, 13), cairo.RectangleInt(1, 14, 8, 1) ])
-+
-+ c = cairo.Region((b, e))
-+ c.xor(d)
-+ assert c.num_rectangles() == 3
-+ assert c == cairo.Region([
-+ cairo.RectangleInt(1, 1, 10, 1),
-+ cairo.RectangleInt(1, 14, 8, 1),
-+ cairo.RectangleInt(1, 13, 10, 1),
-+ ])
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch b/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch
deleted file mode 100644
index 5356554e75f..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-50_specify-encoding-in-waf.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-Description: specify encoding in waf
- This patch specifies utf-8 as the encoding in waf library, because python 3.3
- doesn't fallback to utf-8 on default.
-Author: Matthias Klose <doko@ubuntu.com>
-Origin: http://launchpadlibrarian.net/120606963/py3cairo_1.10.0%2Bdfsg-3~exp2_1.10.0%2Bdfsg-3~exp2ubuntu1.diff.gz
-Bug-Debian: http://bugs.debian.org/691241
-Last-Update: 2012-10-28
-
---- py3cairo-1.10.0+dfsg.orig/waflib/Utils.py
-+++ py3cairo-1.10.0+dfsg/waflib/Utils.py
-@@ -77,8 +77,8 @@ except ImportError:
- return value
- is_win32=sys.platform=='win32'
- indicator=is_win32 and'\x1b[A\x1b[K%s%s%s\r'or'\x1b[K%s%s%s\r'
--def readf(fname,m='r'):
-- f=open(fname,m)
-+def readf(fname,m='r',enc=None):
-+ f=open(fname,m,encoding=enc)
- try:
- txt=f.read()
- finally:
---- py3cairo-1.10.0+dfsg.orig/waflib/Tools/c_preproc.py
-+++ py3cairo-1.10.0+dfsg/waflib/Tools/c_preproc.py
-@@ -44,7 +44,7 @@ def repl(m):
- return' '
- return m.group(3)or''
- def filter_comments(filename):
-- code=Utils.readf(filename)
-+ code=Utils.readf(filename, enc='utf-8')
- if use_trigraphs:
- for(a,b)in trig_def:code=code.split(a).join(b)
- code=re_nl.sub('',code)
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch b/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch
deleted file mode 100644
index 3e0cdc3e61f..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-80_fix-pickle.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-Description: During the build process, a Context instance is pickled, or at
- least attempted to be. This fails because self.node_class is assigned to a
- class which is nested inside the __init__() method. Because Python cannot
- find this class at unpickling time (i.e. it cannot be imported), Python
- refuses to pickle the Context instance, leading to a FTBFS. Since there's no
- obvious reason why the class has to be so nested, moving it to a module
- global solves the build failure.
-Author: Barry Warsaw <barry@debian.org>
-Bug: https://bugs.freedesktop.org/show_bug.cgi?id=91561
-
---- a/waflib/Context.py
-+++ b/waflib/Context.py
-@@ -51,6 +51,8 @@
- global classes
- classes.insert(0,cls)
- ctx=store_context('ctx',(object,),{})
-+class node_class(waflib.Node.Node):
-+ pass
- class Context(ctx):
- errors=Errors
- tools={}
-@@ -60,8 +62,6 @@
- except KeyError:
- global run_dir
- rd=run_dir
-- class node_class(waflib.Node.Node):
-- pass
- self.node_class=node_class
- self.node_class.__module__="waflib.Node"
- self.node_class.__name__="Nod3"
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch b/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch
deleted file mode 100644
index 3aad32593b3..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-81_pickling-again.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-Description: Follow up to 80_fix-pickle.patch. Just disable pickling
- altogether since the previous patch doesn't really fix the problem, and not
- storing the pickle seems to have no adverse effects on the build, while
- avoiding the observed traceback.
-Author: Barry Warsaw <barry@debian.org>
-Forwarded: no
-
---- a/waflib/Build.py
-+++ b/waflib/Build.py
-@@ -151,6 +151,7 @@
- f.close()
- self.init_dirs()
- def store(self):
-+ return
- data={}
- for x in SAVED_ATTRS:
- data[x]=getattr(self,x)
---- a/waflib/Context.py
-+++ b/waflib/Context.py
-@@ -51,8 +51,6 @@
- global classes
- classes.insert(0,cls)
- ctx=store_context('ctx',(object,),{})
--class node_class(waflib.Node.Node):
-- pass
- class Context(ctx):
- errors=Errors
- tools={}
-@@ -62,6 +60,8 @@
- except KeyError:
- global run_dir
- rd=run_dir
-+ class node_class(waflib.Node.Node):
-+ pass
- self.node_class=node_class
- self.node_class.__module__="waflib.Node"
- self.node_class.__name__="Nod3"
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch b/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch
deleted file mode 100644
index 572a5f6cc71..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-svg_check.patch
+++ /dev/null
@@ -1,126 +0,0 @@
---- src/cairomodule.c
-+++ src/cairomodule.c
-@@ -116,7 +116,7 @@
- #else
- 0,
- #endif
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- &PycairoSVGSurface_Type,
- #else
- 0,
-@@ -247,7 +247,7 @@
- if (PyType_Ready(&PycairoPSSurface_Type) < 0)
- return NULL;
- #endif
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- if (PyType_Ready(&PycairoSVGSurface_Type) < 0)
- return NULL;
- #endif
-@@ -337,7 +337,7 @@
- PyModule_AddObject(m, "PSSurface", (PyObject *)&PycairoPSSurface_Type);
- #endif
-
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- Py_INCREF(&PycairoSVGSurface_Type);
- PyModule_AddObject(m, "SVGSurface", (PyObject *)&PycairoSVGSurface_Type);
- #endif
-@@ -399,7 +399,7 @@
- #else
- PyModule_AddIntConstant(m, "HAS_PS_SURFACE", 0);
- #endif
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 1);
- #else
- PyModule_AddIntConstant(m, "HAS_SVG_SURFACE", 0);
---- src/private.h
-+++ src/private.h
-@@ -75,7 +75,7 @@
- extern PyTypeObject PycairoPSSurface_Type;
- #endif
-
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- extern PyTypeObject PycairoSVGSurface_Type;
- #endif
-
---- src/py3cairo.h
-+++ src/py3cairo.h
-@@ -171,7 +171,7 @@
- #define PycairoPSSurface_Type *(Pycairo_CAPI->PSSurface_Type)
- #endif
-
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- #define PycairoSVGSurface_Type *(Pycairo_CAPI->SVGSurface_Type)
- #endif
-
---- src/surface.c
-+++ src/surface.c
-@@ -72,7 +72,7 @@
- type = &PycairoPSSurface_Type;
- break;
- #endif
--#if CAIRO_HAS_SVG_SURFACE
-+#if PYCAIRO_ENABLE_SVG
- case CAIRO_SURFACE_TYPE_SVG:
- type = &PycairoSVGSurface_Type;
- break;
-@@ -1022,7 +1022,7 @@
-
-
- /* Class SVGSurface(Surface) ----------------------------------------------- */
--#ifdef CAIRO_HAS_SVG_SURFACE
-+#ifdef PYCAIRO_ENABLE_SVG
- #include <cairo-svg.h>
-
- static PyObject *
-@@ -1133,7 +1133,7 @@
- 0, /* tp_is_gc */
- 0, /* tp_bases */
- };
--#endif /* CAIRO_HAS_SVG_SURFACE */
-+#endif /* PYCAIRO_ENABLE_SVG */
-
-
- #if CAIRO_HAS_WIN32_SURFACE
---- wscript
-+++ wscript
-@@ -1,6 +1,7 @@
- # -*- python -*-
-
- import os
-+import subprocess
-
- top = '.'
- out = 'build_directory'
-@@ -11,6 +12,17 @@
- cairo_version_required = '1.10.0'
-
-
-+def check_svg():
-+ if os.environ.get('PYCAIRO_DISABLE_SVG', None) is None:
-+ return_code = subprocess.call(['pkg-config', '--exists', 'cairo-svg'])
-+ if return_code == 0:
-+ return True
-+ else:
-+ return False
-+ else:
-+ return False
-+
-+
- def options(ctx):
- print(' %s/options()' %d)
- ctx.tool_options('gnu_dirs')
-@@ -39,6 +51,8 @@
- ctx.define('PYCAIRO_VERSION_MAJOR', version[0])
- ctx.define('PYCAIRO_VERSION_MINOR', version[1])
- ctx.define('PYCAIRO_VERSION_MICRO', version[2])
-+ if check_svg():
-+ ctx.define('PYCAIRO_ENABLE_SVG', 1)
-
- ctx.write_config_header('src/config.h')
-
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch b/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch
deleted file mode 100644
index 6e79db9ba27..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-waf-py3_4.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/waflib/Tools/python.py
-+++ b/waflib/Tools/python.py
-@@ -169,7 +169,7 @@
- conf.find_program('python-config-%s'%num,var='PYTHON_CONFIG',mandatory=False)
- includes=[]
- if conf.env.PYTHON_CONFIG:
-- for incstr in conf.cmd_and_log(conf.env.PYTHON+[conf.env.PYTHON_CONFIG,'--includes']).strip().split():
-+ for incstr in conf.cmd_and_log([conf.env.PYTHON_CONFIG,'--includes']).strip().split():
- if(incstr.startswith('-I')or incstr.startswith('/I')):
- incstr=incstr[2:]
- if incstr not in includes:
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch b/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch
deleted file mode 100644
index 7d54ba160d6..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-waf-unpack.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- a/waf
-+++ b/waf
-@@ -153,6 +153,9 @@
- return dir
-
- wafdir = find_lib()
-+if sys.argv[1:] == ['unpack']:
-+ print(wafdir)
-+ exit()
- sys.path.insert(0, wafdir)
- from waflib.Tools.c_config import MACRO_TO_DESTOS
- MACRO_TO_DESTOS['__POWERPC__'] = 'darwin'
diff --git a/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch b/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch
deleted file mode 100644
index 33de2692f83..00000000000
--- a/dev-python/pycairo/files/pycairo-1.10.0-xpyb.patch
+++ /dev/null
@@ -1,41 +0,0 @@
---- pycairo-1.10.0/wscript
-+++ pycairo-1.10.0/wscript
-@@ -10,6 +10,7 @@
- APPNAME='pycairo'
- VERSION='1.10.0'
- cairo_version_required = '1.10.0'
-+xpyb_version_required = '1.3' # optional
-
-
- def check_svg():
-@@ -23,6 +24,17 @@
- return False
-
-
-+def check_xpyb():
-+ if os.environ.get('PYCAIRO_DISABLE_XPYB', None) is None:
-+ return_code = subprocess.call(['pkg-config', '--exists', 'xpyb'])
-+ if return_code == 0:
-+ return True
-+ else:
-+ return False
-+ else:
-+ return False
-+
-+
- def options(ctx):
- print(' %s/options()' %d)
- ctx.tool_options('gnu_dirs')
-@@ -42,6 +54,12 @@
- ctx.check_cfg(package='cairo', atleast_version=cairo_version_required,
- args='--cflags --libs')
-
-+# xpyb for Python 3 is not available yet.
-+# the Python 3 version should probably have a different name than 'xpyb'
-+# if check_xpyb():
-+# ctx.check_cfg(package='xpyb', atleast_version=xpyb_version_required,
-+# args='--cflags --libs', mandatory=False)
-+
- # add gcc options
- if env['CC_NAME'] == 'gcc':
- env.append_unique('CCFLAGS', ['-std=c99', '-Wall'])
diff --git a/dev-python/pycairo/pycairo-1.10.0-r5.ebuild b/dev-python/pycairo/pycairo-1.10.0-r5.ebuild
index 7a63fcf48d4..b61eec3973d 100644
--- a/dev-python/pycairo/pycairo-1.10.0-r5.ebuild
+++ b/dev-python/pycairo/pycairo-1.10.0-r5.ebuild
@@ -15,7 +15,8 @@ DESCRIPTION="Python bindings for the cairo library"
HOMEPAGE="http://cairographics.org/pycairo/ https://pypi.python.org/pypi/pycairo"
SRC_URI="
http://cairographics.org/releases/py2cairo-${PYCAIRO_PYTHON2_VERSION}.tar.bz2
- http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2"
+ http://cairographics.org/releases/pycairo-${PYCAIRO_PYTHON3_VERSION}.tar.bz2
+ https://dev.gentoo.org/~mgorny/dist/${P}-gentoo-patchset.tar.bz2"
# LGPL-3 for pycairo 1.10.0.
# || ( LGPL-2.1 MPL-1.1 ) for pycairo 1.8.10.
@@ -39,19 +40,19 @@ src_prepare() {
pushd "${WORKDIR}/pycairo-${PYCAIRO_PYTHON3_VERSION}" > /dev/null || die
rm -f src/config.h || die
epatch \
- "${FILESDIR}/${PN}-1.10.0-svg_check.patch" \
- "${FILESDIR}/${PN}-1.10.0-xpyb.patch" \
- "${FILESDIR}/${PN}-1.10.0-waf-unpack.patch" \
- "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch \
- "${FILESDIR}"/pycairo-1.10.0-101_pycairo-region.patch
+ "${WORKDIR}/${P}-gentoo-patchset/${PN}-1.10.0-svg_check.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset/${PN}-1.10.0-xpyb.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset/${PN}-1.10.0-waf-unpack.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset"/py2cairo-1.10.0-ppc-darwin.patch \
+ "${WORKDIR}/${P}-gentoo-patchset"/pycairo-1.10.0-101_pycairo-region.patch
popd > /dev/null
pushd "${WORKDIR}/py2cairo-${PYCAIRO_PYTHON2_VERSION}" > /dev/null || die
rm -f src/config.h || die
epatch \
- "${FILESDIR}/py2cairo-1.10.0-svg_check.patch" \
- "${FILESDIR}/py2cairo-1.10.0-xpyb.patch" \
- "${FILESDIR}"/py2cairo-1.10.0-ppc-darwin.patch
+ "${WORKDIR}/${P}-gentoo-patchset/py2cairo-1.10.0-svg_check.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset/py2cairo-1.10.0-xpyb.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset"/py2cairo-1.10.0-ppc-darwin.patch
popd > /dev/null
preparation() {
@@ -61,10 +62,10 @@ src_prepare() {
wafdir="$(./waf unpack)"
pushd "${wafdir}" > /dev/null || die
epatch \
- "${FILESDIR}/${PN}-1.10.0-waf-py3_4.patch" \
- "${FILESDIR}"/pycairo-1.10.0-50_specify-encoding-in-waf.patch \
- "${FILESDIR}"/pycairo-1.10.0-80_fix-pickle.patch \
- "${FILESDIR}"/pycairo-1.10.0-81_pickling-again.patch
+ "${WORKDIR}/${P}-gentoo-patchset/${PN}-1.10.0-waf-py3_4.patch" \
+ "${WORKDIR}/${P}-gentoo-patchset"/pycairo-1.10.0-50_specify-encoding-in-waf.patch \
+ "${WORKDIR}/${P}-gentoo-patchset"/pycairo-1.10.0-80_fix-pickle.patch \
+ "${WORKDIR}/${P}-gentoo-patchset"/pycairo-1.10.0-81_pickling-again.patch
popd > /dev/null
popd > /dev/null
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2020-01-26 17:45 Michał Górny
0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2020-01-26 17:45 UTC (permalink / raw
To: gentoo-commits
commit: 26c30981bc0ab3c9035ae043a297453641c2bd10
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 26 17:29:34 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan 26 17:45:31 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26c30981
dev-python/pycairo: Remove redundant versions
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/pycairo/Manifest | 3 -
.../files/pycairo-1.17.0-pkgconfigdir.patch | 71 ----------------------
dev-python/pycairo/pycairo-1.16.3-r1.ebuild | 48 ---------------
dev-python/pycairo/pycairo-1.17.0-r1.ebuild | 57 -----------------
dev-python/pycairo/pycairo-1.18.1.ebuild | 55 -----------------
5 files changed, 234 deletions(-)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
index 34b639ececf..131b894f4ca 100644
--- a/dev-python/pycairo/Manifest
+++ b/dev-python/pycairo/Manifest
@@ -1,4 +1 @@
-DIST pycairo-1.16.3.tar.gz 188610 BLAKE2B 71034891bae636e23379a3fdc49c9163cff61183fe46c4027bbad3206e72255e60081dbc3cb02808d5c3840b618f6c12f8106ca5a08ddb226a65917ba2da390c SHA512 d60978f85eb0430f2038b0e7d0bce23602e8c180a7611eea424fd8bc3cdd8ce249af364abd0e77ab3b7ab439761721cba5c2398f51af2a89add3fb7fda8aa5db
-DIST pycairo-1.17.0.tar.gz 192182 BLAKE2B b7a4db8258b03b89878fca6b5e27bb9037b74b1792ded23edfe38a0aa5e9ba5003bbac2c8623a6ace8033960c3199b307dcb689650e21ba2df0d81a36a71b6cf SHA512 c073f04d92c9a577f7dcea8d46335751ebd896a65e682e99e4453877d8ba2cadad4437f4ceb1ce8c05eb87d5757a2bd78ac2549e63e38720f4c9276e6f70bdd5
-DIST pycairo-1.18.1.tar.gz 200610 BLAKE2B 47e707f3481d816e9fcd72d169d7ab9210f746396a45a6c9cdac946b4dca9529515ebe1a288d985eed659ff23488bec2cf3e0fb8d11c160349530871ed05881f SHA512 fef6b0d863d45a182a1ba671ddc4f6cb15745447cdaed3e1efeb05fad97f02aa0a56698517648a942bde263d74e06ad7781bcf487757aeb3b124ef64dc525024
DIST pycairo-1.18.2.tar.gz 200462 BLAKE2B 1f755dc90fe3ee50aa68273a0816752312f144831ff857709e1a4695a58646ffe6be518733480ed37231c213a11d4e5aaf8dfd1cfa68104873bc7d4192435b89 SHA512 279ea80413ba55d493d51455685da09afa1f5c45e2930c3fca3e417a8afe6645a0d8131201f79482de59e5ec56cfef62eac65ed88fe88866bfcc06503dcc59e0
diff --git a/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch b/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch
deleted file mode 100644
index d4d75a172d6..00000000000
--- a/dev-python/pycairo/files/pycairo-1.17.0-pkgconfigdir.patch
+++ /dev/null
@@ -1,71 +0,0 @@
-From 430c6ffb65cd839be5ba6266a89f645afa8f9442 Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 14 Oct 2018 12:30:56 +0200
-Subject: [PATCH] setup.py: Support specifying custom --pkgconfigdir
-
-Support overriding --pkgconfigdir for whenever the autodetection
-gives incorrect result (e.g. PyPy). Fixes #119.
----
- setup.py | 21 ++++++++++++++++++---
- 1 file changed, 18 insertions(+), 3 deletions(-)
-
-diff --git a/setup.py b/setup.py
-index 36641d9..75c8888 100755
---- a/setup.py
-+++ b/setup.py
-@@ -14,6 +14,7 @@ except ImportError:
- from distutils.core import Extension, Command, Distribution
- from distutils.ccompiler import new_compiler
- from distutils.sysconfig import customize_compiler
-+from distutils.util import change_root
- from distutils import log
- from distutils import sysconfig
-
-@@ -265,11 +266,15 @@ class test_cmd(Command):
-
- class install_pkgconfig(Command):
- description = "install .pc file"
-- user_options = []
-+ user_options = [
-+ ('pkgconfigdir=', None, 'pkg-config file install directory'),
-+ ]
-
- def initialize_options(self):
-+ self.root = None
- self.install_base = None
- self.install_data = None
-+ self.pkgconfigdir = None
- self.compiler_type = None
- self.outfiles = []
-
-@@ -280,6 +285,11 @@ class install_pkgconfig(Command):
- ('install_data', 'install_data'),
- )
-
-+ self.set_undefined_options(
-+ 'install',
-+ ('root', 'root'),
-+ )
-+
- self.set_undefined_options(
- 'build_ext',
- ('compiler_type', 'compiler_type'),
-@@ -315,8 +325,13 @@ class install_pkgconfig(Command):
- "Skipping install_pkgconfig, not supported with MSVC")
- return
-
-- python_lib = sysconfig.get_python_lib(True, True, self.install_data)
-- pkgconfig_dir = os.path.join(os.path.dirname(python_lib), 'pkgconfig')
-+ if self.pkgconfigdir is None:
-+ python_lib = sysconfig.get_python_lib(True, True,
-+ self.install_data)
-+ pkgconfig_dir = os.path.join(os.path.dirname(python_lib),
-+ 'pkgconfig')
-+ else:
-+ pkgconfig_dir = change_root(self.root, self.pkgconfigdir)
- self.mkpath(pkgconfig_dir)
-
- pcname = "py3cairo.pc" if sys.version_info[0] == 3 else "pycairo.pc"
---
-2.19.1
-
diff --git a/dev-python/pycairo/pycairo-1.16.3-r1.ebuild b/dev-python/pycairo/pycairo-1.16.3-r1.ebuild
deleted file mode 100644
index c957ba9a2d7..00000000000
--- a/dev-python/pycairo/pycairo-1.16.3-r1.ebuild
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-PYTHON_COMPAT=( python2_7 python3_6 pypy3 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1
-
-DESCRIPTION="Python bindings for the cairo library"
-HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
-SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="doc examples test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=x11-libs/cairo-1.13.1[svg]
-"
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- test? (
- dev-python/pytest[${PYTHON_USEDEP}]
- dev-python/hypothesis[${PYTHON_USEDEP}]
- )
-"
-
-python_compile_all() {
- use doc && emake -C docs
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install_all() {
- use doc && local HTML_DOCS=( docs/_build/. )
-
- if use examples; then
- dodoc -r examples
- fi
-
- distutils-r1_python_install_all
-}
diff --git a/dev-python/pycairo/pycairo-1.17.0-r1.ebuild b/dev-python/pycairo/pycairo-1.17.0-r1.ebuild
deleted file mode 100644
index 374788a138c..00000000000
--- a/dev-python/pycairo/pycairo-1.17.0-r1.ebuild
+++ /dev/null
@@ -1,57 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="6"
-
-PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1
-
-DESCRIPTION="Python bindings for the cairo library"
-HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
-SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="doc examples test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=x11-libs/cairo-1.13.1[svg]
-"
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- test? (
- dev-python/pytest[${PYTHON_USEDEP}]
- dev-python/hypothesis[${PYTHON_USEDEP}]
- )
-"
-
-PATCHES=(
- "${FILESDIR}"/pycairo-1.17.0-pkgconfigdir.patch
-)
-
-python_compile_all() {
- use doc && emake -C docs
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install() {
- distutils-r1_python_install \
- install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
-}
-
-python_install_all() {
- use doc && local HTML_DOCS=( docs/_build/. )
-
- if use examples; then
- dodoc -r examples
- fi
-
- distutils-r1_python_install_all
-}
diff --git a/dev-python/pycairo/pycairo-1.18.1.ebuild b/dev-python/pycairo/pycairo-1.18.1.ebuild
deleted file mode 100644
index ea83bd34530..00000000000
--- a/dev-python/pycairo/pycairo-1.18.1.ebuild
+++ /dev/null
@@ -1,55 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PYTHON_COMPAT=( python2_7 python3_{6,7} pypy3 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1
-
-DESCRIPTION="Python bindings for the cairo library"
-HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
-SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="doc examples test"
-RESTRICT="!test? ( test )"
-
-RDEPEND="
- >=x11-libs/cairo-1.13.1[svg]
-"
-DEPEND="${RDEPEND}
- doc? ( dev-python/sphinx )
- test? (
- dev-python/pytest[${PYTHON_USEDEP}]
- dev-python/hypothesis[${PYTHON_USEDEP}]
- )
-"
-
-python_compile_all() {
- if use doc; then
- sphinx-build docs -b html _build/html || die
- fi
-}
-
-python_test() {
- esetup.py test
-}
-
-python_install() {
- distutils-r1_python_install \
- install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
-}
-
-python_install_all() {
- use doc && local HTML_DOCS=( _build/html/. )
-
- if use examples; then
- dodoc -r examples
- fi
-
- distutils-r1_python_install_all
-}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2020-06-05 22:43 Andreas Sturmlechner
0 siblings, 0 replies; 7+ messages in thread
From: Andreas Sturmlechner @ 2020-06-05 22:43 UTC (permalink / raw
To: gentoo-commits
commit: 777b3dfa6443cdbe584b353b51596b54563e6ff4
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 5 16:20:06 2020 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Fri Jun 5 22:42:06 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=777b3dfa
dev-python/pycairo: fix test failure
See also: https://bugs.python.org/issue40246
Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
dev-python/pycairo/files/pycairo-1.19.1-py39.patch | 26 ++++++++++++++++++++++
dev-python/pycairo/pycairo-1.18.2.ebuild | 2 ++
dev-python/pycairo/pycairo-1.19.1.ebuild | 2 ++
3 files changed, 30 insertions(+)
diff --git a/dev-python/pycairo/files/pycairo-1.19.1-py39.patch b/dev-python/pycairo/files/pycairo-1.19.1-py39.patch
new file mode 100644
index 00000000000..97b20227ce8
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.19.1-py39.patch
@@ -0,0 +1,26 @@
+From 3ecf0a4060d6de3b92a77a393ece663455cf6add Mon Sep 17 00:00:00 2001
+From: Christoph Reiter <reiter.christoph@gmail.com>
+Date: Sun, 10 May 2020 11:22:40 +0200
+Subject: [PATCH] tests: Fix syntax issue with Python 3.9
+
+https://bugs.python.org/issue40246
+
+I haven't actually tested with 3.9 yet, so this is just what I found
+with grep.
+---
+ tests/test_enums.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/test_enums.py b/tests/test_enums.py
+index 4bc2e3d..02756d0 100644
+--- a/tests/test_enums.py
++++ b/tests/test_enums.py
+@@ -79,7 +79,7 @@ def get_prefix(t):
+ # special case..
+ if name == "PathDataType":
+ name = "Path"
+- return"_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)])
++ return "_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)])
+
+ for t in types_:
+ for name in dir(t):
diff --git a/dev-python/pycairo/pycairo-1.18.2.ebuild b/dev-python/pycairo/pycairo-1.18.2.ebuild
index 7ee4d6f3216..b8e47a44e65 100644
--- a/dev-python/pycairo/pycairo-1.18.2.ebuild
+++ b/dev-python/pycairo/pycairo-1.18.2.ebuild
@@ -28,6 +28,8 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}/${PN}-1.19.1-py39.patch" )
+
distutils_enable_sphinx docs \
dev-python/sphinx_rtd_theme
distutils_enable_tests setup.py
diff --git a/dev-python/pycairo/pycairo-1.19.1.ebuild b/dev-python/pycairo/pycairo-1.19.1.ebuild
index 01000a3ce9a..b05ecffc14d 100644
--- a/dev-python/pycairo/pycairo-1.19.1.ebuild
+++ b/dev-python/pycairo/pycairo-1.19.1.ebuild
@@ -28,6 +28,8 @@ RDEPEND="
"
DEPEND="${RDEPEND}"
+PATCHES=( "${FILESDIR}/${P}-py39.patch" )
+
distutils_enable_sphinx docs \
dev-python/sphinx_rtd_theme
distutils_enable_tests setup.py
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2020-11-22 15:46 Michał Górny
0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2020-11-22 15:46 UTC (permalink / raw
To: gentoo-commits
commit: e4bfcb396befd930753c877935f5be88ac4a838a
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 22 15:44:14 2020 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov 22 15:44:14 2020 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e4bfcb39
dev-python/pycairo: Remove old
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/pycairo/Manifest | 1 -
dev-python/pycairo/files/pycairo-1.19.1-py39.patch | 26 ------------
dev-python/pycairo/pycairo-1.19.1.ebuild | 48 ----------------------
3 files changed, 75 deletions(-)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
index 560251fc776..567b0453054 100644
--- a/dev-python/pycairo/Manifest
+++ b/dev-python/pycairo/Manifest
@@ -1,2 +1 @@
-DIST pycairo-1.19.1.tar.gz 205196 BLAKE2B 504334628daf75dd9145c97fbd86ea133b4be225ce7fa911b48231ebd5434678ffa7b1f185e0527f96b4b36955e788d0bb4fa4d308843e5ae9b20a41d2126301 SHA512 a7955a2566d5e5586154b62f3aeef824e1e6076cbd3eb86af8288fedcc7d61c4e36a53691298cf9df2e2df7fc96292f96dec92c5d4343e6c1b4c971e97d0650f
DIST pycairo-1.20.0.tar.gz 344370 BLAKE2B b72a3dfd3ad6332f6be2c0fc0650ef87d97a51881bd239421cdb6355016e952093f9fa05b7872d7cce4a50bc4bac27ff0fb4c11e446e51ada9d7c1adc019a175 SHA512 d32d008b741653d02324b206a438f5fd85f2a433201d6f8b98c8f1adc712abea611a4b5ed95c55258efb662dc579eed6b2f752b10d9fc2b6a7c8e5edd19e5266
diff --git a/dev-python/pycairo/files/pycairo-1.19.1-py39.patch b/dev-python/pycairo/files/pycairo-1.19.1-py39.patch
deleted file mode 100644
index 97b20227ce8..00000000000
--- a/dev-python/pycairo/files/pycairo-1.19.1-py39.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From 3ecf0a4060d6de3b92a77a393ece663455cf6add Mon Sep 17 00:00:00 2001
-From: Christoph Reiter <reiter.christoph@gmail.com>
-Date: Sun, 10 May 2020 11:22:40 +0200
-Subject: [PATCH] tests: Fix syntax issue with Python 3.9
-
-https://bugs.python.org/issue40246
-
-I haven't actually tested with 3.9 yet, so this is just what I found
-with grep.
----
- tests/test_enums.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/test_enums.py b/tests/test_enums.py
-index 4bc2e3d..02756d0 100644
---- a/tests/test_enums.py
-+++ b/tests/test_enums.py
-@@ -79,7 +79,7 @@ def get_prefix(t):
- # special case..
- if name == "PathDataType":
- name = "Path"
-- return"_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)])
-+ return "_".join([s.upper() for s in re.findall('[A-Z][^A-Z]*', name)])
-
- for t in types_:
- for name in dir(t):
diff --git a/dev-python/pycairo/pycairo-1.19.1.ebuild b/dev-python/pycairo/pycairo-1.19.1.ebuild
deleted file mode 100644
index 8891e238752..00000000000
--- a/dev-python/pycairo/pycairo-1.19.1.ebuild
+++ /dev/null
@@ -1,48 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI="7"
-
-PYTHON_COMPAT=( python3_{6..9} pypy3 )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1
-
-DESCRIPTION="Python bindings for the cairo library"
-HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
-SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
-
-LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
-SLOT="0"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 ~s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
-IUSE="examples"
-
-BDEPEND="
- test? (
- dev-python/hypothesis[${PYTHON_USEDEP}]
- dev-python/pytest[${PYTHON_USEDEP}]
- )
-"
-RDEPEND="
- >=x11-libs/cairo-1.13.1[svg]
-"
-DEPEND="${RDEPEND}"
-
-PATCHES=( "${FILESDIR}/${P}-py39.patch" )
-
-distutils_enable_sphinx docs \
- dev-python/sphinx_rtd_theme
-distutils_enable_tests setup.py
-
-python_install() {
- distutils-r1_python_install \
- install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
-}
-
-python_install_all() {
- if use examples; then
- dodoc -r examples
- fi
-
- distutils-r1_python_install_all
-}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2023-05-05 5:05 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2023-05-05 5:05 UTC (permalink / raw
To: gentoo-commits
commit: ba59c6b3f69a5053649a2f8e47146a48bdd2a437
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri May 5 05:05:13 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 5 05:05:13 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ba59c6b3
dev-python/pycairo: fix build w/ USE=doc
Thanks to Chris Mayo.
Closes: https://bugs.gentoo.org/890411
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../pycairo/files/pycairo-1.23.0-fix-sphinx.patch | 28 ++++++++++++++++++++++
dev-python/pycairo/pycairo-1.23.0.ebuild | 4 ++++
2 files changed, 32 insertions(+)
diff --git a/dev-python/pycairo/files/pycairo-1.23.0-fix-sphinx.patch b/dev-python/pycairo/files/pycairo-1.23.0-fix-sphinx.patch
new file mode 100644
index 000000000000..a86dd935e482
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.23.0-fix-sphinx.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/890411
+https://github.com/pygobject/pycairo/pull/318
+
+From 9e78bd1acbaef6659dbe3076934ed779eac27a96 Mon Sep 17 00:00:00 2001
+From: Chris Mayo <aklhfex@gmail.com>
+Date: Sun, 23 Apr 2023 19:44:26 +0100
+Subject: [PATCH] docs: Fix build failure due to extlinks with Sphinx 6
+
+extlinks caption must be None or contain one %s.
+
+Compatible with Sphinx >= 4.0.
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -48,10 +48,10 @@ def exec_module(path):
+ ]
+
+ extlinks = {
+- 'fdobug': ('https://bugs.freedesktop.org/show_bug.cgi?id=%s', '#fdo-'),
+- 'bug': ('https://github.com/pygobject/pycairo/issues/%s', '#'),
+- 'pr': ('https://github.com/pygobject/pycairo/pull/%s', '#pr-'),
+- 'user': ('https://github.com/%s', ''),
++ 'fdobug': ('https://bugs.freedesktop.org/show_bug.cgi?id=%s', '#fdo-%s'),
++ 'bug': ('https://github.com/pygobject/pycairo/issues/%s', '#%s'),
++ 'pr': ('https://github.com/pygobject/pycairo/pull/%s', '#pr-%s'),
++ 'user': ('https://github.com/%s', '%s'),
+ }
+ suppress_warnings = ["image.nonlocal_uri"]
+
diff --git a/dev-python/pycairo/pycairo-1.23.0.ebuild b/dev-python/pycairo/pycairo-1.23.0.ebuild
index 9794a33c7be1..79497ecd3bc0 100644
--- a/dev-python/pycairo/pycairo-1.23.0.ebuild
+++ b/dev-python/pycairo/pycairo-1.23.0.ebuild
@@ -38,6 +38,10 @@ DEPEND="
x11-base/xorg-proto
"
+PATCHES=(
+ "${FILESDIR}"/${PN}-1.23.0-fix-sphinx.patch
+)
+
distutils_enable_sphinx docs \
dev-python/sphinx-rtd-theme
distutils_enable_tests pytest
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2023-10-17 15:11 Michał Górny
0 siblings, 0 replies; 7+ messages in thread
From: Michał Górny @ 2023-10-17 15:11 UTC (permalink / raw
To: gentoo-commits
commit: 1716ef9b38d0e9865bd6394611d3a73a29b561db
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Oct 17 14:53:48 2023 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 17 15:11:05 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1716ef9b
dev-python/pycairo: Bump to 1.25.0
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
dev-python/pycairo/Manifest | 1 +
dev-python/pycairo/files/pycairo-1.25.0-init.patch | 43 ++++++++++++
dev-python/pycairo/pycairo-1.25.0.ebuild | 77 ++++++++++++++++++++++
3 files changed, 121 insertions(+)
diff --git a/dev-python/pycairo/Manifest b/dev-python/pycairo/Manifest
index 7d7dc567ee93..60ac285971ac 100644
--- a/dev-python/pycairo/Manifest
+++ b/dev-python/pycairo/Manifest
@@ -1 +1,2 @@
DIST pycairo-1.24.0.tar.gz 344850 BLAKE2B f1469254ccfcb96ee5e39af49fcae575717e2f0e9a3dc74a13408306b5c94f4557a9c6d6a448541cb1f6dd27781e484b37d5ea9f230dc87f9d3370fac31dfdba SHA512 bbc160bc9c3c9365018c680f6a69347bc222cdaec10ea48d18aedd0341048df74973d3299d783662adf02b414874824660da10943d88f64c30451d3fdccc63fb
+DIST pycairo-1.25.0.tar.gz 347794 BLAKE2B d05c1f505059c181d176b533ff4753e90888189160b1904531da4d9e9b784976442acb8c848be48d23e04f1fd07fef88a05b374c833ecee1c0b0e2881dadd4d0 SHA512 f34df509d36fbc739e8ddb40e2ead473db6970eacb7a2b0ccad8b82fd41a5daa25c89a5d34e7f2b2b70c4bf74e4e9d87465414aa414280e0aa7a4787b05712da
diff --git a/dev-python/pycairo/files/pycairo-1.25.0-init.patch b/dev-python/pycairo/files/pycairo-1.25.0-init.patch
new file mode 100644
index 000000000000..cc670618a261
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.25.0-init.patch
@@ -0,0 +1,43 @@
+From 1ef1ea2f0ba3854309114a2395734c34a1e158d8 Mon Sep 17 00:00:00 2001
+From: Tycho Andersen <tycho@tycho.pizza>
+Date: Mon, 16 Oct 2023 20:01:52 -0600
+Subject: [PATCH] module: reorder cairo script surface initialization
+
+PyType_Ready() expects subclasses to be initialized after base classes.
+Since ScriptSurface inherits from Surface, Surface must be initialized
+first.
+
+This causes a segfault in pypy3.10, and the fix was suggested here:
+
+https://foss.heptapod.net/pypy/pypy/-/issues/4017#note_332375
+
+This fixes the seg fault for me.
+
+Signed-off-by: Tycho Andersen <tycho@tycho.pizza>
+---
+ cairo/cairomodule.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/cairo/cairomodule.c b/cairo/cairomodule.c
+index 0026a0e..f27330f 100644
+--- a/cairo/cairomodule.c
++++ b/cairo/cairomodule.c
+@@ -210,6 +210,9 @@ PYCAIRO_MODINIT_FUNC PyInit__cairo(void)
+ if (PyType_Ready(&PycairoTextExtents_Type) < 0)
+ return NULL;
+
++ if (PyType_Ready(&PycairoSurface_Type) < 0)
++ return NULL;
++
+ #ifdef CAIRO_HAS_SCRIPT_SURFACE
+ if (PyType_Ready(&PycairoScriptDevice_Type) < 0)
+ return NULL;
+@@ -223,8 +226,6 @@ PYCAIRO_MODINIT_FUNC PyInit__cairo(void)
+ if (PyType_Ready(&PycairoScaledFont_Type) < 0)
+ return NULL;
+
+- if (PyType_Ready(&PycairoSurface_Type) < 0)
+- return NULL;
+ #ifdef CAIRO_HAS_IMAGE_SURFACE
+ if (PyType_Ready(&PycairoImageSurface_Type) < 0)
+ return NULL;
diff --git a/dev-python/pycairo/pycairo-1.25.0.ebuild b/dev-python/pycairo/pycairo-1.25.0.ebuild
new file mode 100644
index 000000000000..855fe827c15a
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.25.0.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="Python bindings for the cairo library"
+HOMEPAGE="
+ https://www.cairographics.org/pycairo/
+ https://github.com/pygobject/pycairo/
+ https://pypi.org/project/pycairo/
+"
+SRC_URI="
+ https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz
+"
+
+LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="examples"
+
+BDEPEND="
+ virtual/pkgconfig
+ test? (
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="
+ >=x11-libs/cairo-1.15.10[svg(+)]
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+"
+
+distutils_enable_sphinx docs \
+ dev-python/sphinx-rtd-theme
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}/${P}-init.patch"
+)
+
+python_test() {
+ esetup.py build_tests
+ epytest
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # we need to pass --root via install command, sigh
+ cat > "${T}/distutils-extra.cfg" <<-EOF || die
+ [install]
+ root = ${ED}
+ EOF
+ local -x DIST_EXTRA_CONFIG=${T}/distutils-extra.cfg
+ esetup.py \
+ install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
+}
+
+python_install_all() {
+ if use examples; then
+ dodoc -r examples
+ fi
+
+ distutils-r1_python_install_all
+
+ insinto /usr/include/pycairo
+ newins cairo/pycairo.h py3cairo.h
+}
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/
@ 2024-06-11 17:58 Sam James
0 siblings, 0 replies; 7+ messages in thread
From: Sam James @ 2024-06-11 17:58 UTC (permalink / raw
To: gentoo-commits
commit: 1d92e043e855b1474b5575e3d84bd0fde92461b5
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun 11 17:49:02 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun 11 17:55:19 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d92e043
dev-python/pycairo: enable py3.13
Signed-off-by: Sam James <sam <AT> gentoo.org>
.../pycairo/files/pycairo-1.26.0-py313.patch | 30 +++++++++
dev-python/pycairo/pycairo-1.26.0-r1.ebuild | 77 ++++++++++++++++++++++
2 files changed, 107 insertions(+)
diff --git a/dev-python/pycairo/files/pycairo-1.26.0-py313.patch b/dev-python/pycairo/files/pycairo-1.26.0-py313.patch
new file mode 100644
index 000000000000..c3c0d74cb415
--- /dev/null
+++ b/dev-python/pycairo/files/pycairo-1.26.0-py313.patch
@@ -0,0 +1,30 @@
+https://github.com/pygobject/pycairo/pull/366
+
+From 387e27fa36d29bc8f656656ca8b47e7b4996f4f4 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Wed, 29 May 2024 21:25:41 +0200
+Subject: [PATCH] Avoid invalid PyBUF_READ flag in PyObject_GetBuffer()
+
+Since Python 3.13, the flag is no longer allowed.
+
+See https://github.com/python/cpython/pull/114707
+
+Fixes https://github.com/pygobject/pycairo/issues/365
+---
+ cairo/surface.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/cairo/surface.c b/cairo/surface.c
+index 048522c6..f00db8b5 100644
+--- a/cairo/surface.c
++++ b/cairo/surface.c
+@@ -484,7 +484,7 @@ surface_set_mime_data (PycairoSurface *o, PyObject *args) {
+ return NULL;
+ }
+
+- res = PyObject_GetBuffer (obj, view, PyBUF_READ);
++ res = PyObject_GetBuffer (obj, view, PyBUF_SIMPLE);
+ if (res == -1) {
+ PyMem_Free (view);
+ return NULL;
+
diff --git a/dev-python/pycairo/pycairo-1.26.0-r1.ebuild b/dev-python/pycairo/pycairo-1.26.0-r1.ebuild
new file mode 100644
index 000000000000..269c6598a58e
--- /dev/null
+++ b/dev-python/pycairo/pycairo-1.26.0-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} pypy3 )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1
+
+DESCRIPTION="Python bindings for the cairo library"
+HOMEPAGE="
+ https://www.cairographics.org/pycairo/
+ https://github.com/pygobject/pycairo/
+ https://pypi.org/project/pycairo/
+"
+SRC_URI="
+ https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz
+"
+
+LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos"
+IUSE="examples"
+
+BDEPEND="
+ virtual/pkgconfig
+ test? (
+ dev-python/hypothesis[${PYTHON_USEDEP}]
+ )
+"
+RDEPEND="
+ >=x11-libs/cairo-1.15.10[svg(+)]
+"
+DEPEND="
+ ${RDEPEND}
+ x11-base/xorg-proto
+"
+
+PATCHES=(
+ "${FILESDIR}"/pycairo-1.26.0-py313.patch
+)
+
+distutils_enable_sphinx docs \
+ dev-python/sphinx-rtd-theme
+distutils_enable_tests pytest
+
+python_test() {
+ esetup.py build_tests
+ epytest
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ # we need to pass --root via install command, sigh
+ cat > "${T}/distutils-extra.cfg" <<-EOF || die
+ [install]
+ root = ${D}
+ EOF
+ local -x DIST_EXTRA_CONFIG=${T}/distutils-extra.cfg
+ esetup.py \
+ install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
+}
+
+python_install_all() {
+ if use examples; then
+ dodoc -r examples
+ fi
+
+ distutils-r1_python_install_all
+
+ insinto /usr/include/pycairo
+ doins cairo/py3cairo.h
+}
^ permalink raw reply related [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-06-11 17:58 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-22 15:46 [gentoo-commits] repo/gentoo:master commit in: dev-python/pycairo/files/, dev-python/pycairo/ Michał Górny
-- strict thread matches above, loose matches on Subject: below --
2024-06-11 17:58 Sam James
2023-10-17 15:11 Michał Górny
2023-05-05 5:05 Sam James
2020-06-05 22:43 Andreas Sturmlechner
2020-01-26 17:45 Michał Górny
2017-10-15 11:01 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox