piggz / harbour-amazfish

Amazfit Bip support for SailfishOS
GNU General Public License v3.0
103 stars 52 forks source link

Add WIP clickable.json #147

Closed jonnius closed 1 year ago

jonnius commented 3 years ago

This app seems to make use of the Convergence Components and therefore theoretically support Ubuntu Touch (UT). I was curious to see if we can build an Ubuntu Touch click package with Clickable (even though I don't have the smart watch), so I did the first step, adding a clickable.json.

I ran into Project ERROR: mpris-qt5 development package not found. I assume the package needed in Ubuntu is libmpris-qt5-dev, which is in Ubuntu 20.04, but not 16.04, which Ubuntu Touch is still based on.

So I got a few questions:

Even if it might not be possible at the moment, this can serve as a starting point for whoever wants to pick it up later, maybe after Ubuntu Touch shifted to Ubuntu 20.04.

jonnius commented 3 years ago

Just saw you directly reference platform.silica in ui/ui.pro. Won't that break compatibility with other platforms?

piggz commented 3 years ago

It does ... i have a few changes locally while the convergence components work to become more platform independent ... hopefully in the future we can just include as a submodule.

There are probably several silica assumptions, but the plan is to move toward platform abstraction, so any PRs welcome.

Min qt version is 5.6 for sailfish. Perhaps a good place to start for deps is pure-maps, which already support UT, and has a lot of similar deps.

dano6 commented 3 years ago

https://gitlab.manjaro.org/manjaro-arm/packages/community/plasma-mobile/amazfish/-/blob/master/PKGBUILD Build file for manjaro-arm KDE for reference

piggz commented 3 years ago

Wow awesome ... There is one other dep that is a pain to build, mapbox-gl-native and its bindings. Rinigus has a fork which includes installation steps as upstream doesnt have that, however, rinigus version doesnt build on my laptop due to too new boost. The qml components do build ok though. These are a runtime dep for the UI to display maps when you have synced back a GPS activity.

jonnius commented 3 years ago

@dano6, thanks for the link.

Btw, I am the one who did the Clickable build configuration of Pure Maps and OSM Scout Server for Ubuntu Touch based on what was already there for Sailfish, while rinigus implemented the QML platfrom support. For Pure Maps we have a Clickable build configuration including building mapbox-gl-native.

So maybe we only need to build the mpris-qt5 for Ubuntu 16.04. Is this thing part of official Qt? Because I didn't find it in the Qt documentation.

dano6 commented 3 years ago

No it is just Sailfish thing. It isn't even packaged for Arch. I has to install it from source to run it on my Arch setup.

piggz commented 3 years ago

For opensuse, it is packaged as part of the deepin music player ... but probably better to sue upstream version for bug fixes

jonnius commented 3 years ago

Could someone provide a link to the upstream project of this mpris-qt5 thingie?

piggz commented 3 years ago

https://git.sailfishos.org/mer-core/qtmpris

jonnius commented 3 years ago

Thanks! Compiling qtmpris was pretty straight forward. I added it to the clickable config and provided an INSTALL.md with instructions.

Next dependencies I am looking into at the moment:

Project ERROR: Unknown module(s) in QT: KDb3 KContacts
jonnius commented 3 years ago

I tried building KContacts from Sources, but it requires Qt 5.14, while we only have Qt 5.9 in UT. Should I build some older version of KContacts or how can I circumvent that issue?

jonnius commented 3 years ago

Seems like KContacts v18.11.80 is the last version with Qt 5.9 support. But building it requires other Qt stuff in versions not available in Ubuntu 16.04. Is there some shortcut or do I need to go down this road an compile everything and ship with the app?

Edit: To be more specific, these are the KContacts dependencies that I would need build and ship (no idea what dependencies they will pull):

piggz commented 3 years ago

I dont actually use kcontacts yet, you could just comment it out of the watchfish pri file for now i think

jonnius commented 3 years ago

Ok, will do. And what about KDb3? What is that? Do I really need it? And where should I get sources from? Is it this one?

piggz commented 3 years ago

Yes, you most certainly do ... its one of the core parts of amazfish. KDB is the database library used by Kexi. Amazfish stores all healt/activity info in a Kexi database, which allows the user to analyse their own data within Kexi if they wish. It was one of my ideas to empower users with their own data, instead of having it all in the cloud. Whether or not people make use of that is another matter!!

piggz commented 3 years ago

Its in the kde repos, eg https://github.com/KDE/kdb

dano6 commented 3 years ago

Sadly, it is not in xenial: https://launchpad.net/ubuntu/+source/kdb

jonnius commented 3 years ago

I got kdb built, but the app won't find it (Project ERROR: Unknown module(s) in QT: KDb3). Is there some env var I can set to tell it where to look for it? I tried providing PKG_CONFIG_PATH to the kdb pkgconfig directory, but that didn't help.

dano6 commented 3 years ago

QML_IMPORT_PATH += path/to/module path should be to kdb3 folder where are .so files

jonnius commented 3 years ago

I tried that without success. E.g. for arm I do QML_IMPORT_PATH+=<kdb-install-prefix>/lib/arm-linux-gnueabihf. I also don't see any QML files there, so is it still QML_IMPORT_PATH?

This is how the kdb install prefix looks like:

├── bin
│   └── kdb3_sqlite3_dump
├── include
│   └── KDb3
│       ├── config-kdb.h
│       ├── KDb
│       ├── [... and a lot more]
├── lib
│   └── arm-linux-gnueabihf
│       ├── cmake
│       │   └── KDb3
│       │       ├── KDbConfig.cmake
│       │       ├── KDbConfigVersion.cmake
│       │       ├── KDbQCHTargets.cmake
│       │       ├── KDbTargets.cmake
│       │       └── KDbTargets-release.cmake
│       ├── libKDb3.so -> libKDb3.so.4
│       ├── libKDb3.so.4 -> libKDb3.so.4.3.0
│       ├── libKDb3.so.4.3.0
│       ├── pkgconfig
│       │   └── KDb3.pc
│       └── plugins
│           └── kdb3
│               ├── kdb_sqlitedriver.so
│               └── sqlite3
│                   └── kdb_sqlite_icu.so
└── mkspecs
    └── modules
        └── qt_KDb3.pri

I wonder whether I need to configure some path to mkspecs/modules/qt_KDb3.pri?

piggz commented 3 years ago

I think you hit this bug https://invent.kde.org/libraries/kdb/-/merge_requests/6 Perhaps if I switch detection to use pkgconfig it will work, or, you can try some of the tips in that bug

dano6 commented 3 years ago

Try just to copy mkspecs folder to lib/arm-linux-gnueabihf folder

jonnius commented 3 years ago

I tried without success. QML_IMPORT_PATH is set to <kdb-install-prefix>/lib/arm-linux-gnueabihf.

Change CMake includes order

As suggested I changed kdb's CMakeLists.txt:

 # ECM
+include(KDEInstallDirs)
+include(KDECMakeSettings NO_POLICY_SCOPE)
+include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
 include(ECMGeneratePriFile)
 include(ECMInstallIcons)
 include(ECMOptionalAddSubdirectory)
 include(ECMPoQmTools)
 include(ECMSetupVersion)
-include(KDEInstallDirs)
-include(KDECMakeSettings NO_POLICY_SCOPE)
-include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)

This didn't change anything about the structure of the installed files.

Copy mkspecs

I copied the folder inside the kdb install prefix with cp -r mkspecs/ lib/arm-linux-gnueabihf.

Use pkgconfig

I changed daemon/daemon.pro:

-QT +=  positioning KDb3 network
+QT +=  positioning network
+PKGCONFIG += KDb3

This leads to

Project ERROR: KDb3 development package not found

even though PKG_CONFIG_PATH points to <kdb-install-prefix>/lib/${ARCH_TRIPLET}/pkgconfig, where there is a KDb3.pc file.