Packaging Qt Apps

Hello,

From what I read and understand, currently F-Droid cannot package apps written with QT.

This seems to be because on F-Droid the policy is that everything should be compiled from source. Pre-built Qt binaries - #4 by relan

I read that some people have been trying to do something on that. Does anyone know what the progress is on this? What kind of problems (technical or not) have been faced?

Since f-droid runs on debian:

  • would a debian package containing “Qt for Android” compiled from the sources of the QT version shipped in Debian be a solution?
  • would the f-droid system be able to compile these Qt apps if these packages are installed on the buildserver?

Thanks

We can. But the recipes are verbose and it seems there is not a standard procedure.

If Qt for Androod is packaged in debian it will be much easier.

Thanks for your reply.

Could you link me a few packages built by f-droid and with Qt so that I can have a look at the metadata ?

I’m trying to build a package for debian buster based on qt 5.15.2 sources from bullseye, SDK 29, NDK 20b. I’m curious to see where this will bring us.

Which version of debian are you running on the build system? Is it buster?

You can search in the repo.

Interesting. Acutally Krita doesn’t use the androiddeployqt provided by Qt.

Is there any app on f-droid using that ?

For now, I was able to build a qt4android debian package based on qtbase 5.15.2

Moreover, with that, it seems building an APK would be as easy as running this as documented here:

mkdir build-project
cd build-project
/opt/qt4android-5.15.2/bin/qmake ../project-sources-root/project.pro
make -j$(nproc)
make -j$(nproc) apk_install_target
/opt/qt4android-5.15.2/bin/androiddeployqt --input $BUILD_DIR/android-project-deployment-settings.json --output $ANDROID_BUILD_DIR --android-platform android-29 --jdk /usr/lib/jvm/java-8-openjdk-amd64 --gradle

Which version of debian is running on the f-droid build system? Is it buster ?

Just search qtbase https://gitlab.com/search?project_id=36528&search=qtbase.

We are on stretch and will switch to bulleye.

We need to build Qt anyway, right? Maybe that’s why…

I should soon have packages for QT 5.12.11 based on Qt’s original sources. I built them for stretch since the build system runs on stretch.

I can publish the material (.dsc & .debian.tar.xz) so that they can be built easily with sbuild or dpkg-buildpackage.

For Qt 5.12.11 there will be 4 binary packages (.deb), one for each arch. They will install to /usr/lib/qt4android-5.12-$abi. This is because we can only compile one arch at a time.

For Qt 5.15 there will be only 1 package containing all ABIs since it can build all of them simultaneously

I would suggest you use both 5.12.11 (because LTS) and 5.15.2 (latest 5.* version) because with Qt 5.14 apps had to modify their AndroidManifest.xml to comply with the new version, so at least both would be necessary. That way apps can use the version that suits them.

Would it be possible to install these packages to a test system and see how it behaves? I also prepared a yml file of a package to test the use of androiddeployqt

For Qt5.15 it creates multiarch APK (or even AAB)
For Qt5.12 only single arch APK can be built at a time (there is no AAB support)

Do open a MR if you have a testcase yes, thanks

Where? Which project? What should I put inside? (dsc & debian.tar.xz) or the binary package (.deb) or both ?

For 5.12, A single arch binary package is ~40MB for 5.12
For 5.15, the multiarch package is ~100-110 MB for 5.15

I have a few questions to properly configure the package.

  • What is the path of Android SDK & NDK (r20b) on the fdroid build system?

  • the ./configure script has this parameter

-android-style-assets 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]

Should it be enabled or disabled ?

  • ./configure script has parameter -android-ndk-platform. Its value is one of the folder names in “$ANDROID_NDK_ROOT/platform/”

For NDK 20b (minimal version to use for qt 5.12) possible values are android-16, android-17… android-29

If this parameter is not set, it will take android-16 for 32bits archs and android-21 pour 64bits archs.

Is there any good value for this parameter (the default, the highest)? Should there be a qt4android version for each ndk-platform or is it sufficient to have a single package per arch with a fixed value ?

  • Shall we also provide builds for older archs (armeabi, mips, mips64)? I read

Historically the NDK supported ARMv5 (armeabi), and 32-bit and 64-bit MIPS, but support for these ABIs was removed in NDK r17.

So this can be used only with QT 5.11 and earlier (using NDK r10e)

I think this is not a priority for now.

Any update please?

You can find the binary packages at that URL (validity is temporary) for both Qt 5.15.2 & 5.12.11. They are made for stretch (but should work also on later versions since there are very few dependencies in the end).

Any comment is welcome. :slight_smile:

While I can show excitement for solutions, I can’t offer more technical help :slight_smile:

Will wait for others to try and take it for a spin eg. @linsui

I know nothing about QT. You can open an MR in fdroiddata. Thanks!

The .yml needs the debian “qt4android” packages to be installed.

Is that MR for the .yml? or for installing qt4android debian packages (see post above) to the build server?

It’s more about trying to build an actual QT app (be it just a demo one) with this androiddeployqt. So a recipe for that app that builds QT for Android via that solution or uses some prebuilds (ok to use prebuild artifacts in this stage of testing)

Ok :ok_hand:
See https://gitlab.com/fdroid/fdroiddata/-/merge_requests/9667