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

kivy / python-for-android / 5976260269

25 Aug 2023 01:05PM UTC coverage: 58.986% (+0.3%) from 58.676%
5976260269

push

github

web-flow
Standardise `ensure_dir` and `rmdir` (#2871)

* Standardise ensure_dir and rmdir

* Standardise ensure_dir and rmdir

* Add libmysqlclient to broken list

* Libtorrent failing to be rebuilt

* Add boost to broken recipes list

940 of 2241 branches covered (0.0%)

Branch coverage included in aggregate %.

73 of 113 new or added lines in 21 files covered. (64.6%)

3 existing lines in 3 files now uncovered.

4715 of 7346 relevant lines covered (64.18%)

2.56 hits per line

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

41.46
/pythonforandroid/recipes/libglob/__init__.py
1
"""
2
    android libglob
3
    available via '-lglob' LDFLAG
4
"""
5
from os.path import join
4✔
6

7
import sh
4✔
8

9
from pythonforandroid.logger import shprint
4✔
10
from pythonforandroid.recipe import Recipe
4✔
11
from pythonforandroid.toolchain import current_directory
4✔
12
from pythonforandroid.util import ensure_dir
4✔
13

14

15
class LibGlobRecipe(Recipe):
4✔
16
    """Make a glob.h and glob.so for the python_install_dir()"""
17
    version = '0.0.1'
4✔
18
    url = None
4✔
19
    #
20
    # glob.h and glob.c extracted from
21
    # https://github.com/white-gecko/TokyoCabinet, e.g.:
22
    #   https://raw.githubusercontent.com/white-gecko/TokyoCabinet/master/glob.h
23
    #   https://raw.githubusercontent.com/white-gecko/TokyoCabinet/master/glob.c
24
    # and pushed in via patch
25
    name = 'libglob'
4✔
26
    built_libraries = {'libglob.so': '.'}
4✔
27

28
    depends = ['hostpython3']
4✔
29
    patches = ['glob.patch']
4✔
30

31
    def should_build(self, arch):
4✔
32
        """It's faster to build than check"""
33
        return True
×
34

35
    def prebuild_arch(self, arch):
4✔
36
        """Make the build and target directories"""
37
        path = self.get_build_dir(arch.arch)
×
NEW
38
        ensure_dir(path)
×
39

40
    def build_arch(self, arch):
4✔
41
        """simple shared compile"""
42
        env = self.get_recipe_env(arch, with_flags_in_cc=False)
×
43
        for path in (
×
44
                self.get_build_dir(arch.arch),
45
                join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Lib'),
46
                join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include')):
NEW
47
            ensure_dir(path)
×
48
        cli = env['CC'].split()[0]
×
49
        # makes sure first CC command is the compiler rather than ccache, refs:
50
        # https://github.com/kivy/python-for-android/issues/1399
51
        if 'ccache' in cli:
×
52
            cli = env['CC'].split()[1]
×
53
        cc = sh.Command(cli)
×
54

55
        with current_directory(self.get_build_dir(arch.arch)):
×
56
            cflags = env['CFLAGS'].split()
×
57
            cflags.extend(['-I.', '-c', '-l.', 'glob.c', '-I.'])
×
58
            shprint(cc, *cflags, _env=env)
×
59
            cflags = env['CFLAGS'].split()
×
60
            cflags.extend(['-shared', '-I.', 'glob.o', '-o', 'libglob.so'])
×
61
            cflags.extend(env['LDFLAGS'].split())
×
62
            shprint(cc, *cflags, _env=env)
×
63

64

65
recipe = LibGlobRecipe()
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