8000 Merge pull request #602 from tito/add-zeroconf · peterdocter/python-for-android@34b8037 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 34b8037

Browse files
committed
Merge pull request kivy#602 from tito/add-zeroconf
Add zeroconf and netifaces recipes
2 parents 43348ed + fe775dc commit 34b8037

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from pythonforandroid.recipe import CompiledComponentsPythonRecipe
2+
from os.path import join
3+
4+
5+
class NetifacesRecipe(CompiledComponentsPythonRecipe):
6+
name = 'netifaces'
7+
version = '0.10.4'
8+
url = 'https://pypi.python.org/packages/source/n/netifaces/netifaces-{version}.tar.gz'
9+
site_packages_name = 'netifaces'
10+
depends = ['python2', 'setuptools']
11+
12+
def get_recipe_env(self, arch=None):
13+
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+
)
22+
return env
23+
24+
25+
recipe = NetifacesRecipe()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from pythonforandroid.recipe import PythonRecipe
2+
from os.path import join
3+
4+
5+
class ZeroconfRecipe(PythonRecipe):
6+
name = 'zeroconf'
7+
version = '0.17.4'
8+
url = 'https://pypi.python.org/packages/source/z/zeroconf/zeroconf-{version}.tar.gz'
9+
depends = ['python2', 'netifaces', 'enum34', 'six']
10+
11+
def get_recipe_env(self, arch=None):
12+
env = super(ZeroconfRecipe, self).get_recipe_env(arch)
13+
14+
# TODO: fix hardcoded path
15+
# This is required to prevent issue with _io.so import.
16+
hostpython = self.get_recipe('hostpython2', self.ctx)
17+
env['PYTHONPATH'] = (
18+
join(hostpython.get_build_dir(arch.arch), 'build',
19+
'lib.linux-x86_64-2.7') + ':' + env.get('PYTHONPATH', '')
20+
)
21+
return env
22+
23+
24+
recipe = ZeroconfRecipe()

0 commit comments

Comments
 (0)
0