Skip to content

Commit b2022a0

Browse files
committed
Fix ffpyplayer==4.0.0 compile with SDL2
1 parent 5b6ed28 commit b2022a0

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

pythonforandroid/recipes/ffpyplayer/__init__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,24 @@
99
class FFPyPlayerRecipe(CythonRecipe):
1010
version = 'v4.0.0'
1111
url = 'https://github.com/matham/ffpyplayer/archive/{version}.zip'
12+
md5sum = '99f4c7103bce0ecb167510fc810db82f'
1213
depends = ['python2', 'sdl2', 'ffmpeg']
1314
opt_depends = ['openssl', 'ffpyplayer_codecs']
15+
patches = ['patches/fix-ffpyplayer-setup.patch'] # need this to compile with SDL2
16+
17+
def prebuild_arch(self, arch):
18+
self.apply_patches(arch)
1419

1520
def get_recipe_env(self, arch, with_flags_in_cc=True):
1621
env = super(FFPyPlayerRecipe, self).get_recipe_env(arch)
1722

18-
# TODO cannot find -lsdl error
19-
2023
env["SDL_INCLUDE_DIR"] = join(self.ctx.bootstrap.build_dir, 'jni', 'SDL', 'include')
2124
env["SDL_LIB_DIR"] = join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)
2225

2326
build_dir = Recipe.get_recipe('ffmpeg', self.ctx).get_build_dir(arch.arch)
2427
env["FFMPEG_INCLUDE_DIR"] = join(build_dir, "include")
2528
env["FFMPEG_LIB_DIR"] = join(build_dir, "lib")
29+
2630
return env
2731

2832
recipe = FFPyPlayerRecipe()
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--- ./setup.py.orig 2016-11-28 23:59:57.000000000 +0300
2+
+++ ./setup.py 2016-12-11 14:50:15.938008000 +0300
3+
@@ -117,11 +117,13 @@
4+
include_dirs = [
5+
environ.get("SDL_INCLUDE_DIR"),
6+
environ.get("FFMPEG_INCLUDE_DIR")]
7+
- ffmpeg_libdir = environ.get("FFMPEG_LIB_DIR")
8+
- sdl = "SDL"
9+
+ library_dirs = [
10+
+ environ.get("SDL_LIB_DIR"),
11+
+ environ.get("FFMPEG_LIB_DIR")]
12+
+ sdl = "SDL2"
13+
libraries = ['avcodec', 'avdevice', 'avfilter', 'avformat',
14+
'avutil', 'swscale', 'swresample', 'postproc',
15+
- 'sdl']
16+
+ 'SDL2']
17+
18+
else:
19+

0 commit comments

Comments
 (0)