11import 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 ])
0 commit comments