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

kivy / python-for-android / 18506058818

14 Oct 2025 06:17PM UTC coverage: 59.201% (-0.004%) from 59.205%
18506058818

Pull #3233

github

web-flow
Merge b5a5e5df6 into 691959c74
Pull Request #3233: `cffi`: fix build

1071 of 2409 branches covered (44.46%)

Branch coverage included in aggregate %.

7 of 9 new or added lines in 2 files covered. (77.78%)

3 existing lines in 1 file now uncovered.

5019 of 7878 relevant lines covered (63.71%)

5.08 hits per line

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

39.29
/pythonforandroid/recipes/cffi/__init__.py
1
import os
8✔
2
from pythonforandroid.recipe import PyProjectRecipe
8✔
3

4

5
class CffiRecipe(PyProjectRecipe):
8✔
6
    """
7
    Extra system dependencies: autoconf, automake and libtool.
8
    """
9
    name = 'cffi'
8✔
10
    version = '2.0.0'
8✔
11
    url = 'https://github.com/python-cffi/cffi/archive/refs/tags/v{version}.tar.gz'
8✔
12

13
    depends = ['pycparser', 'libffi']
8✔
14

15
    patches = ['disable-pkg-config.patch']
8✔
16

17
    def get_hostrecipe_env(self, arch=None):
8✔
18
        # fixes missing ffi.h on some host systems (e.g. gentoo)
19
        env = super().get_hostrecipe_env(arch)
×
20
        libffi = self.get_recipe('libffi', self.ctx)
×
21
        includes = libffi.get_include_dirs(arch)
×
22
        env['FFI_INC'] = ",".join(includes)
×
23
        return env
×
24

25
    def get_recipe_env(self, arch=None, **kwargs):
8✔
NEW
26
        env = super().get_recipe_env(arch, **kwargs)
×
27
        libffi = self.get_recipe('libffi', self.ctx)
×
28
        includes = libffi.get_include_dirs(arch)
×
29
        env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes)
×
30
        env['CFLAGS'] += ' -I{}'.format(self.ctx.python_recipe.include_root(arch.arch))
×
31
        env['LDFLAGS'] = (env.get('CFLAGS', '') + ' -L' +
×
32
                          self.ctx.get_libs_dir(arch.arch))
33
        env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch))
×
34
        # required for libc and libdl
35
        env['LDFLAGS'] += ' -L{}'.format(arch.ndk_lib_dir_versioned)
×
NEW
36
        env['PYTHONPATH'] += ':'.join([
×
37
            self.ctx.get_site_packages_dir(arch),
38
            env['BUILDLIB_PATH'],
39
        ])
UNCOV
40
        env['LDFLAGS'] += ' -L{}'.format(self.ctx.python_recipe.link_root(arch.arch))
×
UNCOV
41
        env['LDFLAGS'] += ' -lpython{}'.format(self.ctx.python_recipe.link_version)
×
UNCOV
42
        return env
×
43

44

45
recipe = CffiRecipe()
8✔
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