Skip to content

Commit 525cbb0

Browse files
committed
cffi: fix build
1 parent 9720dbd commit 525cbb0

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

pythonforandroid/recipes/cffi/__init__.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
import os
2-
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2+
from pythonforandroid.recipe import PyProjectRecipe
33

44

5-
class CffiRecipe(CompiledComponentsPythonRecipe):
5+
class CffiRecipe(PyProjectRecipe):
66
"""
77
Extra system dependencies: autoconf, automake and libtool.
88
"""
99
name = 'cffi'
10-
version = '1.15.1'
11-
url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'
10+
version = '2.0.0'
11+
url = 'https://github.com/python-cffi/cffi/archive/refs/tags/v{version}.tar.gz'
1212

13-
depends = ['setuptools', 'pycparser', 'libffi']
13+
depends = ['pycparser', 'libffi']
1414

1515
patches = ['disable-pkg-config.patch']
1616

17-
# call_hostpython_via_targetpython = False
18-
install_in_hostpython = True
19-
2017
def get_hostrecipe_env(self, arch=None):
2118
# fixes missing ffi.h on some host systems (e.g. gentoo)
2219
env = super().get_hostrecipe_env(arch)
@@ -25,8 +22,8 @@ def get_hostrecipe_env(self, arch=None):
2522
env['FFI_INC'] = ",".join(includes)
2623
return env
2724

28-
def get_recipe_env(self, arch=None):
29-
env = super().get_recipe_env(arch)
25+
def get_recipe_env(self, arch=None, **kwargs):
26+
env = super().get_recipe_env(arch, **kwargs)
3027
libffi = self.get_recipe('libffi', self.ctx)
3128
includes = libffi.get_include_dirs(arch)
3229
env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes)
@@ -36,7 +33,7 @@ def get_recipe_env(self, arch=None):
3633
env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch))
3734
# required for libc and libdl
3835
env['LDFLAGS'] += ' -L{}'.format(arch.ndk_lib_dir_versioned)
39-
env['PYTHONPATH'] = ':'.join([
36+
env['PYTHONPATH'] += ':'.join([
4037
self.ctx.get_site_packages_dir(arch),
4138
env['BUILDLIB_PATH'],
4239
])

pythonforandroid/recipes/libffi/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def build_arch(self, arch):
3535
shprint(sh.make, '-j', str(cpu_count()), 'libffi.la', _env=env)
3636

3737
def get_include_dirs(self, arch):
38-
return [join(self.get_build_dir(arch.arch), 'include')]
38+
return [join(self.get_build_dir(arch), 'include')]
3939

4040

4141
recipe = LibffiRecipe()

0 commit comments

Comments
 (0)