Skip to content

Commit 1789778

Browse files
committed
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 #8016
1 parent 47c480b commit 1789778

File tree

9 files changed

+70
-13
lines changed

9 files changed

+70
-13
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/deterministic-build/requirements-build-android.txt

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,6 @@ ptyprocess==0.7.0 \
115115
pyparsing==3.0.7 \
116116
--hash=sha256:18ee9022775d270c55187733956460083db60b37d0d0fb357445f3094eed3eea \
117117
--hash=sha256:a6c06a88f252e6c322f65faf8f418b16213b51bdfaece0524c1c1bc30c63c484
118-
PyQt-builder==1.12.2 \
119-
--hash=sha256:48f754394d235307201ec2b5355934858741201af09433ff543ca40ae57b7865 \
120-
--hash=sha256:f62bb688d70e0afd88c413a8d994bda824e6cebd12b612902d1945c5a67edcd7
121118
pytoml==0.1.21 \
122119
--hash=sha256:57a21e6347049f73bfb62011ff34cd72774c031b9828cb628a752225136dfc33 \
123120
--hash=sha256:8eecf7c8d0adcff3b375b09fe403407aa9b645c499e5ab8cac670ac4a35f61e7
@@ -127,12 +124,6 @@ setuptools==61.3.1 \
127124
sh==1.14.2 \
128125
--hash=sha256:4921ac9c1a77ec8084bdfaf152fe14138e2b3557cc740002c1a97076321fce8a \
129126
--hash=sha256:9d7bd0334d494b2a4609fe521b2107438cdb21c0e469ffeeb191489883d6fe0d
130-
sip==6.5.1 \
131-
--hash=sha256:01a637b44c5918505801c3d56e1e010b8e86a4edee71c0bd8541c54387b57ae2 \
132-
--hash=sha256:13b09357615c2d8bcb23bf21c1637941ac8ff5f28b346c1ccad7efafa57673e9 \
133-
--hash=sha256:204f0240db8999a749d638a987b351861843e69239b811ec3d1881412c3706a6 \
134-
--hash=sha256:57e5ac40744c0f10a6c53dd45d2ef2c90e52f34a0210d8309e6563a07f914d0d \
135-
--hash=sha256:de1cb4004d75a3a236f82a69cd7a3e51ff76b414df412fea22bf433b28876e3f
136127
six==1.16.0 \
137128
--hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \
138129
--hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254

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)