Skip to content

Commit c280d12

Browse files
authored
Merge pull request kivy#1178 from snuq/master
Update __init__.py to support SDL2
2 parents 8bbfeba + aa9bceb commit c280d12

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pythonforandroid/recipes/audiostream/__init__.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,16 @@ class AudiostreamRecipe(CythonRecipe):
1212
depends = ['python2', ('sdl', 'sdl2'), 'pyjnius']
1313

1414
def get_recipe_env(self, arch):
15+
env = super(AudiostreamRecipe, self).get_recipe_env(arch)
1516
if 'sdl' in self.ctx.recipe_build_order:
1617
sdl_include = 'sdl'
1718
sdl_mixer_include = 'sdl_mixer'
1819
elif 'sdl2' in self.ctx.recipe_build_order:
19-
sdl_include = 'SDL'
20+
sdl_include = 'SDL2'
2021
sdl_mixer_include = 'SDL2_mixer'
21-
22-
#note: audiostream library is not yet able to judge whether it is being used with sdl or with sdl2.
23-
#this causes linking to fail against SDL2 (compiling against SDL2 works)
24-
#need to find a way to fix this in audiostream's setup.py
25-
raise RuntimeError('Audiostream library is not yet able to configure itself to link against SDL2. Patch on audiostream library needed - any help much appreciated!')
22+
env['USE_SDL2'] = 'True'
23+
env['SDL2_INCLUDE_DIR'] = '/home/kivy/.buildozer/android/platform/android-ndk-r9c/sources/android/support/include'
2624

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

0 commit comments

Comments
 (0)