diff options
author | Khem Raj <raj.khem@gmail.com> | 2025-05-18 10:14:57 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2025-05-19 08:37:19 -0700 |
commit | bf17b7294f405afc24cc2a18731cc73050d760b5 (patch) | |
tree | 8cc277dbf0eb0e1a9ef9201b8dd9b2c6ab8dc501 /meta-python/recipes-devtools/python/python3-kivy/0001-Remove-old-Python-2-long-from-Cython-files-fixes-bui.patch | |
parent | d5bec49b73a656bc24a5f7176bbdb983b5eef91b (diff) | |
download | meta-openembedded-bf17b7294f405afc24cc2a18731cc73050d760b5.tar.gz |
python3-kivy: Fix build with cython 3.1
Backport needed patch from upstream top of tree branch
Signed-off-by: Khem Raj <raj.khem@gmail.com>
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.patch | 63 |
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 @@ | |||
1 | From 288e3d5ecff1bc5e7de29d9daddb83d697280004 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mirko Galimberti <me@mirkogalimberti.com> | ||
3 | Date: Sun, 18 May 2025 09:38:14 +0200 | ||
4 | Subject: [PATCH] Remove old Python 2 long from Cython files, fixes build with | ||
5 | Cython `3.1.x` (#9056) | ||
6 | |||
7 | Upstream-Status: Backport [https://github.com/kivy/kivy/commit/5a1b27d7d3bdee6cedb55440bfae9c4e66fb3c68] | ||
8 | Signed-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 | |||
15 | diff --git a/kivy/graphics/context_instructions.pyx b/kivy/graphics/context_instructions.pyx | ||
16 | index 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) | ||
28 | diff --git a/kivy/graphics/opengl.pyx b/kivy/graphics/opengl.pyx | ||
29 | index 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).") | ||
50 | diff --git a/kivy/weakproxy.pyx b/kivy/weakproxy.pyx | ||
51 | index 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 | |||