lbry-fdroid/p4a/pythonforandroid/recipes/audiostream/__init__.py
Akinwale Ariwodola 8b2694efb7
New build (#508)
* fix build for openssl 1.1.1b required for sdk
(cherry picked from commit aa49e3b2755b97b6331cdbbb89efc954de8d5977)

* use js code from master

* fix openssl recipe and tweak build
(cherry picked from commit 6e94c27021c7bd7b1e880c2fc314850e36a5a38e)

* remove unused build recipes
(cherry picked from commit f5c0577bdb175bfc0990602936bbc9e2052e1f25)
2019-03-30 21:58:45 +01:00

32 lines
1.3 KiB
Python

from pythonforandroid.recipe import CythonRecipe
from os.path import join
class AudiostreamRecipe(CythonRecipe):
version = 'master'
url = 'https://github.com/kivy/audiostream/archive/{version}.zip'
name = 'audiostream'
depends = [('python2', 'python3'), ('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 = 'SDL2'
sdl_mixer_include = 'SDL2_mixer'
env['USE_SDL2'] = 'True'
env['SDL2_INCLUDE_DIR'] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include')
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,
sdl_mixer_include=sdl_mixer_include)
env['NDKPLATFORM'] = self.ctx.ndk_platform
env['LIBLINK'] = 'NOTNONE' # Hacky fix. Needed by audiostream setup.py
return env
recipe = AudiostreamRecipe()