Skip to content

Commit a0838b6

Browse files
committed
Applied tito's fixes for python recipes installed via pip
1 parent bd38265 commit a0838b6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

pythonforandroid/build.py

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -509,14 +509,13 @@ def get_site_packages_dir(self, arch=None):
509509
'''Returns the location of site-packages in the python-install build
510510
dir.
511511
'''
512+
if self.python_recipe.name == 'python2':
513+
return join(self.get_python_install_dir(),
514+
'lib', 'python2.7', 'site-packages')
512515

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', 'site-packages')
516+
# Only python2 is a special case, other python recipes use the
517+
# python install dir
518+
return self.get_python_install_dir()
520519

521520
def get_libs_dir(self, arch):
522521
'''The libs dir for a given arch.'''
@@ -621,7 +620,9 @@ def run_pymodules_install(ctx, modules):
621620

622621
venv = sh.Command(ctx.virtualenv)
623622
with current_directory(join(ctx.build_dir)):
624-
shprint(venv, '--python=python2.7', 'venv')
623+
shprint(venv,
624+
'--python=python{}'.format(ctx.python_recipe.major_minor_version_string()),
625+
'venv')
625626

626627
info('Creating a requirements.txt file for the Python modules')
627628
with open('requirements.txt', 'w') as fileh:

pythonforandroid/recipes/android/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ class AndroidRecipe(IncludedFilesBehaviour, CythonRecipe):
1313

1414
src_filename = 'src'
1515

16-
depends = [('pygame', 'sdl2', 'genericndkbuild'), ('python2', 'python3crystax')]
16+
depends = [('pygame', 'sdl2', 'genericndkbuild'),
17+
('python2', 'python3crystax', 'python3')]
1718

1819
config_env = {}
1920

pythonforandroid/recipes/hostpython3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Hostpython3Recipe(Recipe):
1010
url = 'https://www.python.org/ftp/python/{version}/Python-{version}.tgz'
1111
name = 'hostpython3'
1212

13-
conflicts = ['hostpython2']
13+
conflicts = ['hostpython2', 'hostpython3crystax']
1414

1515
def get_build_container_dir(self, arch=None):
1616
choices = self.check_recipe_choices()

0 commit comments

Comments
 (0)