Skip to content
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

Let buildozer.spec files pin to a specific p4a commit hash #1269

Merged
merged 1 commit into from
Aug 17, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ android.allow_backup = True
# (str) python-for-android branch to use, defaults to master
#p4a.branch = master

# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch
#p4a.commit = HEAD

# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github)
#p4a.source_dir =

Expand Down
6 changes: 6 additions & 0 deletions buildozer/targets/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class TargetAndroid(Target):
p4a_directory_name = "python-for-android"
p4a_fork = 'kivy'
p4a_branch = 'master'
p4a_commit = 'HEAD'
p4a_apk_cmd = "apk --debug --bootstrap="
p4a_recommended_ndk_version = None
extra_p4a_args = ''
Expand Down Expand Up @@ -691,6 +692,9 @@ def _install_p4a(self):
p4a_branch = self.buildozer.config.getdefault(
'app', 'p4a.branch', self.p4a_branch
)
p4a_commit = self.buildozer.config.getdefault(
'app', 'p4a.commit', self.p4a_commit
)

p4a_dir = self.p4a_dir
system_p4a_dir = self.buildozer.config.getdefault('app',
Expand Down Expand Up @@ -744,6 +748,8 @@ def _install_p4a(self):
cmd('git fetch --tags origin {0}:{0}'.format(p4a_branch),
cwd=p4a_dir)
cmd('git checkout {}'.format(p4a_branch), cwd=p4a_dir)
if p4a_commit != 'HEAD':
cmd('git reset --hard {}'.format(p4a_commit), cwd=p4a_dir)

# also install dependencies (currently, only setup.py knows about it)
# let's extract them.
Expand Down