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

kivy / python-for-android / 13703183732

06 Mar 2025 04:15PM UTC coverage: 59.193% (-0.1%) from 59.288%
13703183732

Pull #3118

github

web-flow
Merge 420df684e into 9b0eed150
Pull Request #3118: Fix kiwisolver recipe fatal error: 'Python.h' file not found

1050 of 2363 branches covered (44.44%)

Branch coverage included in aggregate %.

1 of 6 new or added lines in 1 file covered. (16.67%)

4 existing lines in 1 file now uncovered.

4903 of 7694 relevant lines covered (63.72%)

2.54 hits per line

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

28.57
/pythonforandroid/recipes/librt/__init__.py
1
from os import makedirs, remove
4✔
2
from os.path import exists, join
4✔
3
import sh
4✔
4

5
from pythonforandroid.recipe import Recipe
4✔
6
from pythonforandroid.logger import shprint
4✔
7

8

9
class LibRt(Recipe):
4✔
10
    '''
11
    This is a dumb recipe. We may need this because some recipes inserted some
12
    flags `-lrt` without our control, case of:
13

14
        - :class:`~pythonforandroid.recipes.gevent.GeventRecipe`
15
        - :class:`~pythonforandroid.recipes.lxml.LXMLRecipe`
16

17
    .. note:: the librt doesn't exist in android but it is integrated into
18
        libc, so we create a symbolic link which we will remove when our build
19
        finishes'''
20

21
    def build_arch(self, arch):
4✔
22
        libc_path = join(arch.ndk_lib_dir_versioned, 'libc')
×
23
        # Create a temporary folder to add to link path with a fake librt.so:
24
        fake_librt_temp_folder = join(
×
25
            self.get_build_dir(arch.arch),
26
            "p4a-librt-recipe-tempdir"
27
        )
28
        if not exists(fake_librt_temp_folder):
×
29
            makedirs(fake_librt_temp_folder)
×
30

31
        # Set symlinks, and make sure to update them on every build run:
32
        if exists(join(fake_librt_temp_folder, "librt.so")):
×
33
            remove(join(fake_librt_temp_folder, "librt.so"))
×
34
        shprint(sh.ln, '-sf',
×
35
                libc_path + '.so',
36
                join(fake_librt_temp_folder, "librt.so"),
37
                )
38
        if exists(join(fake_librt_temp_folder, "librt.a")):
×
39
            remove(join(fake_librt_temp_folder, "librt.a"))
×
40
        shprint(sh.ln, '-sf',
×
41
                libc_path + '.a',
42
                join(fake_librt_temp_folder, "librt.a"),
43
               )
44

45
        # Add folder as -L link option for all recipes if not done yet:
46
        if fake_librt_temp_folder not in arch.extra_global_link_paths:
×
47
            arch.extra_global_link_paths.append(
×
48
                fake_librt_temp_folder
49
            )
50

51

52
recipe = LibRt()
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

© 2026 Coveralls, Inc