1- from pythonforandroid .toolchain import Bootstrap , shprint , current_directory , info , warning , ArchAndroid , logger , info_main , which
1+ from pythonforandroid .toolchain import Bootstrap , shprint , current_directory , info , warning , ArchAndroid , info_main
22from os .path import join , exists
33from os import walk
44import glob
@@ -19,6 +19,9 @@ def run_distribute(self):
1919 # self.name)
2020 src_path = join (self .bootstrap_dir , 'build' )
2121
22+ # AND: Hardcoding armeabi - naughty!
23+ arch = ArchAndroid (self .ctx )
24+
2225 with current_directory (self .dist_dir ):
2326
2427 info ('Creating initial layout' )
@@ -40,21 +43,14 @@ def run_distribute(self):
4043 info ('Copying python distribution' )
4144 hostpython = sh .Command (self .ctx .hostpython )
4245 # AND: This *doesn't* need to be in arm env?
43- shprint (hostpython , '-OO' , '-m' , 'compileall' , self .ctx .get_python_install_dir ())
46+ shprint (hostpython , '-OO' , '-m' , 'compileall' , self .ctx .get_python_install_dir (),
47+ _tail = 10 , _filterout = "^Listing" , _critical = True )
4448 if not exists ('python-install' ):
4549 shprint (sh .cp , '-a' , self .ctx .get_python_install_dir (), './python-install' )
4650
47- info ('Copying libs' )
48- # AND: Hardcoding armeabi - naughty!
49- shprint (sh .mkdir , '-p' , join ('libs' , 'armeabi' ))
50- for lib in glob .glob (join (self .build_dir , 'libs' , 'armeabi' , '*' )):
51- shprint (sh .cp , '-a' , lib , join ('libs' , 'armeabi' ))
52- for lib in glob .glob (join (self .ctx .get_libs_dir ('armeabi' ), '*' )):
53- shprint (sh .cp , '-a' , lib , join ('libs' , 'armeabi' ))
54-
55- info ('Copying java files' )
56- for filename in glob .glob (self .ctx .javaclass_dir ):
57- shprint (sh .cp , '-a' , filename , 'src' )
51+ self .distribute_libs (arch , [join (self .build_dir , 'libs' , arch .arch ), self .ctx .get_libs_dir (arch .arch )]);
52+ self .distribute_aars (arch )
53+ self .distribute_javaclasses (self .ctx .javaclass_dir )
5854
5955 info ('Filling private directory' )
6056 if not exists (join ('private' , 'lib' )):
@@ -91,21 +87,7 @@ def run_distribute(self):
9187 shprint (sh .rm , '-rf' , 'lib-dynload/_testcapi.so' )
9288
9389
94- info ('Stripping libraries' )
95- env = ArchAndroid (self .ctx ).get_env ()
96- strip = which ('arm-linux-androideabi-strip' , env ['PATH' ])
97- if strip is None :
98- warning ('Can\' t find strip in PATH...' )
99- strip = sh .Command (strip )
100- filens = shprint (sh .find , join (self .dist_dir , 'private' ), join (self .dist_dir , 'libs' ),
101- '-iname' , '*.so' , _env = env ).stdout .decode ('utf-8' )
102- logger .info ('Stripping libraries in private dir' )
103- for filen in filens .split ('\n ' ):
104- try :
105- strip (filen , _env = env )
106- except sh .ErrorReturnCode_1 :
107- logger .debug ('Failed to strip ' + 'filen' )
108-
90+ self .strip_libraries (arch )
10991 super (PygameBootstrap , self ).run_distribute ()
11092
11193bootstrap = PygameBootstrap ()
0 commit comments