forked from kivy/python-for-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
41 lines (34 loc) · 1.31 KB
/
__init__.py
File metadata and controls
41 lines (34 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import sh
from pythonforandroid.logger import shprint
from pythonforandroid.recipe import BootstrapNDKRecipe
from pythonforandroid.util import current_directory
class LibSDL3Image(BootstrapNDKRecipe):
version = "3.4.0"
url = "https://github.com/libsdl-org/SDL_image/releases/download/release-{version}/SDL3_image-{version}.tar.gz"
dir_name = "SDL3_image"
patches = ["enable-webp.patch"]
def get_include_dirs(self, arch):
return [
os.path.join(
self.ctx.bootstrap.build_dir, "jni", "SDL3_image", "include"
),
os.path.join(
self.ctx.bootstrap.build_dir,
"jni",
"SDL3_image",
"include",
"SDL3_image",
),
]
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)
recipe = LibSDL3Image()