diff --git a/pythonforandroid/recipe.py b/pythonforandroid/recipe.py index 3cf8f9b..71fea95 100644 --- a/pythonforandroid/recipe.py +++ b/pythonforandroid/recipe.py @@ -825,7 +826,7 @@ class PythonRecipe(Recipe): # for filen in built_files: # shprint(sh.cp, '-r', filen, join(site_packages_dir, split(filen)[-1])) elif self.call_hostpython_via_targetpython: - shprint(hostpython, 'setup.py', 'install', '-O2', _env=env, + shprint(hostpython,'-s', 'setup.py', 'install', '-O2', _env=env, ##KRL: Added -s here, as tipped on github by @antocuni. It does make things compile, but on running any binary on an Android VM we get an error on importing anything in _io.so (has unexpected e_machine: 40). *self.setup_extra_args) else: hppath = join(dirname(self.hostpython_location), 'Lib', @@ -836,7 +837,7 @@ class PythonRecipe(Recipe): hpenv['PYTHONPATH'].split(':')) else: hpenv['PYTHONPATH'] = hppath - shprint(hostpython, 'setup.py', 'install', '-O2', + shprint(hostpython, '-s', 'setup.py', 'install', '-O2', '--root={}'.format(self.ctx.get_python_install_dir()), '--install-lib=lib/python2.7/site-packages', _env=hpenv, *self.setup_extra_args) @@ -854,7 +855,7 @@ class PythonRecipe(Recipe): def install_hostpython_package(self, arch): env = self.get_hostrecipe_env(arch) real_hostpython = sh.Command(self.real_hostpython_location) - shprint(real_hostpython, 'setup.py', 'install', '-O2', + shprint(real_hostpython,'-s', 'setup.py', 'install', '-O2', '--root={}'.format(dirname(self.real_hostpython_location)), '--install-lib=Lib/site-packages', _env=env, *self.setup_extra_args) @@ -993,15 +996,20 @@ class CythonRecipe(PythonRecipe): if manually_cythonise: self.cythonize_build(env=env) - shprint(hostpython, 'setup.py', 'build_ext', '-v', _env=env, + shprint(hostpython, 'setup.py', 'sdist','-v', _env=env, _tail=20, _critical=True, *self.setup_extra_args) else: info('First build appeared to complete correctly, skipping manual' 'cythonising.') print('stripping') build_lib = glob.glob('./build/lib*') - shprint(sh.find, build_lib[0], '-name', '*.o', '-exec', + info("build_lib={}".format(build_lib)) + if len(build_lib)>0: + shprint(sh.find, build_lib[0], '-name', '*.o', '-exec', env['STRIP'], '{}', ';', _env=env) print('stripped!?')