summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch')
-rw-r--r--meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch63
1 files changed, 63 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch b/meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch
new file mode 100644
index 0000000000..c68e227482
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch
@@ -0,0 +1,63 @@
1From 288e3d5ecff1bc5e7de29d9daddb83d697280004 Mon Sep 17 00:00:00 2001
2From: Mirko Galimberti <me@mirkogalimberti.com>
3Date: Sun, 18 May 2025 09:38:14 +0200
4Subject: [PATCH] Remove old Python 2 long from Cython files, fixes build with
5 Cython `3.1.x` (#9056)
6
7Upstream-Status: Backport [https://github.com/kivy/kivy/commit/5a1b27d7d3bdee6cedb55440bfae9c4e66fb3c68]
8Signed-off-by: Khem Raj <raj.khem@gmail.com>
9---
10 kivy/graphics/context_instructions.pyx | 2 +-
11 kivy/graphics/opengl.pyx | 4 ++--
12 kivy/weakproxy.pyx | 3 ---
13 3 files changed, 3 insertions(+), 6 deletions(-)
14
15diff --git a/kivy/graphics/context_instructions.pyx b/kivy/graphics/context_instructions.pyx
16index 0d4b8f548..1c23c0e1c 100644
17--- a/kivy/graphics/context_instructions.pyx
18+++ b/kivy/graphics/context_instructions.pyx
19@@ -86,7 +86,7 @@ cdef tuple rgb_to_hsv(float r, float g, float b):
20
21 cdef tuple hsv_to_rgb(float h, float s, float v):
22 if s == 0.0: return v, v, v
23- cdef long i = long(h * 6.0)
24+ cdef long i = <long>(h * 6.0)
25 cdef float f = (h * <float>6.0) - i
26 cdef float p = v * (<float>1.0 - s)
27 cdef float q = v * (<float>1.0 - s * f)
28diff --git a/kivy/graphics/opengl.pyx b/kivy/graphics/opengl.pyx
29index bcca70842..f535c62a6 100644
30--- a/kivy/graphics/opengl.pyx
31+++ b/kivy/graphics/opengl.pyx
32@@ -689,7 +689,7 @@ def glDrawElements(GLenum mode, GLsizei count, GLenum type, indices):
33 cdef void *ptr = NULL
34 if isinstance(indices, bytes):
35 ptr = <void *>(<char *>(<bytes>indices))
36- elif isinstance(indices, (long, int)):
37+ elif isinstance(indices, int):
38 ptr = <void *>(<unsigned int>indices)
39 else:
40 raise TypeError("Argument 'indices' has incorrect type (expected bytes or int).")
41@@ -1539,7 +1539,7 @@ def glVertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean norma
42 cdef void *ptr = NULL
43 if isinstance(data, bytes):
44 ptr = <void *>(<char *>(<bytes>data))
45- elif isinstance(data, (long, int)):
46+ elif isinstance(data, int):
47 ptr = <void *>(<unsigned int>data)
48 else:
49 raise TypeError("Argument 'data' has incorrect type (expected bytes or int).")
50diff --git a/kivy/weakproxy.pyx b/kivy/weakproxy.pyx
51index cac4fe66b..e8e1c0b77 100644
52--- a/kivy/weakproxy.pyx
53+++ b/kivy/weakproxy.pyx
54@@ -253,9 +253,6 @@ cdef class WeakProxy(object):
55 def __int__(self):
56 return int(self.__ref__())
57
58- def __long__(self):
59- return long(self.__ref__())
60-
61 def __float__(self):
62 return float(self.__ref__())
63