Skip to content

Commit c3736ee

Browse files
committed
Added install_in_hostpython for PythonRecipes
1 parent e4d35d4 commit c3736ee

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pythonforandroid/toolchain.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1908,6 +1908,12 @@ class PythonRecipe(Recipe):
19081908
the right place via arguments to setup.py. However, this may not set
19091909
the environment correctly and so False is not the default.'''
19101910

1911+
install_in_hostpython = False
1912+
'''If True, additionally installs the module in the hostpython build
1913+
dir. This will make it available to other recipes if
1914+
call_hostpython_via_targetpython is False.
1915+
'''
1916+
19111917
@property
19121918
def hostpython_location(self):
19131919
if not self.call_hostpython_via_targetpython:
@@ -1963,6 +1969,13 @@ def install_python_package(self, name=None, env=None, is_dir=True):
19631969
'--install-lib=lib/python2.7/site-packages',
19641970
_env=env) # AND: Hardcoded python2.7 needs fixing
19651971

1972+
# If asked, also install in the hostpython build dir
1973+
if self.install_in_hostpython:
1974+
shprint(hostpython, 'setup.py', 'install', '-O2',
1975+
'--root={}'.format(dirname(self.hostpython_location)),
1976+
'--install-lib=Lib/site-packages',
1977+
_env=env)
1978+
19661979

19671980
class CompiledComponentsPythonRecipe(PythonRecipe):
19681981
pre_build_ext = False

0 commit comments

Comments
 (0)