88
99
1010class 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
6854recipe = IFAddrRecipe ()
0 commit comments