8
8
9
9
10
10
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 '
13
13
depends = [('hostpython2' , 'hostpython3' )]
14
14
15
15
call_hostpython_via_targetpython = False
16
16
site_packages_name = 'ifaddrs'
17
17
generated_libraries = ['libifaddrs.so' ]
18
18
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
-
25
19
def prebuild_arch (self , arch ):
26
20
"""Make the build and target directories"""
27
21
path = self .get_build_dir (arch .arch )
@@ -39,30 +33,22 @@ def build_arch(self, arch):
39
33
if not exists (path ):
40
34
info ("creating {}" .format (path ))
41
35
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 )
44
42
45
43
with current_directory (self .get_build_dir (arch .arch )):
46
44
cflags = env ['CFLAGS' ].split ()
47
45
cflags .extend (['-I.' , '-c' , '-l.' , 'ifaddrs.c' , '-I.' ])
48
46
shprint (cc , * cflags , _env = env )
49
-
50
47
cflags = env ['CFLAGS' ].split ()
51
48
cflags .extend (['-shared' , '-I.' , 'ifaddrs.o' , '-o' , 'libifaddrs.so' ])
52
49
cflags .extend (env ['LDFLAGS' ].split ())
53
50
shprint (cc , * cflags , _env = env )
54
-
55
51
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 )
66
52
67
53
68
54
recipe = IFAddrRecipe ()
0 commit comments