Skip to content

Commit 16c6448

Browse files
SomberNightDavid Reband
authored andcommitted
android build: p4a to build pyqt5 using "hostpython" instead of sys py
The current system python in the docker baseimage is py3.9, while the targetpython and hostpython built by p4a are py3.8, and this was causing linker issues in the pyqt5 build. It is also cleaner IMHO to have p4a handle what is needed for a recipe instead of assuming it is available in the system. (and I think this is how other existing recipes work) fixes spesmilo/electrum#8016
1 parent c1e48f1 commit 16c6448

File tree

8 files changed

+70
-4
lines changed

8 files changed

+70
-4
lines changed

contrib/android/Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,11 @@ RUN cd /opt \
176176
&& git remote add sombernight https://github.com/SomberNight/python-for-android \
177177
&& git remote add accumulator https://github.com/accumulator/python-for-android \
178178
&& git fetch --all \
179-
# commit: from branch sombernight/qt5-wip
180-
&& git checkout "c6e39ae1fb4eb8d547eb70b26b89beda7e6ff4b6^{commit}" \
179+
# commit: from branch sombernight/electrum_20210421d
180+
&& git checkout "4535a333f9928e894caedefc4f746f9c6a0dc50f^{commit}" \
181181
&& python3 -m pip install --no-build-isolation --no-dependencies --user -e .
182182

183183
# build env vars
184184
ENV USE_SDK_WRAPPER=1
185185
ENV GRADLE_OPTS="-Xmx1536M -Dorg.gradle.jvmargs='-Xmx1536M'"
186+
#ENV P4A_FULL_DEBUG=1
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pythonforandroid.recipes.packaging import PackagingRecipe
2+
3+
4+
assert PackagingRecipe._version == "21.3"
5+
assert PackagingRecipe.depends == ["setuptools", "pyparsing", "python3"]
6+
assert PackagingRecipe.python_depends == []
7+
8+
9+
class PackagingRecipePinned(PackagingRecipe):
10+
sha512sum = "2e3aa276a4229ac7dc0654d586799473ced9761a83aa4159660d37ae1a2a8f30e987248dd0e260e2834106b589f259a57ce9936eef0dcc3c430a99ac6b663e05"
11+
12+
13+
recipe = PackagingRecipePinned()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pythonforandroid.recipes.pyparsing import PyparsingRecipe
2+
3+
4+
assert PyparsingRecipe._version == "3.0.7"
5+
assert PyparsingRecipe.depends == ["setuptools", "python3"]
6+
assert PyparsingRecipe.python_depends == []
7+
8+
9+
class PyparsingRecipePinned(PyparsingRecipe):
10+
sha512sum = "1e692f4cdaa6b6e8ca2729d0a3e2ba16d978f1957c538b6de3a4220ec7d996bdbe87c41c43abab851fffa3b0498a05841373e435602917b8c095042e273badb5"
11+
12+
13+
recipe = PyparsingRecipePinned()

contrib/android/p4a_recipes/pyqt5/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88

99
assert PyQt5Recipe._version == "5.15.6"
10-
assert PyQt5Recipe.depends == ['qt5', 'pyjnius', 'setuptools', 'pyqt5sip']
10+
assert PyQt5Recipe.depends == ['qt5', 'pyjnius', 'setuptools', 'pyqt5sip', 'hostpython3', 'pyqt_builder']
1111
assert PyQt5Recipe.python_depends == []
1212

1313

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pythonforandroid.recipes.pyqt_builder import PyQtBuilderRecipe
2+
3+
4+
assert PyQtBuilderRecipe._version == "1.12.2"
5+
assert PyQtBuilderRecipe.depends == ["sip", "packaging", "python3"]
6+
assert PyQtBuilderRecipe.python_depends == []
7+
8+
9+
class PyQtBuilderRecipePinned(PyQtBuilderRecipe):
10+
sha512sum = "022f2cd40c100543c4b442fc5b27bbf2ec853d94b531f8f6dc1d7f92b07bcc20e8f0a4eb64feb96d094ba0d5f01fddcc8aed23ddf67a61417e07983a73918230"
11+
12+
13+
recipe = PyQtBuilderRecipePinned()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pythonforandroid.recipes.sip import SipRecipe
2+
3+
4+
assert SipRecipe._version == "6.5.1"
5+
assert SipRecipe.depends == ["setuptools", "packaging", "toml", "python3"]
6+
assert SipRecipe.python_depends == []
7+
8+
9+
class SipRecipePinned(SipRecipe):
10+
sha512sum = "2d6f225e653873462d97dfdc85bd308a26b66996e1bb98e2c3aa60a3b260db745021f1d3182db8e943fd216ee27a2f65731b96d287e94f8f2e7972c5df971c69"
11+
12+
13+
recipe = SipRecipePinned()
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
from pythonforandroid.recipes.toml import TomlRecipe
2+
3+
4+
assert TomlRecipe._version == "0.10.2"
5+
assert TomlRecipe.depends == ["setuptools", "python3"]
6+
assert TomlRecipe.python_depends == []
7+
8+
9+
class TomlRecipePinned(TomlRecipe):
10+
sha512sum = "ede2c8fed610a3827dba828f6e7ab7a8dbd5745e8ef7c0cd955219afdc83b9caea714deee09e853627f05ad1c525dc60426a6e9e16f58758aa028cb4d3db4b39"
11+
12+
13+
recipe = TomlRecipePinned()

contrib/requirements/requirements-build-android.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ pep517<0.7.0
1818
toml
1919

2020
# needed for the Qt/QML Android GUI:
21-
PyQt-builder
21+
# TODO double-check this
2222
typing-extensions

0 commit comments

Comments
 (0)