Skip to content

Made hostpython3crystax check if system python is available #1289

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions pythonforandroid/recipes/hostpython3crystax/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@


class Hostpython3Recipe(Recipe):
version = '3.5'
# url = 'http://python.org/ftp/python/{version}/Python-{version}.tgz'
# url = 'https://github.com/crystax/android-vendor-python-3-5/archive/master.zip'
version = 'auto' # the version is taken from the python3crystax recipe
name = 'hostpython3crystax'

conflicts = ['hostpython2']
Expand Down Expand Up @@ -36,6 +34,10 @@ def build_arch(self, arch):
shprint(sh.mkdir, '-p', sub_build_dir)
python3crystax = self.get_recipe('python3crystax', self.ctx)
system_python = sh.which("python" + python3crystax.version)
if system_python is None:
raise OSError(
('Trying to use python3crystax=={} but this Python version '
'is not installed locally.').format(python3crystax.version))
link_dest = join(self.get_build_dir(), 'hostpython')
shprint(sh.ln, '-sf', system_python, link_dest)

Expand Down