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

kivy / python-for-android / 9193455819

22 May 2024 02:42PM UTC coverage: 58.992% (-0.2%) from 59.143%
9193455819

push

github

web-flow
Merge pull request #3015 from T-Dynamos/uvloop

recipes: add new `uvloop` recipe

1044 of 2361 branches covered (44.22%)

Branch coverage included in aggregate %.

15 of 31 new or added lines in 2 files covered. (48.39%)

4 existing lines in 1 file now uncovered.

4844 of 7620 relevant lines covered (63.57%)

2.53 hits per line

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

28.57
/pythonforandroid/recipes/libpthread/__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 LibPthread(Recipe):
4✔
10
    '''
11
    This is a dumb recipe. We may need this because some recipes inserted some
12
    flags `-lpthread` without our control, case of:
13

14
        - :class:`~pythonforandroid.recipes.uvloop.UvloopRecipe`
15

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

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

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

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

50

51
recipe = LibPthread()
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