Skip to content

Commit

Permalink
Merge pull request #2482 from AndyRusso/sdl2_rebuilding
Browse files Browse the repository at this point in the history
Add should_build method to sdl2 recipe
  • Loading branch information
AndreMiras authored Oct 12, 2021
2 parents 77d2629 + 9875ff4 commit 8903522
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pythonforandroid/recipes/sdl2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from os.path import exists, join

from pythonforandroid.recipe import BootstrapNDKRecipe
from pythonforandroid.toolchain import current_directory, shprint
import sh
Expand All @@ -18,6 +20,15 @@ def get_recipe_env(self, arch=None, with_flags_in_cc=True, with_python=True):
env['APP_ALLOW_MISSING_DEPS'] = 'true'
return env

def should_build(self, arch):
libdir = join(
self.get_build_dir(arch.arch),
'../..',
'libs', arch.arch
)
libs = ['libhidapi.so', 'libmain.so', 'libSDL2.so', 'libSDL2_image.so', 'libSDL2_mixer.so', 'libSDL2_ttf.so']
return not all(exists(join(libdir, x)) for x in libs)

def build_arch(self, arch):
env = self.get_recipe_env(arch)

Expand Down

0 comments on commit 8903522

Please sign in to comment.