Skip to content

Commit

Permalink
Merge pull request #1269 from xloem/p4a_commit
Browse files Browse the repository at this point in the history
Let buildozer.spec files pin to a specific p4a commit hash
  • Loading branch information
akshayaurora authored Aug 17, 2021
2 parents 2464434 + cd380cc commit 593319c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions buildozer/default.spec
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,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 @@ -61,6 +61,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 @@ -693,6 +694,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 @@ -743,6 +747,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

0 comments on commit 593319c

Please sign in to comment.