@@ -10,7 +10,7 @@ class CffiRecipe(CompiledComponentsPythonRecipe):
10
10
version = '1.11.5'
11
11
url = 'https://pypi.python.org/packages/source/c/cffi/cffi-{version}.tar.gz'
12
12
13
- depends = [( 'python2' , 'python3crystax' ), 'setuptools' , 'pycparser' , 'libffi' ]
13
+ depends = ['setuptools' , 'pycparser' , 'libffi' ]
14
14
15
15
patches = ['disable-pkg-config.patch' ]
16
16
@@ -27,11 +27,10 @@ def get_hostrecipe_env(self, arch=None):
27
27
28
28
def get_recipe_env (self , arch = None ):
29
29
env = super (CffiRecipe , self ).get_recipe_env (arch )
30
- # sets linker to use the correct gcc (cross compiler)
31
- env ['LDSHARED' ] = env ['CC' ] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
32
30
libffi = self .get_recipe ('libffi' , self .ctx )
33
31
includes = libffi .get_include_dirs (arch )
34
32
env ['CFLAGS' ] = ' -I' .join ([env .get ('CFLAGS' , '' )] + includes )
33
+ env ['CFLAGS' ] += ' -I{}' .format (self .ctx .python_recipe .include_root (arch .arch ))
35
34
env ['LDFLAGS' ] = (env .get ('CFLAGS' , '' ) + ' -L' +
36
35
self .ctx .get_libs_dir (arch .arch ))
37
36
env ['LDFLAGS' ] += ' -L{}' .format (os .path .join (self .ctx .bootstrap .build_dir , 'libs' , arch .arch ))
@@ -44,15 +43,10 @@ def get_recipe_env(self, arch=None):
44
43
self .ctx .get_site_packages_dir (),
45
44
env ['BUILDLIB_PATH' ],
46
45
])
47
- if self .ctx .ndk == 'crystax' :
48
- # only keeps major.minor (discards patch)
49
- python_version = self .ctx .python_recipe .version [0 :3 ]
50
- ndk_dir_python = os .path .join (self .ctx .ndk_dir , 'sources/python/' , python_version )
51
- env ['LDFLAGS' ] += ' -L{}' .format (os .path .join (ndk_dir_python , 'libs' , arch .arch ))
52
- env ['LDFLAGS' ] += ' -lpython{}m' .format (python_version )
53
- # until `pythonforandroid/archs.py` gets merged upstream:
54
- # https://github.com/kivy/python-for-android/pull/1250/files#diff-569e13021e33ced8b54385f55b49cbe6
55
- env ['CFLAGS' ] += ' -I{}/include/python/' .format (ndk_dir_python )
46
+ env ['LDFLAGS' ] += ' -L{}' .format (self .ctx .python_recipe .link_root (arch .arch ))
47
+ env ['LDFLAGS' ] += ' -lpython{}' .format (self .ctx .python_recipe .major_minor_version_string )
48
+ if 'python3' in self .ctx .python_recipe .name :
49
+ env ['LDFLAGS' ] += 'm'
56
50
return env
57
51
58
52
0 commit comments