diff --git a/pythonforandroid/recipes/cffi/__init__.py b/pythonforandroid/recipes/cffi/__init__.py index f0c25a92c9..9d7f45c55e 100644 --- a/pythonforandroid/recipes/cffi/__init__.py +++ b/pythonforandroid/recipes/cffi/__init__.py @@ -1,22 +1,19 @@ import os -from pythonforandroid.recipe import CompiledComponentsPythonRecipe +from pythonforandroid.recipe import PyProjectRecipe -class CffiRecipe(CompiledComponentsPythonRecipe): +class CffiRecipe(PyProjectRecipe): """ Extra system dependencies: autoconf, automake and libtool. """ name = 'cffi' - version = '1.15.1' - url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz' + version = '2.0.0' + url = 'https://github.com/python-cffi/cffi/archive/refs/tags/v{version}.tar.gz' - depends = ['setuptools', 'pycparser', 'libffi'] + depends = ['pycparser', 'libffi'] patches = ['disable-pkg-config.patch'] - # call_hostpython_via_targetpython = False - install_in_hostpython = True - def get_hostrecipe_env(self, arch=None): # fixes missing ffi.h on some host systems (e.g. gentoo) env = super().get_hostrecipe_env(arch) @@ -25,8 +22,8 @@ def get_hostrecipe_env(self, arch=None): env['FFI_INC'] = ",".join(includes) return env - def get_recipe_env(self, arch=None): - env = super().get_recipe_env(arch) + def get_recipe_env(self, arch=None, **kwargs): + env = super().get_recipe_env(arch, **kwargs) libffi = self.get_recipe('libffi', self.ctx) includes = libffi.get_include_dirs(arch) env['CFLAGS'] = ' -I'.join([env.get('CFLAGS', '')] + includes) @@ -36,7 +33,7 @@ def get_recipe_env(self, arch=None): env['LDFLAGS'] += ' -L{}'.format(os.path.join(self.ctx.bootstrap.build_dir, 'libs', arch.arch)) # required for libc and libdl env['LDFLAGS'] += ' -L{}'.format(arch.ndk_lib_dir_versioned) - env['PYTHONPATH'] = ':'.join([ + env['PYTHONPATH'] += ':'.join([ self.ctx.get_site_packages_dir(arch), env['BUILDLIB_PATH'], ]) diff --git a/pythonforandroid/recipes/libffi/__init__.py b/pythonforandroid/recipes/libffi/__init__.py index 767881b793..5636dffa7d 100644 --- a/pythonforandroid/recipes/libffi/__init__.py +++ b/pythonforandroid/recipes/libffi/__init__.py @@ -35,7 +35,7 @@ def build_arch(self, arch): shprint(sh.make, '-j', str(cpu_count()), 'libffi.la', _env=env) def get_include_dirs(self, arch): - return [join(self.get_build_dir(arch.arch), 'include')] + return [join(self.get_build_dir(arch), 'include')] recipe = LibffiRecipe()