11from os .path import (join , dirname , isdir , normpath , splitext , basename )
22from os import listdir , walk , sep
33import sh
4+ import shlex
45import glob
56import importlib
67import os
910from pythonforandroid .logger import (warning , shprint , info , logger ,
1011 debug )
1112from pythonforandroid .util import (current_directory , ensure_dir ,
12- temp_directory , which )
13+ temp_directory )
1314from pythonforandroid .recipe import Recipe
1415
1516
@@ -263,11 +264,10 @@ def strip_libraries(self, arch):
263264 info ('Python was loaded from CrystaX, skipping strip' )
264265 return
265266 env = arch .get_env ()
266- strip = which ('arm-linux-androideabi-strip' , env ['PATH' ])
267- if strip is None :
268- warning ('Can\' t find strip in PATH...' )
269- return
270- strip = sh .Command (strip )
267+ tokens = shlex .split (env ['STRIP' ])
268+ strip = sh .Command (tokens [0 ])
269+ if len (tokens ) > 1 :
270+ strip = strip .bake (tokens [1 :])
271271
272272 libs_dir = join (self .dist_dir , '_python_bundle' ,
273273 '_python_bundle' , 'modules' )
@@ -278,6 +278,8 @@ def strip_libraries(self, arch):
278278
279279 logger .info ('Stripping libraries in private dir' )
280280 for filen in filens .split ('\n ' ):
281+ if not filen :
282+ continue # skip the last ''
281283 try :
282284 strip (filen , _env = env )
283285 except sh .ErrorReturnCode_1 :
0 commit comments