File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
pythonforandroid/recipes/netifaces Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 11from pythonforandroid .recipe import CompiledComponentsPythonRecipe
2- from os .path import join
3-
42
53class NetifacesRecipe (CompiledComponentsPythonRecipe ):
64 name = 'netifaces'
75 version = '0.10.4'
86 url = 'https://pypi.python.org/packages/source/n/netifaces/netifaces-{version}.tar.gz'
9- site_packages_name = 'netifaces'
107 depends = ['python2' , 'setuptools' ]
8+ call_hostpython_via_targetpython = False
9+ site_packages_name = 'netifaces'
1110
1211 def get_recipe_env (self , arch = None ):
1312 env = super (NetifacesRecipe , self ).get_recipe_env (arch )
14-
15- # TODO: fix hardcoded path
16- # This is required to prevent issue with _io.so import.
17- hostpython = self .get_recipe ('hostpython2' , self .ctx )
18- env ['PYTHONPATH' ] = (
19- join (hostpython .get_build_dir (arch .arch ), 'build' ,
20- 'lib.linux-x86_64-2.7' ) + ':' + env .get ('PYTHONPATH' , '' )
21- )
13+ env ['PYTHON_ROOT' ] = self .ctx .get_python_install_dir ()
14+ env ['CFLAGS' ] += ' -I' + env ['PYTHON_ROOT' ] + '/include/python2.7'
15+ # Set linker to use the correct gcc
16+ env ['LDSHARED' ] = env ['CC' ] + ' -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions'
17+ env ['LDFLAGS' ] += ' -L' + env ['PYTHON_ROOT' ] + '/lib' + \
18+ ' -lpython2.7'
2219 return env
2320
24-
2521recipe = NetifacesRecipe ()
You can’t perform that action at this time.
0 commit comments