lbry-android-sdk/p4a/pythonforandroid/recipes/sdl2_image/__init__.py

26 lines
936 B
Python
Raw Normal View History

2022-12-02 21:15:34 +01:00
import os
import sh
from pythonforandroid.logger import shprint
from pythonforandroid.recipe import BootstrapNDKRecipe
2022-12-02 21:15:34 +01:00
from pythonforandroid.util import current_directory
2017-08-13 03:24:00 +02:00
class LibSDL2Image(BootstrapNDKRecipe):
2022-12-02 21:15:34 +01:00
version = '2.6.2'
url = 'https://github.com/libsdl-org/SDL_image/releases/download/release-{version}/SDL2_image-{version}.tar.gz'
2017-08-13 03:24:00 +02:00
dir_name = 'SDL2_image'
2022-12-02 21:15:34 +01:00
patches = ['enable-webp.patch']
def prebuild_arch(self, arch):
# We do not have a folder for each arch on BootstrapNDKRecipe, so we
# need to skip the external deps download if we already have done it.
external_deps_dir = os.path.join(self.get_build_dir(arch.arch), "external")
if not os.path.exists(os.path.join(external_deps_dir, "libwebp")):
with current_directory(external_deps_dir):
shprint(sh.Command("./download.sh"))
super().prebuild_arch(arch)
2017-08-13 03:24:00 +02:00
recipe = LibSDL2Image()