Skip to content

Commit 63fc703

Browse files
committed
re-add patch; fix linking with static libx264
1 parent c8f7a5c commit 63fc703

File tree

2 files changed

+28
-3
lines changed

2 files changed

+28
-3
lines changed

pythonforandroid/recipes/ffmpeg/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ class FFMpegRecipe(Recipe):
88
# Moved to github.com instead of ffmpeg.org to improve download speed
99
url = 'https://github.com/FFmpeg/FFmpeg/archive/{version}.zip'
1010
depends = ['sdl2'] # Need this to build correct recipe order
11-
opts_depends = ['openssl', 'ffpyplayer_codecs']
11+
opts_depends = ['openssl', 'ffpyplayer_codecs', 'av_codecs']
12+
patches = ['patches/configure.patch']
1213

1314
def should_build(self, arch):
1415
build_dir = self.get_build_dir(arch.arch)
@@ -39,7 +40,9 @@ def build_arch(self, arch):
3940
'-DOPENSSL_API_COMPAT=0x10002000L']
4041
ldflags += ['-L' + build_dir]
4142

42-
if 'ffpyplayer_codecs' in self.ctx.recipe_build_order:
43+
codecs_opts = {"ffpyplayer_codecs", "av_codecs"}
44+
if codecs_opts.intersection(self.ctx.recipe_build_order):
45+
4346
# Enable GPL
4447
flags += ['--enable-gpl']
4548

@@ -48,7 +51,7 @@ def build_arch(self, arch):
4851
build_dir = Recipe.get_recipe(
4952
'libx264', self.ctx).get_build_dir(arch.arch)
5053
cflags += ['-I' + build_dir + '/include/']
51-
ldflags += ['-lx264', '-L' + build_dir + '/lib/']
54+
ldflags += [build_dir + '/lib/' + 'libx264.a']
5255

5356
# libshine
5457
flags += ['--enable-libshine']
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/configure b/configure
2+
index 5af693c954..d1d0a4f0a2 100755
3+
--- a/configure
4+
+++ b/configure
5+
@@ -6800,7 +6800,7 @@ enabled librsvg && require_pkg_config librsvg librsvg-2.0 librsvg-2.0/
6+
enabled librtmp && require_pkg_config librtmp librtmp librtmp/rtmp.h RTMP_Socket
7+
enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8.1" rubberband/rubberband-c.h rubberband_new -lstdc++ && append librubberband_extralibs "-lstdc++"
8+
enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.1" shaderc/shaderc.h shaderc_compiler_initialize
9+
-enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer
10+
+enabled libshine && require "shine" shine/layer3.h shine_encode_buffer -lshine -lm
11+
enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init ||
12+
require libsmbclient libsmbclient.h smbc_init -lsmbclient; }
13+
enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++
14+
@@ -6850,7 +6850,7 @@ enabled libvpx && {
15+
enabled libwebp && {
16+
enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion
17+
enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; }
18+
-enabled libx264 && require_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode &&
19+
+enabled libx264 && require "x264" "stdint.h x264.h" x264_encoder_encode &&
20+
require_cpp_condition libx264 x264.h "X264_BUILD >= 122" && {
21+
[ "$toolchain" != "msvc" ] ||
22+
require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } &&

0 commit comments

Comments
 (0)