Skip to content

Commit 39d083a

Browse files
authored
Merge pull request kivy#968 from inclement/fix_kivy_opengl_build
Updated Kivy recipe to work with Kivy master
2 parents fa5c2b9 + 2146dad commit 39d083a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

pythonforandroid/recipes/kivy/__init__.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,22 @@ class KivyRecipe(CythonRecipe):
1616

1717
# patches = ['setargv.patch']
1818

19+
def cythonize_build(self, env, build_dir='.'):
20+
super(KivyRecipe, self).cythonize_build(env, build_dir=build_dir)
21+
22+
if not exists(join(build_dir, 'kivy', 'include')):
23+
return
24+
25+
# If kivy is new enough to use the include dir, copy it
26+
# manually to the right location as we bypass this stage of
27+
# the build
28+
with current_directory(build_dir):
29+
build_libs_dirs = glob.glob(join('build', 'lib.*'))
30+
31+
for dirn in build_libs_dirs:
32+
shprint(sh.cp, '-r', join('kivy', 'include'),
33+
join(dirn, 'kivy'))
34+
1935
def get_recipe_env(self, arch):
2036
env = super(KivyRecipe, self).get_recipe_env(arch)
2137
if 'sdl2' in self.ctx.recipe_build_order:
@@ -26,6 +42,14 @@ def get_recipe_env(self, arch):
2642
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer'),
2743
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'),
2844
])
45+
46+
# Set include dir for pxi files - Kivy normally handles this
47+
# in the setup.py invocation, but we skip this
48+
build_dir = self.get_build_dir(arch.arch)
49+
self.cython_args = ['-I{}'.format(join(build_dir, 'kivy', 'include'))]
50+
51+
env['CFLAGS'] += ' -I{}'.format(join(build_dir, 'kivy', 'include'))
52+
2953
return env
3054

3155
recipe = KivyRecipe()

0 commit comments

Comments
 (0)