2019-03-30 21:58:45 +01:00
|
|
|
from pythonforandroid.recipe import CythonRecipe
|
|
|
|
from pythonforandroid.toolchain import Recipe
|
|
|
|
from os.path import join
|
2017-08-13 03:24:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
class FFPyPlayerRecipe(CythonRecipe):
|
2019-03-30 21:58:45 +01:00
|
|
|
version = '6f7568b498715c2da88f061ebad082a042514923'
|
2017-08-13 03:24:00 +02:00
|
|
|
url = 'https://github.com/matham/ffpyplayer/archive/{version}.zip'
|
2019-03-30 21:58:45 +01:00
|
|
|
depends = [('python2', 'python3'), 'sdl2', 'ffmpeg']
|
2017-08-13 03:24:00 +02:00
|
|
|
opt_depends = ['openssl', 'ffpyplayer_codecs']
|
|
|
|
|
|
|
|
def get_recipe_env(self, arch, with_flags_in_cc=True):
|
|
|
|
env = super(FFPyPlayerRecipe, self).get_recipe_env(arch)
|
|
|
|
|
|
|
|
build_dir = Recipe.get_recipe('ffmpeg', self.ctx).get_build_dir(arch.arch)
|
|
|
|
env["FFMPEG_INCLUDE_DIR"] = join(build_dir, "include")
|
|
|
|
env["FFMPEG_LIB_DIR"] = join(build_dir, "lib")
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
env["SDL_INCLUDE_DIR"] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include')
|
|
|
|
env["SDL_LIB_DIR"] = join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)
|
|
|
|
|
|
|
|
env["USE_SDL2_MIXER"] = '1'
|
|
|
|
env["SDL2_MIXER_INCLUDE_DIR"] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL2_mixer')
|
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
return env
|
|
|
|
|
2019-03-30 21:58:45 +01:00
|
|
|
|
2017-08-13 03:24:00 +02:00
|
|
|
recipe = FFPyPlayerRecipe()
|