Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated Kivy recipe to work with Kivy master #968

Merged
merged 2 commits into from
Dec 23, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pythonforandroid/recipes/kivy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,22 @@ class KivyRecipe(CythonRecipe):

# patches = ['setargv.patch']

def cythonize_build(self, env, build_dir='.'):
super(KivyRecipe, self).cythonize_build(env, build_dir=build_dir)

if not exists(join(build_dir, 'kivy', 'include')):
return

# If kivy is new enough to use the include dir, copy it
# manually to the right location as we bypass this stage of
# the build
with current_directory(build_dir):
build_libs_dirs = glob.glob(join('build', 'lib.*'))

for dirn in build_libs_dirs:
shprint(sh.cp, '-r', join('kivy', 'include'),
join(dirn, 'kivy'))

def get_recipe_env(self, arch):
env = super(KivyRecipe, self).get_recipe_env(arch)
if 'sdl2' in self.ctx.recipe_build_order:
Expand All @@ -25,6 +41,14 @@ def get_recipe_env(self, arch):
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer'),
join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_ttf'),
])

# Set include dir for pxi files - Kivy normally handles this
# in the setup.py invocation, but we skip this
build_dir = self.get_build_dir(arch.arch)
self.cython_args = ['-I{}'.format(join(build_dir, 'kivy', 'include'))]

env['CFLAGS'] += ' -I{}'.format(join(build_dir, 'kivy', 'include'))

return env

recipe = KivyRecipe()