2017-08-13 03:24:00 +02:00
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
from pythonforandroid.recipe import CythonRecipe
|
|
|
|
from os.path import join
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
class AudiostreamRecipe(CythonRecipe):
|
2019-03-30 21:58:45 +01:00
|
|
|
version = 'master'
|
2017-08-13 03:24:00 +02:00
|
|
|
url = 'https://github.com/kivy/audiostream/archive/{version}.zip'
|
|
|
|
name = 'audiostream'
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = [('python2', 'python3'), ('sdl', 'sdl2'), 'pyjnius']
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
def get_recipe_env(self, arch):
|
2019-03-30 21:58:45 +01:00
|
|
|
env = super(AudiostreamRecipe, self).get_recipe_env(arch)
|
2017-08-13 03:24:00 +02:00
|
|
|
if 'sdl' in self.ctx.recipe_build_order:
|
|
|
|
sdl_include = 'sdl'
|
|
|
|
sdl_mixer_include = 'sdl_mixer'
|
|
|
|
elif 'sdl2' in self.ctx.recipe_build_order:
|
2019-03-30 21:58:45 +01:00
|
|
|
sdl_include = 'SDL2'
|
2017-08-13 03:24:00 +02:00
|
|
|
sdl_mixer_include = 'SDL2_mixer'
|
2019-03-30 21:58:45 +01:00
|
|
|
env['USE_SDL2'] = 'True'
|
|
|
|
env['SDL2_INCLUDE_DIR'] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include')
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
env['CFLAGS'] += ' -I{jni_path}/{sdl_include}/include -I{jni_path}/{sdl_mixer_include}'.format(
|
2019-03-30 21:58:45 +01:00
|
|
|
jni_path=join(self.ctx.bootstrap.build_dir, 'jni'),
|
|
|
|
sdl_include=sdl_include,
|
|
|
|
sdl_mixer_include=sdl_mixer_include)
|
|
|
|
env['NDKPLATFORM'] = self.ctx.ndk_platform
|
|
|
|
env['LIBLINK'] = 'NOTNONE' # Hacky fix. Needed by audiostream setup.py
|
2017-08-13 03:24:00 +02:00
|
|
|
return env
|
|
|
|
|
|
|
|
|
|
|
|
recipe = AudiostreamRecipe()
|