x11-toolkits/py-kivy: unbreak due to cython 0.22.
This commit is contained in:
parent
bf931a087b
commit
8b21f4af47
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=381958
3 changed files with 474 additions and 2 deletions
|
@ -72,8 +72,6 @@ TEST_USES= display:build
|
|||
X11_MAKE_ENV= USE_X11=1
|
||||
X11_USE= XORG=x11
|
||||
|
||||
BROKEN= fails to build with cython-0.22
|
||||
|
||||
.if !defined(ARCH)
|
||||
ARCH!= uname -p
|
||||
.endif
|
||||
|
|
30
x11-toolkits/py-kivy/files/patch-90ddeb
Normal file
30
x11-toolkits/py-kivy/files/patch-90ddeb
Normal file
|
@ -0,0 +1,30 @@
|
|||
commit 90ddebab3f56c06175dd99b153383990434b9514
|
||||
Author: Mathieu Virbel <mat@kivy.org>
|
||||
Date: Tue Sep 16 10:11:23 2014 +0200
|
||||
|
||||
Fixes for Cython 0.21
|
||||
|
||||
diff --git a/kivy/lib/gstplayer/_gstplayer.pyx b/kivy/lib/gstplayer/_gstplayer.pyx
|
||||
index f07af0b..aa29c11 100644
|
||||
--- kivy/lib/gstplayer/_gstplayer.pyx
|
||||
+++ kivy/lib/gstplayer/_gstplayer.pyx
|
||||
@@ -207,7 +207,7 @@ cdef class GstPlayer:
|
||||
self.eos_cb()
|
||||
|
||||
def load(self):
|
||||
- cdef char *c_uri
|
||||
+ cdef bytes py_uri
|
||||
|
||||
# if already loaded before, clean everything.
|
||||
if self.pipeline != NULL:
|
||||
@@ -256,8 +256,8 @@ cdef class GstPlayer:
|
||||
|
||||
# configure playbin
|
||||
g_object_set_int(self.pipeline, 'async-handling', 1)
|
||||
- c_uri = <bytes>self.uri.encode('utf-8')
|
||||
- g_object_set_void(self.playbin, 'uri', c_uri)
|
||||
+ py_uri = <bytes>self.uri.encode('utf-8')
|
||||
+ g_object_set_void(self.playbin, 'uri', <char *>py_uri)
|
||||
|
||||
# attach the callback
|
||||
# NOTE no need to create a weakref here, as we manage to grab/release
|
444
x11-toolkits/py-kivy/files/patch-except
Normal file
444
x11-toolkits/py-kivy/files/patch-except
Normal file
|
@ -0,0 +1,444 @@
|
|||
diff -ur kivy/graphics/context_instructions.pxd kivy/graphics/context_instructions.pxd
|
||||
--- kivy/graphics/context_instructions.pxd 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/context_instructions.pxd 2015-03-12 20:13:57.709879145 +0200
|
||||
@@ -16,39 +16,39 @@
|
||||
pass
|
||||
|
||||
cdef class LineWidth(ContextInstruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class Color(ContextInstruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class BindTexture(ContextInstruction):
|
||||
cdef int _index
|
||||
cdef object _source
|
||||
cdef Texture _texture
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
|
||||
cdef class LoadIdentity(ContextInstruction):
|
||||
pass
|
||||
|
||||
cdef class PushMatrix(ContextInstruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class PopMatrix(ContextInstruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class ApplyContextMatrix(ContextInstruction):
|
||||
cdef object _target_stack
|
||||
cdef object _source_stack
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class UpdateNormalMatrix(ContextInstruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class MatrixInstruction(ContextInstruction):
|
||||
cdef object _stack
|
||||
cdef Matrix _matrix
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
cdef class Transform(MatrixInstruction):
|
||||
cpdef transform(self, Matrix trans)
|
||||
@@ -61,16 +61,16 @@
|
||||
cdef float _angle
|
||||
cdef tuple _axis
|
||||
cdef tuple _origin
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef void compute(self)
|
||||
|
||||
cdef class Scale(Transform):
|
||||
cdef float _x, _y, _z
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef set_scale(self, double x, double y, double z)
|
||||
|
||||
cdef class Translate(Transform):
|
||||
cdef double _x, _y, _z
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef set_translate(self, double x, double y, double z)
|
||||
|
||||
diff -ur kivy/graphics/context_instructions.pyx kivy/graphics/context_instructions.pyx
|
||||
--- kivy/graphics/context_instructions.pyx 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/context_instructions.pyx 2015-03-12 20:15:07.788203456 +0200
|
||||
@@ -320,7 +320,7 @@
|
||||
|
||||
self.index = kwargs.get('index', 0)
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef RenderContext context = self.get_context()
|
||||
context.set_texture(self._index, self._texture)
|
||||
|
||||
@@ -437,7 +437,7 @@
|
||||
self.target_stack = kwargs.get('target_stack', 'modelview_mat')
|
||||
self.source_stack = kwargs.get('source_stack', 'modelview_mat')
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef RenderContext context = self.get_context()
|
||||
m = context.get_state(self._target_stack)
|
||||
m = m.multiply(context.get_state(self._source_stack))
|
||||
@@ -473,7 +473,7 @@
|
||||
|
||||
.. versionadded:: 1.6.0
|
||||
'''
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef RenderContext context = self.get_context()
|
||||
mvm = context.get_state('modelview_mat')
|
||||
context.set_state('normal_mat', mvm.normal_matrix())
|
||||
@@ -488,7 +488,7 @@
|
||||
self.stack = kwargs.get('stack', 'modelview_mat')
|
||||
self._matrix = None
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
'''Apply the matrix of this instance to the
|
||||
context model view matrix.
|
||||
'''
|
||||
diff -ur kivy/graphics/fbo.pxd kivy/graphics/fbo.pxd
|
||||
--- kivy/graphics/fbo.pxd 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/fbo.pxd 2015-03-12 19:46:39.959774791 +0200
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
cdef void create_fbo(self)
|
||||
cdef void delete_fbo(self)
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef void raise_exception(self, str message, int status=?)
|
||||
cdef str resolve_status(self, int status)
|
||||
cdef void reload(self)
|
||||
diff -ur kivy/graphics/fbo.pyx kivy/graphics/fbo.pyx
|
||||
--- kivy/graphics/fbo.pyx 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/fbo.pyx 2015-03-12 19:47:46.149725464 +0200
|
||||
@@ -295,7 +295,7 @@
|
||||
else:
|
||||
glClear(GL_COLOR_BUFFER_BIT)
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
if self.flags & GI_NEEDS_UPDATE:
|
||||
self.bind()
|
||||
RenderContext.apply(self)
|
||||
diff -ur kivy/graphics/gl_instructions.pyx kivy/graphics/gl_instructions.pyx
|
||||
--- kivy/graphics/gl_instructions.pyx 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/gl_instructions.pyx 2015-03-12 20:17:33.398880449 +0200
|
||||
@@ -50,7 +50,7 @@
|
||||
self.b = b
|
||||
self.a = a
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
glClearColor(self.r, self.g, self.b, self.a)
|
||||
|
||||
property rgba:
|
||||
@@ -136,7 +136,7 @@
|
||||
self.clear_stencil = int(kwargs.get('clear_stencil', 0))
|
||||
self.clear_depth = int(kwargs.get('clear_depth', 0))
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef GLbitfield mask = 0
|
||||
if self.clear_color:
|
||||
mask |= GL_COLOR_BUFFER_BIT
|
||||
diff -ur kivy/graphics/instructions.pxd kivy/graphics/instructions.pxd
|
||||
--- kivy/graphics/instructions.pxd 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/instructions.pxd 2015-03-12 20:12:10.370562015 +0200
|
||||
@@ -24,7 +24,7 @@
|
||||
cdef object __weakref__
|
||||
cdef object __proxy_ref
|
||||
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef void flag_update(self, int do_parent=?)
|
||||
cdef void flag_update_done(self)
|
||||
cdef void set_parent(self, Instruction parent)
|
||||
@@ -75,7 +75,7 @@
|
||||
cdef Shader _shader
|
||||
cdef object func
|
||||
cdef int _reset_context
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef void enter(self)
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@
|
||||
cpdef add(self, Instruction c)
|
||||
cpdef remove(self, Instruction c)
|
||||
cpdef draw(self)
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
|
||||
|
||||
cdef class RenderContext(Canvas):
|
||||
diff -ur kivy/graphics/instructions.pyx kivy/graphics/instructions.pyx
|
||||
--- kivy/graphics/instructions.pyx 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/instructions.pyx 2015-03-12 20:11:54.069524371 +0200
|
||||
@@ -57,7 +57,7 @@
|
||||
if self.parent:
|
||||
self.parent.add(self)
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
pass
|
||||
|
||||
cdef void flag_update(self, int do_parent=1):
|
||||
@@ -123,7 +123,7 @@
|
||||
else:
|
||||
self.compiler = GraphicsCompiler()
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef Instruction c
|
||||
cdef list children
|
||||
if self.compiler is not None:
|
||||
@@ -224,7 +224,7 @@
|
||||
cdef RenderContext context = getActiveContext()
|
||||
return context
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef RenderContext context = self.get_context()
|
||||
if self.context_push:
|
||||
context.push_states(self.context_push)
|
||||
@@ -233,15 +233,15 @@
|
||||
if self.context_pop:
|
||||
context.pop_states(self.context_pop)
|
||||
|
||||
- cdef void set_state(self, str name, value):
|
||||
+ cdef void set_state(self, str name, value) except *:
|
||||
self.context_state[name] = value
|
||||
self.flag_update()
|
||||
|
||||
- cdef void push_state(self, str name):
|
||||
+ cdef void push_state(self, str name) except *:
|
||||
self.context_push.append(name)
|
||||
self.flag_update()
|
||||
|
||||
- cdef void pop_state(self, str name):
|
||||
+ cdef void pop_state(self, str name) except *:
|
||||
self.context_pop.append(name)
|
||||
self.flag_update()
|
||||
|
||||
@@ -378,7 +378,7 @@
|
||||
cdef void build(self):
|
||||
pass
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
if self.flags & GI_NEEDS_UPDATE:
|
||||
self.build()
|
||||
self.flag_update_done()
|
||||
@@ -444,7 +444,7 @@
|
||||
'''
|
||||
self.flag_update()
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef RenderContext rcx
|
||||
cdef Context ctx
|
||||
cdef Shader shader
|
||||
@@ -575,7 +575,7 @@
|
||||
'''
|
||||
self.apply()
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef float opacity = self._opacity
|
||||
cdef float rc_opacity
|
||||
cdef RenderContext rc
|
||||
@@ -764,29 +764,29 @@
|
||||
cdef get_state(self, str name):
|
||||
return self.state_stacks[name][-1]
|
||||
|
||||
- cdef void set_states(self, dict states):
|
||||
+ cdef void set_states(self, dict states) except *:
|
||||
cdef str name
|
||||
for name, value in states.iteritems():
|
||||
self.set_state(name, value)
|
||||
|
||||
- cdef void push_state(self, str name):
|
||||
+ cdef void push_state(self, str name) except *:
|
||||
stack = self.state_stacks[name]
|
||||
stack.append(stack[-1])
|
||||
self.flag_update()
|
||||
|
||||
- cdef void push_states(self, list names):
|
||||
+ cdef void push_states(self, list names) except *:
|
||||
cdef str name
|
||||
for name in names:
|
||||
self.push_state(name)
|
||||
|
||||
- cdef void pop_state(self, str name):
|
||||
+ cdef void pop_state(self, str name) except *:
|
||||
stack = self.state_stacks[name]
|
||||
oldvalue = stack.pop()
|
||||
if oldvalue != stack[-1]:
|
||||
self.set_state(name, stack[-1])
|
||||
self.flag_update()
|
||||
|
||||
- cdef void pop_states(self, list names):
|
||||
+ cdef void pop_states(self, list names) except *:
|
||||
cdef str name
|
||||
for name in names:
|
||||
self.pop_state(name)
|
||||
@@ -806,13 +806,13 @@
|
||||
texture.bind()
|
||||
self.flag_update()
|
||||
|
||||
- cdef void enter(self):
|
||||
+ cdef void enter(self) except *:
|
||||
self._shader.use()
|
||||
|
||||
- cdef void leave(self):
|
||||
+ cdef void leave(self) except *:
|
||||
self._shader.stop()
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
cdef list keys
|
||||
if PY2:
|
||||
keys = self.state_stacks.keys()
|
||||
diff -ur kivy/graphics/shader.pyx kivy/graphics/shader.pyx
|
||||
--- kivy/graphics/shader.pyx 2015-03-22 20:50:55.383258546 +0200
|
||||
+++ kivy/graphics/shader.pyx 2015-03-12 20:26:19.922137472 +0200
|
||||
@@ -221,13 +221,13 @@
|
||||
'''
|
||||
glUseProgram(0)
|
||||
|
||||
- cdef void set_uniform(self, str name, value):
|
||||
+ cdef void set_uniform(self, str name, value) except *:
|
||||
if name in self.uniform_values and self.uniform_values[name] == value:
|
||||
return
|
||||
self.uniform_values[name] = value
|
||||
self.upload_uniform(name, value)
|
||||
|
||||
- cdef void upload_uniform(self, str name, value):
|
||||
+ cdef void upload_uniform(self, str name, value) except *:
|
||||
'''Pass a uniform variable to the shader.
|
||||
'''
|
||||
cdef long vec_size, index, x, y
|
||||
@@ -412,7 +412,7 @@
|
||||
mat[x] = <GLfloat>value.mat[x]
|
||||
glUniformMatrix4fv(loc, 1, False, mat)
|
||||
|
||||
- cdef int get_uniform_loc(self, str name):
|
||||
+ cdef int get_uniform_loc(self, str name) except *:
|
||||
cdef bytes c_name = name.encode('utf-8')
|
||||
cdef int loc = glGetUniformLocation(self.program, c_name)
|
||||
self.uniform_locations[name] = loc
|
||||
@@ -453,11 +453,11 @@
|
||||
# save for the next run.
|
||||
self._current_vertex_format = vertex_format
|
||||
|
||||
- cdef void build(self):
|
||||
+ cdef void build(self) except *:
|
||||
self.build_vertex()
|
||||
self.build_fragment()
|
||||
|
||||
- cdef void build_vertex(self, int link=1):
|
||||
+ cdef void build_vertex(self, int link=1) except *:
|
||||
if self.vertex_shader is not None:
|
||||
glDetachShader(self.program, self.vertex_shader.shader)
|
||||
self.vertex_shader = None
|
||||
@@ -467,7 +467,7 @@
|
||||
if link:
|
||||
self.link_program()
|
||||
|
||||
- cdef void build_fragment(self, int link=1):
|
||||
+ cdef void build_fragment(self, int link=1) except *:
|
||||
if self.fragment_shader is not None:
|
||||
glDetachShader(self.program, self.fragment_shader.shader)
|
||||
self.fragment_shader = None
|
||||
@@ -477,7 +477,7 @@
|
||||
if link:
|
||||
self.link_program()
|
||||
|
||||
- cdef void link_program(self):
|
||||
+ cdef void link_program(self) except *:
|
||||
if self.vertex_shader is None or self.fragment_shader is None:
|
||||
return
|
||||
|
||||
diff -ur kivy/graphics/stencil_instructions.pxd kivy/graphics/stencil_instructions.pxd
|
||||
--- kivy/graphics/stencil_instructions.pxd 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/stencil_instructions.pxd 2015-03-12 20:16:45.137608771 +0200
|
||||
@@ -1,11 +1,11 @@
|
||||
from kivy.graphics.instructions cimport Instruction
|
||||
|
||||
cdef class StencilPush(Instruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef class StencilPop(Instruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef class StencilUse(Instruction):
|
||||
cdef unsigned int _op
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
cdef class StencilUnUse(Instruction):
|
||||
- cdef void apply(self)
|
||||
+ cdef void apply(self) except *
|
||||
diff -ur kivy/graphics/stencil_instructions.pyx kivy/graphics/stencil_instructions.pyx
|
||||
--- kivy/graphics/stencil_instructions.pyx 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/stencil_instructions.pyx 2015-03-12 20:16:11.438228738 +0200
|
||||
@@ -127,7 +127,7 @@
|
||||
'''Push the stencil stack. See the module documentation for more
|
||||
information.
|
||||
'''
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
global _stencil_level, _stencil_in_push
|
||||
if _stencil_in_push:
|
||||
raise Exception('Cannot use StencilPush inside another '
|
||||
@@ -151,7 +151,7 @@
|
||||
cdef class StencilPop(Instruction):
|
||||
'''Pop the stencil stack. See the module documentation for more information.
|
||||
'''
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
global _stencil_level, _stencil_in_push
|
||||
if _stencil_level == 0:
|
||||
raise Exception('Too much StencilPop (stack underflow)')
|
||||
@@ -177,7 +177,7 @@
|
||||
else:
|
||||
self._op = GL_EQUAL
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
global _stencil_in_push
|
||||
_stencil_in_push = 0
|
||||
glColorMask(1, 1, 1, 1)
|
||||
@@ -208,7 +208,7 @@
|
||||
cdef class StencilUnUse(Instruction):
|
||||
'''Use current stencil buffer to unset the mask.
|
||||
'''
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
glStencilFunc(GL_ALWAYS, 0, 0)
|
||||
glStencilOp(GL_DECR, GL_DECR, GL_DECR)
|
||||
glColorMask(0, 0, 0, 0)
|
||||
diff -ur kivy/graphics/vertex_instructions_line.pxi kivy/graphics/vertex_instructions_line.pxi
|
||||
--- kivy/graphics/vertex_instructions_line.pxi 2014-01-31 17:13:23.000000000 +0200
|
||||
+++ kivy/graphics/vertex_instructions_line.pxi 2015-03-12 20:26:50.588536611 +0200
|
||||
@@ -165,7 +165,7 @@
|
||||
self._stencil_use = StencilUse(op='lequal')
|
||||
self._stencil_unuse = StencilUnUse()
|
||||
|
||||
- cdef void apply(self):
|
||||
+ cdef void apply(self) except *:
|
||||
if self._width == 1.:
|
||||
VertexInstruction.apply(self)
|
||||
return
|
||||
|
Loading…
Reference in a new issue