• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kivy / python-for-android / 14420258271

12 Apr 2025 01:55PM UTC coverage: 59.141% (+0.03%) from 59.111%
14420258271

push

github

web-flow
Add `SDL3` bootstrap (alongside `SDL3`, `SDL3_ttf`, `SDL3_mixer`, `SDL3_image` recipes) for Kivy `3.0.0` (#3125)

* Add SDL3 bootstrap

* Avoid some DRY issues + minor fixes + version bump

1054 of 2383 branches covered (44.23%)

Branch coverage included in aggregate %.

112 of 160 new or added lines in 14 files covered. (70.0%)

1 existing line in 1 file now uncovered.

4960 of 7786 relevant lines covered (63.7%)

2.54 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

53.33
/pythonforandroid/recipes/sdl3/__init__.py
1
from os.path import exists, join
4✔
2

3
from pythonforandroid.recipe import BootstrapNDKRecipe
4✔
4
from pythonforandroid.toolchain import current_directory, shprint
4✔
5
import sh
4✔
6

7

8
class LibSDL3Recipe(BootstrapNDKRecipe):
4✔
9
    version = "3.2.10"
4✔
10
    url = "https://github.com/libsdl-org/SDL/releases/download/release-{version}/SDL3-{version}.tar.gz"
4✔
11
    md5sum = "70cda886bcf5a4fdac550db796d2efa2"
4✔
12

13
    conflicts = ["sdl2"]
4✔
14

15
    dir_name = "SDL"
4✔
16

17
    depends = ["sdl3_image", "sdl3_mixer", "sdl3_ttf"]
4✔
18

19
    def get_recipe_env(
4✔
20
        self, arch=None, with_flags_in_cc=True, with_python=True
21
    ):
NEW
22
        env = super().get_recipe_env(
×
23
            arch=arch,
24
            with_flags_in_cc=with_flags_in_cc,
25
            with_python=with_python,
26
        )
NEW
27
        env["APP_ALLOW_MISSING_DEPS"] = "true"
×
NEW
28
        return env
×
29

30
    def get_include_dirs(self, arch):
4✔
NEW
31
        return [
×
32
            join(self.ctx.bootstrap.build_dir, "jni", "SDL", "include"),
33
            join(self.ctx.bootstrap.build_dir, "jni", "SDL", "include", "SDL3"),
34
        ]
35

36
    def should_build(self, arch):
4✔
NEW
37
        libdir = join(self.get_build_dir(arch.arch), "../..", "libs", arch.arch)
×
NEW
38
        libs = [
×
39
            "libmain.so",
40
            "libSDL3.so",
41
            "libSDL3_image.so",
42
            "libSDL3_mixer.so",
43
            "libSDL3_ttf.so",
44
        ]
NEW
45
        return not all(exists(join(libdir, x)) for x in libs)
×
46

47
    def build_arch(self, arch):
4✔
NEW
48
        env = self.get_recipe_env(arch)
×
49

NEW
50
        with current_directory(self.get_jni_dir()):
×
NEW
51
            shprint(
×
52
                sh.Command(join(self.ctx.ndk_dir, "ndk-build")),
53
                "V=1",
54
                "NDK_DEBUG=" + ("1" if self.ctx.build_as_debuggable else "0"),
55
                _env=env,
56
            )
57

58

59
recipe = LibSDL3Recipe()
4✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc