Qt for Android (on salsa)

Fab Stz fabstz-it at yahoo.fr
Wed Sep 8 15:00:08 BST 2021


Hello,

I created a Debian source package to build Qt for Android.

You can find it here:

https://salsa.debian.org/bastif/qt-android

There are branches for all these versions:
- 5.11.*
- 5.12.*
- 5.15.*
- 6.1.*

There are various points to discuss about this.

- It requires both Android SDK and Android NDK.

- Android SDK is available through official Debian packages. It can be used up 
to Qt 5.12 but from Qt5.19 API requirement has increased and the version is 
Debian is not sufficient. Debian from stretch to buster ships with API 23. To 
build the qt-android package, the source package can use either the system SDK 
or one can specify the path to a user installed SDK.

- For Android NDK there is a package but it can't be used on build systems 
because its installation is interactive and during installation it downloads 
the package from a server (google or another). Moreover depending on the 
version of Qt, the version of NDK required is different, so this would mean 
having a few versions of NDK in debian (r10e, r20b at least). So to build the 
package, one has to specify the path to the NDK to the build tools.

- I tried to use the submodule packages from Qt like Debian does, but ended up 
using the single package. One of the reason is that it requires the code in 
3rdparty/sqlite which has been removed from qtbase in the dfsg version. It 
was also less hassle to build all modules at once with the single package.

- there might be licensing questions that I cannot address, as well as 
questions on how to make the whole package Debian compliant (what to remove/
keep from sources). I left the automatically generated copyright file as is. 
Any help is welcome here.

- I was also wondering whether "-android-style-assets" configure option can/
should be enabled/disabled. That what it does:
	Automatically extract style assets from the device at
	run time. This option makes the Android style behave
	correctly, but also makes the Android platform plugin
	incompatible with the LGPL2.1. [yes]

- I suggest to have a few versions available at the same time. The name of the 
binary packages would contain the Qt Major & Minor version. For example:
  * qt-android-5.11
  * qt-android-5.12 
  * qt-android-5.15
  * qt-android-6.1

The reasons:
1. With Qt 5.14, android developers had to update their AndroidManifest.xml. 
This update is not compatible with previous versions of Qt, so they have to 
use Qt 5.14 or above. If they didn't change it, they have to use Qt 5.13 or 
below.
2. 5.11 uses NDK r10e which supports older platforms arm5, mips & mips64 
(older versions of Qt cannot build for these ABI)
3. 5.12 & 5.15 are LTS (one supporting old style AndroidManifest, and the 
other the new style)
4. version 6 is to be ready for future

- There are individual binary packages for each ABI (except for Qt 5.15 which 
can handle multi-ABI) and everything is installed to a folder named /usr/lib/
qt-android-$VERSION-$ABI . This folder contains all the installation, ie.
bin, lib, include, doc...

- These packages might be useful for F-Droid project

- Whether this should be merged into the regular qt debian package, or stay 
apart, I don't know.

Any comment/advice is welcome.

Fab





More information about the pkg-kde-talk mailing list