Skip to content

Commit 7e16b3c

Browse files
committed
Add should_build for deps.
1 parent 3b20137 commit 7e16b3c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

pythonforandroid/recipes/ffmpeg/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ class FFMpegRecipe(Recipe):
1414
depends = ['openssl', 'ffpyplayer_codecs'] # TODO should be opts_depends
1515
patches = ['patches/fix-libshine-configure.patch']
1616

17-
# TODO add should_build(self, arch)
17+
def should_build(self, arch):
18+
build_dir = self.get_build_dir(arch.arch)
19+
return not exists(join(build_dir, 'lib', 'libavcodec.so'))
1820

1921
def prebuild_arch(self, arch):
2022
self.apply_patches(arch)

pythonforandroid/recipes/libshine/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class LibShineRecipe(Recipe):
1010
url = 'https://github.com/toots/shine/archive/{version}.zip'
1111
md5sum = '24cf9488d06f7acf0a0fbb162cc587ab'
1212

13-
# TODO add should_build(self, arch)
13+
def should_build(self, arch):
14+
build_dir = self.get_build_dir(arch.arch)
15+
return not exists(join(build_dir, 'lib', 'libshine.a'))
1416

1517
def build_arch(self, arch):
1618
with current_directory(self.get_build_dir(arch.arch)):

pythonforandroid/recipes/libx264/__init__.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class LibX264Recipe(Recipe):
1010
url = 'http://mirror.yandex.ru/mirrors/ftp.videolan.org/x264/snapshots/{version}.tar.bz2'
1111
md5sum = '6bcca94ae1d81ee14236ba9af42135d9'
1212

13-
# TODO add should_build(self, arch)
13+
def should_build(self, arch):
14+
build_dir = self.get_build_dir(arch.arch)
15+
return not exists(join(build_dir, 'lib', 'libx264.a'))
1416

1517
def build_arch(self, arch):
1618
with current_directory(self.get_build_dir(arch.arch)):

0 commit comments

Comments
 (0)