8000 Fixes ifaddrs recipe, closes #1398 · inclement/python-for-android@91a55aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 91a55aa

Browse files
committed
Fixes ifaddrs recipe, closes kivy#1398
- makes sure the compiler is being used rather than ccache alone - pin the commit version and use zip download rather than git clone - do not manually copy over lib and header files
1 parent adcc591 commit 91a55aa

File tree

2 files changed

+8
-26
lines changed

2 files changed

+8
-26
lines changed

ci/constants.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ class TargetPython(Enum):
2323
'flask',
2424
'groestlcoin_hash',
2525
'hostpython3crystax',
26-
# https://github.com/kivy/python-for-android/issues/1398
27-
'ifaddrs',
2826
# https://github.com/kivy/python-for-android/issues/1354
2927
'kivent_core', 'kivent_cymunk', 'kivent_particles', 'kivent_polygen',
3028
'kiwisolver',
@@ -68,8 +66,6 @@ class TargetPython(Enum):
6866
# enum34 is not compatible with Python 3.6 standard library
6967
# https://stackoverflow.com/a/45716067/185510
7068
'enum34',
71-
# https://github.com/kivy/python-for-android/issues/1398
72-
'ifaddrs',
7369
# https://github.com/kivy/python-for-android/issues/1399
7470
'libglob',
7571
# cannot find -lcrystax

pythonforandroid/recipes/ifaddrs/__init__.py

Lines changed: 8 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,14 @@
88

99

1010
class IFAddrRecipe(CompiledComponentsPythonRecipe):
11-
version = 'master'
12-
url = 'git+https://github.com/morristech/android-ifaddrs.git'
11+
version = '8f9a87c'
12+
url = 'https://github.com/morristech/android-ifaddrs/archive/{version}.zip'
1313
depends = [('hostpython2', 'hostpython3')]
1414

1515
call_hostpython_via_targetpython = False
1616
site_packages_name = 'ifaddrs'
1717
generated_libraries = ['libifaddrs.so']
1818

19-
def should_build(self, arch):
20-
"""It's faster to build than check"""
21-
return not (
22-
exists(join(self.ctx.libs_dir, arch.arch, 'libifaddrs.so'))
23-
and exists(join(self.ctx.get_python_install_dir(), 'lib' "libifaddrs.so")))
24-
2519
def prebuild_arch(self, arch):
2620
"""Make the build and target directories"""
2721
path = self.get_build_dir(arch.arch)
@@ -39,30 +33,22 @@ def build_arch(self, arch):
3933
if not exists(path):
4034
info("creating {}".format(path))
4135
shprint(sh.mkdir, '-p', path)
42-
cli = env['CC'].split()
43-
cc = sh.Command(cli[0])
36+
cli = env['CC'].split()[0]
37+
# makes sure first CC command is the compiler rather than ccache, refs:
38+
# https://github.com/kivy/python-for-android/issues/1398
39+
if 'ccache' in cli:
40+
cli = env['CC'].split()[1]
41+
cc = sh.Command(cli)
4442

4543
with current_directory(self.get_build_dir(arch.arch)):
4644
cflags = env['CFLAGS'].split()
4745
cflags.extend(['-I.', '-c', '-l.', 'ifaddrs.c', '-I.'])
4846
shprint(cc, *cflags, _env=env)
49-
5047
cflags = env['CFLAGS'].split()
5148
cflags.extend(['-shared', '-I.', 'ifaddrs.o', '-o', 'libifaddrs.so'])
5249
cflags.extend(env['LDFLAGS'].split())
5350
shprint(cc, *cflags, _env=env)
54-
5551
shprint(sh.cp, 'libifaddrs.so', self.ctx.get_libs_dir(arch.arch))
56-
shprint(sh.cp, "libifaddrs.so", join(self.ctx.get_python_install_dir(), 'lib'))
57-
# drop header in to the Python include directory
58-
python_version = self.ctx.python_recipe.version[0:3]
59-
shprint(sh.cp, "ifaddrs.h",
60-
join(
61-
self.ctx.get_python_install_dir(),
62-
'include/python{}'.format(python_version))
63-
)
64-
include_path = join(self.ctx.python_recipe.get_build_dir(arch.arch), 'Include')
65-
shprint(sh.cp, "ifaddrs.h", include_path)
6652

6753

6854
recipe = IFAddrRecipe()

0 commit comments

Comments
 (0)
0