From d1de29513f24b0eb35ffb4dc64c8cafbb2babdbb Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 2 Oct 2024 17:27:17 +0000 Subject: [PATCH] android build: use spesmilo/ fork of p4a and buildozer - fdroid maintainers asked that releases use fixed forks of p4a and buildozer, so now we use the newly created forks in the spesmilo org. I plan to keep using my existing contributor-specific repos for development, but whatever we push to electrum master, should use the new spesmilo/ forks. see https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15858#note_2136345746 - Also, I added branch protection rules for branches named "electrum_*", so if we name the branches that are actually used in releases as such, we won't accidentally force-push them. (ref https://github.com/spesmilo/electrum/issues/8162) I think we can just create a new branch whenever we would want to force-push the existing one. - also factored out some parameters so that it is easier to programmatically access them from the fdroid build script. see https://gitlab.com/fdroid/fdroiddata/-/merge_requests/15858#note_2136094409 --- contrib/android/Dockerfile | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/contrib/android/Dockerfile b/contrib/android/Dockerfile index c2fc14e88..604a1c3c3 100644 --- a/contrib/android/Dockerfile +++ b/contrib/android/Dockerfile @@ -81,10 +81,11 @@ RUN apt -y update -qq \ RUN yes | ${ANDROID_SDK_MANAGER} --licenses > /dev/null +ENV ANDROID_SDK_BUILD_TOOLS_MAJOR_V="31" ENV ANDROID_SDK_BUILD_TOOLS_VERSION="31.0.0" # download platforms, API, build tools -RUN ${ANDROID_SDK_MANAGER} "platforms;android-31" > /dev/null && \ +RUN ${ANDROID_SDK_MANAGER} "platforms;android-${ANDROID_SDK_BUILD_TOOLS_MAJOR_V}" > /dev/null && \ ${ANDROID_SDK_MANAGER} "build-tools;${ANDROID_SDK_BUILD_TOOLS_VERSION}" > /dev/null && \ ${ANDROID_SDK_MANAGER} "extras;android;m2repository" > /dev/null && \ chmod +x "${ANDROID_SDK_HOME}/cmdline-tools/bin/avdmanager" @@ -180,25 +181,21 @@ RUN /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -r /opt/deterministic-build/requirements-build-android.txt # install buildozer +ENV BUILDOZER_CHECKOUT_COMMIT="4403ecf445f10b5fbf7c74f4621bf2b922ad35b5" +# ^ from branch electrum_20240930 (note: careful with force-pushing! see #8162) RUN cd /opt \ - && git clone https://github.com/kivy/buildozer \ + && git clone https://github.com/spesmilo/buildozer \ && cd buildozer \ - && git remote add sombernight https://github.com/SomberNight/buildozer \ - && git remote add accumulator https://github.com/accumulator/buildozer \ - && git fetch --all \ - # commit: from branch electrum-qt6 (note: careful with force-pushing! see #8162) \ - && git checkout "4403ecf445f10b5fbf7c74f4621bf2b922ad35b5^{commit}" \ + && git checkout "${BUILDOZER_CHECKOUT_COMMIT}^{commit}" \ && /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e . # install python-for-android +ENV P4A_CHECKOUT_COMMIT="7197c1c28409fbeebd8494093349a2bfd770526a" +# ^ from branch electrum_20240930 (note: careful with force-pushing! see #8162) RUN cd /opt \ - && git clone https://github.com/kivy/python-for-android \ + && git clone https://github.com/spesmilo/python-for-android \ && cd python-for-android \ - && git remote add sombernight https://github.com/SomberNight/python-for-android \ - && git remote add accumulator https://github.com/accumulator/python-for-android \ - && git fetch --all \ - # commit: from branch sombernight/electrum_20240930 (note: careful with force-pushing! see #8162) \ - && git checkout "7197c1c28409fbeebd8494093349a2bfd770526a^{commit}" \ + && git checkout "${P4A_CHECKOUT_COMMIT}^{commit}" \ && /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e . # build env vars