@@ -517,16 +517,18 @@ The NDK needs to be [downloaded separately](https://developer.android.com/ndk/do
517517<summary >Install Qt</summary >
518518
519519The easiest way to install Qt is via the official [ Qt installer] ( https://www.qt.io/download-qt-installer-oss ) .
520- The open source version is sufficient but a Qt account is required.
520+ The open source version is sufficient but a Qt account is required. Alternatively, you can also skip the this
521+ step and install Qt like the other additional libraries as mentioned in the next section.
521522</details >
522523
523524<details >
524525<summary >Install additional native libraries for Android</summary >
525526
526527Additional libraries can be installed via MSYS2 using my Arch Linux packaging. Note that this is not generally
527- required to build Syncthing Tray as use of libiconv, Boost, OpenSSL and CppUnit is optional (so only Qt is
528- required besides the C/C++ standard libraries). However, the following instructions and the CMake preset make
529- use of MSYS2 and the ` android-cmake ` package. The OpenSSL package is also very likely wanted for TLS support.
528+ required to build Syncthing Tray as use of libiconv, Boost, OpenSSL, CppUnit and system SQLite3 is optional (so
529+ only Qt is required besides the C/C++ standard libraries). However, the following instructions and the CMake
530+ preset make use of MSYS2 and the ` android-cmake ` package. The OpenSSL package is also very likely wanted for TLS
531+ support.
530532
531533To install additional libraries via MSYS2, add my Arch Linux repository to
532534` /etc/pacman.conf ` :
@@ -542,7 +544,7 @@ After following [instructions for importing my GPG key](https://martchus.dyn.f3l
542544can install Android packages, e.g.:
543545
544546```
545- pacman -Syu android-cmake android-{x86-64,aarch64}-{boost,libiconv,openssl,cppunit} \
547+ pacman -Syu android-cmake android-{x86-64,aarch64}-{boost,libiconv,openssl,cppunit,sqlite } \
546548 --assume-installed android-ndk --assume-installed android-sdk
547549````
548550
@@ -551,19 +553,26 @@ You may even install a few KDE libraries like Kirigami:
551553pacman -S android-{aarch64,x86-64}-kirigami --assume-installed=android-{aarch64,x86-64}-qt6-{base,declarative,shadertools,svg,5compat}
552554```
553555
554- Whether this will actually work at runtime hasn't been tested yet. One definitely has to make sure that the
555- used version of Qt is at least as new as the version the KDE libraries from my repo have been linked against.
556+ You may also install Qt itself from my repo instead of relying on official Qt builds:
557+ ```
558+ pacman -S --assume-installed={ant,java-runtime-headless-openjdk=17} --assume-installed=android-{ndk,sdk,sdk-build-tools,sdk-platform-tools,platform-35} android-x86-64-qt6-declarative android-x86-64-qt6-tools android-x86-64-qt6-svg android-x86-64-qt6-translations
559+ ```
560+
561+ Note that when using Qt for Android from my repo you also need to install a matching version of Qt for
562+ Windows from MSYS2 mingw-w64 repos for host tooling.
563+
564+ When just using KDE libraries from my repo but Qt from the official installer you need to make sure that
565+ the installed version of Qt is at least as new as the version the KDE libraries from my repo have been
566+ linked against.
556567
557568The libraries will end up under `/opt/android-libs` within your MSYS2 installation. Do not install any non
558569`android-*-` packages, though. They will have file conflicts with packages provided by MSYS2 and are not usable
559570under Windows anyway.
560571
561- The Qt packages for Android cannot be used as well because they rely on the Qt packaging provided by Arch Linux
562- for tooling. (Maybe the Qt packages provided by MSYS2 mingw-w64 packages could be used for tooling. This hasn't
563- been tested yet, though.)
564-
565572To search for available Android packages on my repo per architecture one can use e.g.
566573`pacman -Ss android-aarch64-`.
574+
575+ Whether builds using any of these libraries will actually work at runtime hasn't been tested yet.
567576</details>
568577
569578<details>
@@ -573,9 +582,11 @@ Set the following environment variables:
573582
574583* `ANDROID_HOME`: path to the Android SDK
575584* `ANDROID_NDK_HOME`: path to the Android NDK
585+ * `ANDROID_TOOLCHAIN`: path to the Android toolchain (part of the Android NDK)
586+ * `ANDROID_MINIMUM_PLATFORM=24`: set minimum platform to Android 7.0 in-line with packages from my Arch repo
576587* `ANDROID_STUDIO_HOME`: Android studio install directory (for adding Java to `PATH` and setting `JAVA_HOME`)
577588* `QT_PLATFORMS_ROOT`: directory containing Qt platform directories installed via the official Qt installer,
578- e.g. `D:/programming/qt/6.8 .0`
589+ e.g. `D:/programming/qt/6.10 .0` (not required when installing Qt for Android via my Arch repo)
579590* `QT_ANDROID_ARCH`: `x86_64`/`arm64_v8a`/`armv7`/`x86`
580591* `QT_ANDROID_KEYSTORE_PATH`: path of directory containing Android keystores
581592* `QT_ANDROID_KEYSTORE_ALIAS`: name of Android keystore to use
@@ -587,8 +598,9 @@ Then the build can be conducted in a MSYS2 shell, e.g.:
587598
588599```
589600source android-env x86-64 # or aarch64
590- cmake --preset win-android
591- cmake --build --preset win-android
601+ cmake --preset win-android # to use everything from MSYS2
602+ cmake --preset win-android-official-qt # to use Qt from QT_PLATFORMS_ROOT
603+ cmake --build --preset win-android # or win-android-official-qt
592604```
593605</details>
594606
0 commit comments