git: 7b5b449e7f35 - main - x11-toolkits/py-kivy: update the port to version 2.3.1

From: Alexey Dokuchaev <danfe_at_FreeBSD.org>
Date: Mon, 06 Jul 2026 17:35:53 UTC
The branch main has been updated by danfe:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7b5b449e7f352a4c27957514678005ad17007c49

commit 7b5b449e7f352a4c27957514678005ad17007c49
Author:     Alexey Dokuchaev <danfe@FreeBSD.org>
AuthorDate: 2026-07-06 17:34:38 +0000
Commit:     Alexey Dokuchaev <danfe@FreeBSD.org>
CommitDate: 2026-07-06 17:34:38 +0000

    x11-toolkits/py-kivy: update the port to version 2.3.1
    
    Reported by:    portscout
---
 x11-toolkits/py-kivy/Makefile                | 25 ++++------------
 x11-toolkits/py-kivy/distinfo                |  6 ++--
 x11-toolkits/py-kivy/files/patch-git-5a1b27d | 43 ++++++++++++++++++++++++++++
 3 files changed, 52 insertions(+), 22 deletions(-)

diff --git a/x11-toolkits/py-kivy/Makefile b/x11-toolkits/py-kivy/Makefile
index e6df6bd6a23a..72077332af55 100644
--- a/x11-toolkits/py-kivy/Makefile
+++ b/x11-toolkits/py-kivy/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	kivy
-PORTVERSION=	2.3.0
-PORTREVISION=	3
+PORTVERSION=	2.3.1
 CATEGORIES=	x11-toolkits python
 MASTER_SITES=	PYPI
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
@@ -13,10 +12,7 @@ WWW=		https://kivy.org/
 LICENSE=	MIT
 LICENSE_FILE=	${WRKSRC}/LICENSE
 
-DEPRECATED=	Depends on expired lang/cython0
-EXPIRATION_DATE=2026-09-15
-
-BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}packaging>0:devel/py-packaging@${PY_FLAVOR}
+BUILD_DEPENDS=	${PYTHON_PKGNAMEPREFIX}filetype>0:devel/py-filetype@${PY_FLAVOR}
 LIB_DEPENDS=	libmtdev.so:devel/libmtdev
 RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pygments>0:textproc/py-pygments@${PY_FLAVOR} \
 		${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR}
@@ -27,7 +23,8 @@ MAKE_ENV=	KIVY_NO_CONFIG=yes KIVY_NO_FILELOG=yes USE_OPENGL_ES2=1 \
 
 USES=		display:test gl pytest python shebangfix uniquefiles:dirs
 USE_GL=		egl gl glesv2
-USE_PYTHON=	autoplist concurrent cython0 distutils
+USE_PYTHON=	autoplist concurrent cython distutils
+
 PYDISTUTILS_BUILD_TARGET=	build_ext
 PYDISTUTILS_BUILDARGS=		--inplace
 PYDISTUTILS_EGGINFO=		Kivy-${PORTVERSION}-py${PYTHON_VER}.egg-info
@@ -81,18 +78,6 @@ X11_MAKE_ENV_OFF=	USE_X11=0
 X11_USES=		xorg
 X11_USE=		XORG=xrender,x11
 
-post-patch:
-	@${REINPLACE_CMD} -e '/GLSHADERSOURCEPTR/s,const GLchar\*,& const ,' \
-		${WRKSRC}/kivy/graphics/cgl.pxd
-	@${REINPLACE_CMD} -e '/glShaderSource/s,const GLchar\*,& const ,' \
-		${WRKSRC}/kivy/graphics/cgl.pxd \
-		${WRKSRC}/kivy/graphics/cgl_backend/cgl_gl.pyx \
-		${WRKSRC}/kivy/include/common_subset.h
-	@${REINPLACE_CMD} -e '/mockShaderSource/s,const GLchar\*,& const,' \
-		${WRKSRC}/kivy/graphics/cgl_backend/cgl_mock.pyx
-	@${REINPLACE_CMD} -e '/dbgShaderSource/s,const GLchar\*,& const,' \
-		${WRKSRC}/kivy/graphics/cgl_backend/cgl_debug.pyx \
-
 post-build-DOCS-on:
 	${MKDIR} ${WRKSRC}/doc/build/doctrees ${WRKSRC}/doc/build/html
 	(cd ${WRKSRC}; \
@@ -110,3 +95,5 @@ post-install-DOCS-on:
 	(cd ${WRKSRC}/doc/build/html; ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR})
 
 .include <bsd.port.mk>
