Skip to content

Update __init__.py to support SDL2 #1178

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

Merged
merged 2 commits into from
Dec 10, 2017
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
11 changes: 4 additions & 7 deletions pythonforandroid/recipes/audiostream/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ class AudiostreamRecipe(CythonRecipe):
depends = ['python2', ('sdl', 'sdl2'), 'pyjnius']

def get_recipe_env(self, arch):
env = super(AudiostreamRecipe, self).get_recipe_env(arch)
if 'sdl' in self.ctx.recipe_build_order:
sdl_include = 'sdl'
sdl_mixer_include = 'sdl_mixer'
elif 'sdl2' in self.ctx.recipe_build_order:
sdl_include = 'SDL'
sdl_include = 'SDL2'
sdl_mixer_include = 'SDL2_mixer'

#note: audiostream library is not yet able to judge whether it is being used with sdl or with sdl2.
#this causes linking to fail against SDL2 (compiling against SDL2 works)
#need to find a way to fix this in audiostream's setup.py
raise RuntimeError('Audiostream library is not yet able to configure itself to link against SDL2. Patch on audiostream library needed - any help much appreciated!')
env['USE_SDL2'] = 'True'
env['SDL2_INCLUDE_DIR'] = '/home/kivy/.buildozer/android/platform/android-ndk-r9c/sources/android/support/include'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😢


env = super(AudiostreamRecipe, self).get_recipe_env(arch)
env['CFLAGS'] += ' -I{jni_path}/{sdl_include}/include -I{jni_path}/{sdl_mixer_include}'.format(
jni_path = join(self.ctx.bootstrap.build_dir, 'jni'),
sdl_include = sdl_include,
Expand Down