Porting QT/C++ app to clickable
-
Hello community,
I like to try to port an existing application into a clickable.
The desired application is Moonlight (https://github.com/moonlight-stream/moonlight-qt).
This is gamestream client which is impleneted in QT and C++.For my understanding a porting should be do able because the technology is used for clickables too.
(If some dependencies will not work because the QT version has to be something special is written on another paper)For now I try to figure out how such a project would need to be restructured so that clickable would try to compile it properly.
Moonlight uses git submodules, those could be added in the clickable "libs" folder too which should be one required step.
But for example I have no idea where to put the language files or settings cpp files.The C++ clickable I selected on creation is relativly flat. A main.cpp and the qml folder for the UI.
Someone here who could help me to udnerstand the clickable structure better or knows some similar project which could be used as a reference?
Regards,
graphik_ -
@jonius Do you mind giving a hand with this?
-
-
You got the right approach already. Clickable does not require any specific project structure. Ideally you would just add a clickable config (clickable.json) and a few UT specific files (manifest, apparmor config, maybe a specific desktop file), see Pure Maps for example. Only the folder
packaging/click
is UT specific.I would go step by step like this:
- add a simple
clickable.json
withbuilder
set toqmake
- run
clickable build -a amd64
and see what happens- you might need to set some
build_args
that would be consumed by QMake - you will probably need to add dependencies to the build container (
dependencies_target
anddependencies_host
for build tools) - for dependencies that are not available in the ubuntu repos, you already mentioned the libraries feature. Refer to this guide for details
- you might need to set some
- Once it builds the app, you can start with what is needed for the click package
- Create a new app with
clickable create
filling in the details - Copy over the
manifest.json.in
, rename it tomanifest.json
and just put fix values where there are placeholders. - Copy over the the apparmor file and add policies if needed.
- For the desktop file I would look for one in the build or source dir, copy it over and add the line
X-Ubuntu-Touch=true
. - Add those 3 files to
install_data
. - Try first in Desktop Mode with
clickable desktop
and then on the deviceclickable chain build install launch logs -a arm64 # or armhf
- Create a new app with
Just for calification:
click
is the package format that Ubuntu Touch expects. The tool to create such a package is calledclick
, too (but you don't use that one directly if using Clickable). Clickable is a tool that knows how to handleclick
, do cross compiling utilizingdocker
(Clickable also provides the necessary images), handle build tools like CMake, QMake or cargo, run apps in Desktop Mode, handle some debugging tools like gdb, configure an IDE, install a click on your device and so on. So it is like a swizz knife for UT app development... - add a simple
-
Looking at their required dependencies you might get somewhere. But do you know whether their UI is optimized for small touch screens?
-
@jonius thank you for the detailed information and the short guideline. I will try this at the weekend and we will see how far it will goes.
It also looks like I missed some information about the clickable design, but this is clear now.
The UI should work fine on small devices. The PC and Android app have the same layout which is pretty usable on a smartphone.
I will update the thread as soon as I tested the new information.
-
@mateo_salta Sorry for the late reply - I check my messages infrequently.
@graphik_ I successfully built this on my device, but I don't think moonlight has Mir support, so it doesn't work for me. If you have a Wayland device I can describe the steps required to build and test it yourself.
I believe the limitation stems from libva which doesn't appear to have Mir support (https://github.com/moonlight-stream/moonlight-qt/blob/51b5f8046f1864e36cfa6efefbe2de71ef98ca92/app/streaming/video/ffmpeg-renderers/vaapi.h#L18-L31).