From nobody Tue Jul 26 19:56:03 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Lsnhz3Fkxz4X1DH; Tue, 26 Jul 2022 19:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Lsnhz2k9Vz3GwD; Tue, 26 Jul 2022 19:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658865363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rw3Q5Bor1ZgtXyMsni9fnkvVdxMOgXzjS4LXETjih90=; b=f+Qv1i+ozbWMyOsZN1BiMQCLTZPx7bM/1CaLclRcrM5c5PWryY0WFQHtkKJtS2NUcSbuPd di3ZPmVTKJcsxGEmJPd8p4hvfBkMZrhDxtqEzlqWs93F3XvO2d9rMwI4Ye6DeahblLZDtm TvKujFtSDp3BIUvSQAsF34TnZxvVqfRb9voSO0V5XHujl9aFuFqs7dOK2AJPbqHpr5/fwa LMbHZfcg8nTI+Lhk0FzSAchAhWjrtPdSwLjZwgo4qGvZ8m/SrQUB6gjTRPNOvhZzmLn7NI jeNb74hYkCZZxMvVcR3gR6aFQIC7CHaA/m2lbTUqYcoA9ZEQK3Hs8U+SpEvWTA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Lsnhz1gHdzpwv; Tue, 26 Jul 2022 19:56:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 26QJu31E060960; Tue, 26 Jul 2022 19:56:03 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 26QJu337060959; Tue, 26 Jul 2022 19:56:03 GMT (envelope-from git) Date: Tue, 26 Jul 2022 19:56:03 GMT Message-Id: <202207261956.26QJu337060959@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Dima Panov Subject: git: acf1b6bc938d - main - graphics/py-cairo: update to 1.21.0 release (+) List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fluffy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: acf1b6bc938dd7f25869d635414f41df6270b9da Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1658865363; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Rw3Q5Bor1ZgtXyMsni9fnkvVdxMOgXzjS4LXETjih90=; b=mi9HPLxhoE+k4VMr/W6FhaeyU8X/MEqAiwoXpzr6/0AsQ51yrrh27kCMKfYci229yuZZ3X yPGJN+BAeVCZdCOYR7Rn/3kuFtTqdfkwz9V9UNyg9BTjPglGp0HNKcJyUXVP5xDgf44Wyk jGZm6PlWLNsGkl62rhdwV0IiWd8QZ8qCwZdywa2dWi5FcMjJ8RxgSPngtFnMwxYVwYvxed azdyjLtklXlvKo0FdOJ3KizpzhK0wXTZyu71wxFhSUjXJwrargdT1AQ4LIj/kaAnk3S4aK Ulv5QtxOHrgvqrwQ64atQ1y4PpTRFYzAVmnGTKMyJwJzmkwcBTjCdczFdtK5zg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1658865363; a=rsa-sha256; cv=none; b=ogS77rg53/04qdmCrvxiDaGOZYolOGCg10z43dRFfulJhRl3j7UVW0/8Pi0BTkyKx1/DxC 89dVNeFgrDOXhEUSpyB4y1Qcz76SDXzXlW5skGNB/gTjP2iYCzqw3iXOi6uM2utqQ8ji7+ 5DTdUWUBANm6/5NrcOAoVzhaG5gql5gFt0lfED8MCPP0SUeNyfPe41hFiYES9BSRF4N1MW Ju9ram6SBhhK4dlTIDsO7GIRUNna4WKnIwnKLsTRBqRcwgSmsrhw6khqW65c593hYkAS6x 6aLtkTEUGis2+O8IJADCQVD8ph0/JfmvXxY5Jh4XSFRbMis3SrquZzFE5Ovz7w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by fluffy: URL: https://cgit.FreeBSD.org/ports/commit/?id=acf1b6bc938dd7f25869d635414f41df6270b9da commit acf1b6bc938dd7f25869d635414f41df6270b9da Author: Dima Panov AuthorDate: 2022-07-26 19:54:21 +0000 Commit: Dima Panov CommitDate: 2022-07-26 19:55:47 +0000 graphics/py-cairo: update to 1.21.0 release (+) Setuptools is deprecated now, switch to meson guild Changelog: https://pycairo.readthedocs.io/en/latest/changelog.html#v1-21-0 --- graphics/py-cairo/Makefile | 14 +- graphics/py-cairo/distinfo | 6 +- graphics/py-cairo/files/patch-cairo_surface.c | 215 -------------------------- graphics/py-cairo/pkg-plist | 18 +-- 4 files changed, 18 insertions(+), 235 deletions(-) diff --git a/graphics/py-cairo/Makefile b/graphics/py-cairo/Makefile index 4d1232751647..18eb9ba78a82 100644 --- a/graphics/py-cairo/Makefile +++ b/graphics/py-cairo/Makefile @@ -1,6 +1,5 @@ PORTNAME= cairo -PORTVERSION= 1.18.1 -PORTREVISION= 2 +PORTVERSION= 1.21.0 PORTEPOCH= 1 CATEGORIES= graphics python MASTER_SITES= https://github.com/pygobject/pycairo/releases/download/v${PORTVERSION}/ @@ -15,15 +14,20 @@ LICENSE_COMB= multi LICENSE_FILE_LGPL21= ${WRKSRC}/COPYING-LGPL-2.1 LICENSE_FILE_MPL11= ${WRKSRC}/COPYING-MPL-1.1 +USES= compiler:c11 gnome meson pkgconfig python:3.7+ +USE_PYTHON= flavors py3kplist +USE_GNOME= cairo +MESON_ARGS+= -Dpython=${PYTHON_VERSION} + PORTSCOUT= limitw:1,even -USES= compiler:c11 gnome pkgconfig python:3.6+ -USE_PYTHON= distutils py3kplist -USE_GNOME= cairo +BINARY_ALIAS= python3=${PYTHON_CMD} PLIST_SUB= PORTVER=${PORTVERSION} post-install: + ${PYTHON_CMD} -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} + ${PYTHON_CMD} -O -m compileall -d ${PYTHON_SITELIBDIR} ${STAGEDIR}${PYTHON_SITELIBDIR} @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/cairo/_cairo*.so .include diff --git a/graphics/py-cairo/distinfo b/graphics/py-cairo/distinfo index c06d9a1f93be..41c6ffad7ae1 100644 --- a/graphics/py-cairo/distinfo +++ b/graphics/py-cairo/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1560185779 -SHA256 (pycairo-1.18.1.tar.gz) = 70172e58b6bad7572a3518c26729b074acdde15e6fee6cbab6d3528ad552b786 -SIZE (pycairo-1.18.1.tar.gz) = 200610 +TIMESTAMP = 1658861204 +SHA256 (pycairo-1.21.0.tar.gz) = 251907f18a552df938aa3386657ff4b5a4937dde70e11aa042bc297957f4b74b +SIZE (pycairo-1.21.0.tar.gz) = 340712 diff --git a/graphics/py-cairo/files/patch-cairo_surface.c b/graphics/py-cairo/files/patch-cairo_surface.c deleted file mode 100644 index b4ab64c6fe21..000000000000 --- a/graphics/py-cairo/files/patch-cairo_surface.c +++ /dev/null @@ -1,215 +0,0 @@ -https://github.com/pygobject/pycairo/commit/0f8cdc058239 -https://github.com/pygobject/pycairo/commit/4c5377787624 -https://github.com/pygobject/pycairo/commit/590bcd2ecc9c - ---- cairo/surface.c.orig 2018-11-03 09:30:34 UTC -+++ cairo/surface.c -@@ -142,6 +142,7 @@ _write_func (void *closure, const unsigned char *data, - - static const cairo_user_data_key_t surface_base_object_key; - static const cairo_user_data_key_t surface_is_mapped_image; -+static const cairo_user_data_key_t surface_buffer_view_key; - - static void - surface_dealloc (PycairoSurface *o) { -@@ -439,28 +440,30 @@ _destroy_mime_user_data_func (PyObject *user_data) { - static void - _destroy_mime_data_func (PyObject *user_data) { - cairo_surface_t *surface; -+ Py_buffer *view; - PyObject *mime_intern; - - PyGILState_STATE gstate = PyGILState_Ensure(); - - /* Remove the user data holding the source object */ - surface = PyCapsule_GetPointer(PyTuple_GET_ITEM(user_data, 0), NULL); -- mime_intern = PyTuple_GET_ITEM(user_data, 2); -+ view = PyCapsule_GetPointer(PyTuple_GET_ITEM(user_data, 1), NULL); -+ mime_intern = PyTuple_GET_ITEM(user_data, 3); - cairo_surface_set_user_data( - surface, (cairo_user_data_key_t *)mime_intern, NULL, NULL); - - /* Destroy the user data */ -- _destroy_mime_user_data_func(user_data); -+ PyBuffer_Release (view); -+ PyMem_Free (view); -+ Py_DECREF(user_data); - - PyGILState_Release(gstate); - } - - static PyObject * - surface_set_mime_data (PycairoSurface *o, PyObject *args) { -- PyObject *obj, *user_data, *mime_intern, *capsule; -- const unsigned char *buffer; -+ PyObject *obj, *user_data, *mime_intern, *surface_capsule, *view_capsule; - const char *mime_type; -- Py_ssize_t buffer_len; - int res; - cairo_status_t status; - -@@ -475,38 +478,58 @@ surface_set_mime_data (PycairoSurface *o, PyObject *ar - Py_RETURN_NONE; - } - --PYCAIRO_BEGIN_IGNORE_DEPRECATED -- res = PyObject_AsReadBuffer (obj, (const void **)&buffer, &buffer_len); --PYCAIRO_END_IGNORE_DEPRECATED -- if (res == -1) -+ Py_buffer *view = PyMem_Malloc (sizeof (Py_buffer)); -+ if (view == NULL) { -+ PyErr_NoMemory (); - return NULL; -+ } - -+ res = PyObject_GetBuffer (obj, view, PyBUF_READ); -+ if (res == -1) { -+ PyMem_Free (view); -+ return NULL; -+ } -+ - /* We use the interned mime type string as user data key and store the - * passed in object with it. This allows us to return the same object in - * surface_get_mime_data(). - */ - mime_intern = PYCAIRO_PyUnicode_InternFromString(mime_type); -- capsule = PyCapsule_New(o->surface, NULL, NULL); -- user_data = Py_BuildValue("(NOO)", capsule, obj, mime_intern); -- if (user_data == NULL) -+ surface_capsule = PyCapsule_New(o->surface, NULL, NULL); -+ view_capsule = PyCapsule_New(view, NULL, NULL); -+ user_data = Py_BuildValue("(NNOO)", surface_capsule, view_capsule, obj, mime_intern); -+ if (user_data == NULL) { -+ PyBuffer_Release (view); -+ PyMem_Free (view); - return NULL; -+ } - - status = cairo_surface_set_user_data( - o->surface, (cairo_user_data_key_t *)mime_intern, user_data, - (cairo_destroy_func_t)_destroy_mime_user_data_func); -- if (status != CAIRO_STATUS_SUCCESS) -+ -+ if (status != CAIRO_STATUS_SUCCESS) { -+ PyBuffer_Release (view); -+ PyMem_Free (view); - Py_DECREF(user_data); -- RETURN_NULL_IF_CAIRO_ERROR(status); -+ Pycairo_Check_Status (status); -+ return NULL; -+ } - -+ Py_INCREF(user_data); - status = cairo_surface_set_mime_data ( -- o->surface, mime_type, buffer, (unsigned long)buffer_len, -+ o->surface, mime_type, view->buf, (unsigned long)view->len, - (cairo_destroy_func_t)_destroy_mime_data_func, user_data); -+ - if (status != CAIRO_STATUS_SUCCESS) { - cairo_surface_set_user_data( - o->surface, (cairo_user_data_key_t *)mime_intern, NULL, NULL); -+ PyBuffer_Release (view); -+ PyMem_Free (view); -+ Py_DECREF(user_data); -+ Pycairo_Check_Status (status); -+ return NULL; - } -- RETURN_NULL_IF_CAIRO_ERROR(status); -- Py_INCREF(user_data); - - Py_RETURN_NONE; - } -@@ -534,7 +557,7 @@ surface_get_mime_data (PycairoSurface *o, PyObject *ar - /* In case the mime data wasn't set through the Python API just copy it */ - return Py_BuildValue(PYCAIRO_DATA_FORMAT "#", buffer, buffer_len); - } else { -- obj = PyTuple_GET_ITEM(user_data, 1); -+ obj = PyTuple_GET_ITEM(user_data, 2); - Py_INCREF(obj); - return obj; - } -@@ -804,14 +827,22 @@ image_surface_new (PyTypeObject *type, PyObject *args, - NULL); - } - -+static void -+_release_buffer_destroy_func (void *user_data) { -+ Py_buffer *view = (Py_buffer *)user_data; -+ PyGILState_STATE gstate = PyGILState_Ensure(); -+ PyBuffer_Release (view); -+ PyMem_Free (view); -+ PyGILState_Release(gstate); -+} -+ - /* METH_CLASS */ - static PyObject * - image_surface_create_for_data (PyTypeObject *type, PyObject *args) { - cairo_surface_t *surface; - cairo_format_t format; -- unsigned char *buffer; -+ cairo_status_t status; - int width, height, stride = -1, res, format_arg; -- Py_ssize_t buffer_len; - PyObject *obj; - - if (!PyArg_ParseTuple (args, "Oiii|i:ImageSurface.create_for_data", -@@ -820,12 +851,6 @@ image_surface_create_for_data (PyTypeObject *type, PyO - - format = (cairo_format_t)format_arg; - --PYCAIRO_BEGIN_IGNORE_DEPRECATED -- res = PyObject_AsWriteBuffer (obj, (void **)&buffer, &buffer_len); --PYCAIRO_END_IGNORE_DEPRECATED -- if (res == -1) -- return NULL; -- - if (width <= 0) { - PyErr_SetString(PyExc_ValueError, "width must be positive"); - return NULL; -@@ -843,15 +868,42 @@ PYCAIRO_END_IGNORE_DEPRECATED - return NULL; - } - } -- if (height * stride > buffer_len) { -+ -+ Py_buffer *view = PyMem_Malloc (sizeof (Py_buffer)); -+ if (view == NULL) { -+ PyErr_NoMemory (); -+ return NULL; -+ } -+ -+ res = PyObject_GetBuffer (obj, view, PyBUF_WRITABLE); -+ if (res == -1) { -+ PyMem_Free (view); -+ return NULL; -+ } -+ -+ if (height * stride > view->len) { -+ PyBuffer_Release (view); -+ PyMem_Free (view); - PyErr_SetString(PyExc_TypeError, "buffer is not long enough"); - return NULL; - } -+ - Py_BEGIN_ALLOW_THREADS; -- surface = cairo_image_surface_create_for_data (buffer, format, width, -- height, stride); -+ surface = cairo_image_surface_create_for_data (view->buf, format, width, -+ height, stride); - Py_END_ALLOW_THREADS; -- return _surface_create_with_object(surface, obj); -+ -+ status = cairo_surface_set_user_data( -+ surface, &surface_buffer_view_key, view, -+ (cairo_destroy_func_t)_release_buffer_destroy_func); -+ if (Pycairo_Check_Status (status)) { -+ cairo_surface_destroy (surface); -+ PyBuffer_Release (view); -+ PyMem_Free (view); -+ return NULL; -+ } -+ -+ return PycairoSurface_FromSurface(surface, NULL); - } - - diff --git a/graphics/py-cairo/pkg-plist b/graphics/py-cairo/pkg-plist index 02fce6c3bcb4..27a01ada6383 100644 --- a/graphics/py-cairo/pkg-plist +++ b/graphics/py-cairo/pkg-plist @@ -1,16 +1,10 @@ -%%PYTHON2%%include/pycairo/pycairo.h -%%PYTHON3%%include/pycairo/py3cairo.h +include/pycairo/py3cairo.h %%PYTHON_SITELIBDIR%%/cairo/__init__.py -%%PYTHON_SITELIBDIR%%/cairo/__init__.pyc %%PYTHON_SITELIBDIR%%/cairo/__init__.pyi -%%PYTHON_SITELIBDIR%%/cairo/__init__.pyo +%%PYTHON_SITELIBDIR%%/cairo/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.opt-1.pyc +%%PYTHON_SITELIBDIR%%/cairo/__pycache__/__init__%%PYTHON_EXT_SUFFIX%%.pyc %%PYTHON_SITELIBDIR%%/cairo/_cairo%%PYTHON_EXT_SUFFIX%%.so -%%PYTHON2%%%%PYTHON_SITELIBDIR%%/cairo/include/pycairo.h -%%PYTHON3%%%%PYTHON_SITELIBDIR%%/cairo/include/py3cairo.h +%%PYTHON_SITELIBDIR%%/cairo/include/py3cairo.h %%PYTHON_SITELIBDIR%%/cairo/py.typed -%%PYTHON_SITELIBDIR%%/pycairo-%%PORTVER%%-py%%PYTHON_VER%%.egg-info/PKG-INFO -%%PYTHON_SITELIBDIR%%/pycairo-%%PORTVER%%-py%%PYTHON_VER%%.egg-info/SOURCES.txt -%%PYTHON_SITELIBDIR%%/pycairo-%%PORTVER%%-py%%PYTHON_VER%%.egg-info/dependency_links.txt -%%PYTHON_SITELIBDIR%%/pycairo-%%PORTVER%%-py%%PYTHON_VER%%.egg-info/top_level.txt -%%PYTHON2%%libdata/pkgconfig/pycairo.pc -%%PYTHON3%%libdata/pkgconfig/py3cairo.pc +%%PYTHON_SITELIBDIR%%/pycairo-%%PORTVER%%.egg-info +libdata/pkgconfig/py3cairo.pc