Skip to content

Commit ef3ce72

Browse files
committed
[Workaround] Use /host/ python
1 parent 48addf2 commit ef3ce72

1 file changed

Lines changed: 16 additions & 3 deletions

File tree

pythonforandroid/build.py

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,19 @@ def get_site_packages_dir(self, arch=None):
505505
return join(self.get_python_install_dir(),
506506
'lib', 'python2.7', 'site-packages')
507507

508+
def get_packages_dir(self, arch=None):
509+
'''Returns the location of python lib in the python-install build
510+
dir.
511+
'''
512+
513+
# This needs to be replaced with something more general in
514+
# order to support multiple python versions and/or multiple
515+
# archs.
516+
if self.python_recipe.from_crystax:
517+
return self.get_python_install_dir()
518+
return join(self.get_python_install_dir(),
519+
'lib', 'python2.7')
520+
508521
def get_libs_dir(self, arch):
509522
'''The libs dir for a given arch.'''
510523
ensure_dir(join(self.libs_dir, arch))
@@ -608,7 +621,7 @@ def run_pymodules_install(ctx, modules):
608621

609622
venv = sh.Command(ctx.virtualenv)
610623
with current_directory(join(ctx.build_dir)):
611-
shprint(venv, '--python=python2.7', 'venv')
624+
shprint(venv, '--python=/usr/bin/python2.7', 'venv')
612625

613626
info('Creating a requirements.txt file for the Python modules')
614627
with open('requirements.txt', 'w') as fileh:
@@ -629,8 +642,8 @@ def run_pymodules_install(ctx, modules):
629642
# It works but should be replaced with something better
630643
shprint(sh.bash, '-c', (
631644
"source venv/bin/activate && env CC=/bin/false CXX=/bin/false "
632-
"PYTHONPATH={0} pip install --target '{0}' --no-deps -r requirements.txt"
633-
).format(ctx.get_site_packages_dir()))
645+
"pip install --target '{0}' --no-deps -r requirements.txt"
646+
).format(ctx.get_site_packages_dir(), ctx.get_packages_dir()))
634647

635648

636649
def biglink(ctx, arch):

0 commit comments

Comments
 (0)