1- from pythonforandroid .toolchain import Bootstrap , shprint , current_directory , info , warning , ArchAndroid , info_main
1+ from pythonforandroid .toolchain import Bootstrap , shprint , current_directory , info , warning , ArchARM , info_main
22from os .path import join , exists
33from os import walk
44import glob
@@ -20,8 +20,10 @@ def run_distribute(self):
2020 with open ('local.properties' , 'w' ) as fileh :
2121 fileh .write ('sdk.dir={}' .format (self .ctx .sdk_dir ))
2222
23- # AND: Hardcoding armeabi - naughty!
24- arch = ArchAndroid (self .ctx )
23+ arch = self .ctx .archs [0 ]
24+ if len (self .ctx .archs ) > 1 :
25+ raise ValueError ('built for more than one arch, but bootstrap cannot handle that yet' )
26+ info ('Bootstrap running with arch {}' .format (arch ))
2527
2628 with current_directory (self .dist_dir ):
2729 info ('Copying python distribution' )
@@ -32,7 +34,6 @@ def run_distribute(self):
3234 shprint (sh .mkdir , 'assets' )
3335
3436 hostpython = sh .Command (self .ctx .hostpython )
35- # AND: This *doesn't* need to be in arm env?
3637 shprint (hostpython , '-OO' , '-m' , 'compileall' ,
3738 self .ctx .get_python_install_dir (),
3839 _tail = 10 , _filterout = "^Listing" , _critical = True )
@@ -50,8 +51,8 @@ def run_distribute(self):
5051 shprint (sh .mkdir , '-p' , join ('private' , 'include' , 'python2.7' ))
5152
5253 # AND: Copylibs stuff should go here
53- if exists (join ('libs' , 'armeabi' , 'libpymodules.so' )):
54- shprint (sh .mv , join ('libs' , 'armeabi' , 'libpymodules.so' ), 'private/' )
54+ if exists (join ('libs' , arch . arch , 'libpymodules.so' )):
55+ shprint (sh .mv , join ('libs' , arch . arch , 'libpymodules.so' ), 'private/' )
5556 shprint (sh .cp , join ('python-install' , 'include' , 'python2.7' , 'pyconfig.h' ), join ('private' , 'include' , 'python2.7/' ))
5657
5758 info ('Removing some unwanted files' )
0 commit comments