Skip to content

Commit 7c33e64

Browse files
author
Pol Canelles
committed
Netifaces's recipe for python 2.7.11
1 parent 52f2478 commit 7c33e64

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed
Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,21 @@
11
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2-
from os.path import join
3-
42

53
class 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-
2521
recipe = NetifacesRecipe()

0 commit comments

Comments
 (0)