+
+PATCH_ARGS+=	-l
diff --git a/x11-toolkits/py-kivy/distinfo b/x11-toolkits/py-kivy/distinfo
index eb1239fcfa2b..6f67a7ccea83 100644
--- a/x11-toolkits/py-kivy/distinfo
+++ b/x11-toolkits/py-kivy/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1704450722
-SHA256 (Kivy-2.3.0.tar.gz) = e8b8610c7f8ef6db908a139d369b247378f18105c96981e492eab2b4706c79d5
-SIZE (Kivy-2.3.0.tar.gz) = 23965268
+TIMESTAMP = 1735229636
+SHA256 (Kivy-2.3.1.tar.gz) = 0833949e3502cdb4abcf9c1da4384674045ad7d85644313aa1ee7573f3b4f9d9
+SIZE (Kivy-2.3.1.tar.gz) = 23967306
diff --git a/x11-toolkits/py-kivy/files/patch-git-5a1b27d b/x11-toolkits/py-kivy/files/patch-git-5a1b27d
new file mode 100644
index 000000000000..a69b304b8a7a
--- /dev/null
+++ b/x11-toolkits/py-kivy/files/patch-git-5a1b27d
@@ -0,0 +1,43 @@
+--- kivy/graphics/context_instructions.pyx.orig	2024-12-26 16:04:18 UTC
++++ kivy/graphics/context_instructions.pyx
+@@ -86,7 +86,7 @@ cdef tuple rgb_to_hsv(float r, float g, float b):
+ 
+ cdef tuple hsv_to_rgb(float h, float s, float v):
+     if s == 0.0: return v, v, v
+-    cdef long i = long(h * 6.0)
++    cdef long i = <long>(h * 6.0)
+     cdef float f = (h * <float>6.0) - i
+     cdef float p = v * (<float>1.0 - s)
+     cdef float q = v * (<float>1.0 - s * f)
+--- kivy/graphics/opengl.pyx.orig	2024-12-26 16:04:18 UTC
++++ kivy/graphics/opengl.pyx
+@@ -689,7 +689,7 @@ def glDrawElements(GLenum mode, GLsizei count, GLenum 
+     cdef void *ptr = NULL
+     if isinstance(indices, bytes):
+         ptr = <void *>(<char *>(<bytes>indices))
+-    elif isinstance(indices, (long, int)):
++    elif isinstance(indices, int):
+         ptr = <void *>(<unsigned int>indices)
+     else:
+         raise TypeError("Argument 'indices' has incorrect type (expected bytes or int).")
+@@ -1539,7 +1539,7 @@ def glVertexAttribPointer(GLuint index, GLint size, GL
+     cdef void *ptr = NULL
+     if isinstance(data, bytes):
+         ptr = <void *>(<char *>(<bytes>data))
+-    elif isinstance(data, (long, int)):
++    elif isinstance(data, int):
+         ptr = <void *>(<unsigned int>data)
+     else:
+         raise TypeError("Argument 'data' has incorrect type (expected bytes or int).")
+--- kivy/weakproxy.pyx.orig	2024-12-26 16:04:18 UTC
++++ kivy/weakproxy.pyx
+@@ -253,9 +253,6 @@ cdef class WeakProxy(object):
+     def __int__(self):
+         return int(self.__ref__())
+ 
+-    def __long__(self):
+-        return long(self.__ref__())
+-
+     def __float__(self):
+         return float(self.__ref__())
+