Marble Maps forking for SailfishOS

Marble, the swiss army knife for maps and globes, developed in the KDE community, this year has got an app variant added that is concentrating on maps and that is designed for today’s typical mobile devices with touch UI, called Marble Maps. It currently is in Beta state. Read “Announcing Marble Maps for Android Open Beta” for more info.

At this year’s Randa meeting for a few days I joined the people working on having KDE software run on Android. After all there are gazillions of such systems out there, and it only makes sense to have existing FLOS software, such as KDE ones, also run there, as a matter of dealing with realities. With the developers of Marble, KAlgebra and GCompris around, some experience could be shared, and I compiled what I learned into a small Hello KWorld example.

As a Marble fanboy, Marble Maps was my obvious toy project here when learning more about building Qt5-based software for Android. I had no Android device available, but a Jolla phone with SailfishOS. That one also has support for running Android apps, so I still could use it to test my self-built Marble Maps Android packages.

Now, it felt strange to run a Qt5-based application via Android emulation layer on an OS like SailfishOS which itself is using Qt5 and then some usual “Linux” software stack/middleware. Should it not simply run directly there?

So last week finally I gave it a try to build and to run Marble Maps natively on SailfishOS. And was presented with a problem: SailfishOS in the latest version is (still) at Qt 5.2 (with QML upgraded to 5.3 it seems) and, more important, has no QtQuick Controls. Which are used in Marble Maps for all controls. At least all the Marble C++ code was building fine after 2 small fixes, so that part was looking promising.

An option might have been to build a custom version of QtQuick Controls. But that somehow smelled like problems waiting. And I also was tempted to try to do some native UX to gather more experience with QtQuick and the SailfishOS ideas. So I forked the Marble Maps code and started to write a SailfishOS variant, using its Silica UI components. The code for Marble Maps is mainly the UI layer one, written in QML, with the actual business logic nicely in the shared Marble libs and components, so it is not that much logic which is duplicated here. Still it is not “Write once and run everywhere”. It’s up for discussion how much native multi-platform apps should go. For now I will play more with it.

Right now Marble Maps for SailfishOS almost has all current features of the “normal” Marble Maps implemented, modulo some small bugs:

Marble Maps on SailfishOS: Editing a route Marble Maps on SailfishOS: Adding a new point to a route

These days sadly many people hearing “marble” and “sailfishos” might rather think of “tombstone”, bad timing here. But until that OS is pushing up the water lilies I will play more with it, after all I can use the code on a working device of mine.

If you want to use the code on a device of yours, find first RPMs on build.merproject.org and the code in branch “sfos” in my Marble repo clone clones/marble/kossebau/marble on the KDE git servers, see src/apps/marble-maps-sailfishos/ for the app code. Once it’s stable enough the code will be proposed for inclusion in the official Marble repo.
(Update: when installing the RPM on the Jolla phone, make sure you have “qt5-qtscript” installed, pkcon install qt5-qtscript in the terminal should get you there.)

Also looking forward to see the “normal” Marble Maps and other Marble-based apps soon on Plasma Mobile hopefully.
And anyone looking into an Ubuntu Touch version? Would that work with stock Marble Maps, thanks to QtQuick Controls, or would more native UX be needed there as well?

8 thoughts on “Marble Maps forking for SailfishOS

  1. That’s awesome news! Last I checked, good map/GIS apps were in short supply. I’m using Mæp right now, but it doesn’t do routing or bookmarks to begin with.
    Will you try and get it accepted in Harbour?

  2. A few notes about the QtQuick Controls & Silica on Sailfish OS:

    * looks like there is a Controls package on the Mer OBS[1] that application could make use of
    – it should be fine for OpenRepos as you can submit multiple RPM packages for an app
    – could be an issue for Harbor as you would need to somehow bundle the package, but this could be moot for apps blocked from Harbor due to other reasons
    * I’ve made an “abstraction layer” called Universal Components[2] that makes it possible to write a single GUI codebase that then can use either Silica or Controls as backend at runtime (and more backends could be added, like for Ubuntu Touch components, Nemo Glacier, whatever Plasma Mobile will have, etc.)
    – as an example of how this is the modRana[3] navigation system that uses Universal Components so that it can have a single GUI codebase that runs with the Silica backend on Sailfish OS and with the Controls backend on Android and desktop Linux (such as Fedora)
    – while using Universal Components would probably still not avoid forking Marble (as it uses Controls directly by default), the forlked/alternative GUI could still benefit from being able to use different native mobile-oriented backends with a single GUI codebase

    [1] https://build.merproject.org/package/show/nemo:devel:ux/qtquickcontrols-nemo
    [2] https://github.com/M4rtinK/universal-components
    [3] https://github.com/M4rtinK/modrana

    • Hi MartinK. Thanks for the hint to the Controls package on Mer OBS. Good to know that would be an option. Yes, Harbor’s requirements might not be met by current Marble Maps code IIRC from a quick check. Universal Components sounds interesting, made a mental note about them 🙂 So if I will find out native UX is not worth the extra effort, I know what to check.

  3. First, thanks for this work 🙂 Do you accept bug reports somewhere?

    E.g. on Jolla1:

    [F] qt_assert_x:2104 – ASSERT failure in QWidget: “Widgets must be created in the GUI thread.”, file kernel/qwidget.cpp, line 1118

    Program received signal SIGABRT, Aborted.
    [Switching to Thread 0x4710d390 (LWP 2549)]

    #6 0x404a1274 in QWidgetPrivate::init(QWidget*, QFlags) () from /usr/lib/libQt5Widgets.so.5
    #7 0x404a1442 in QWidget::QWidget(QWidgetPrivate&, QWidget*, QFlags) () from /usr/lib/libQt5Widgets.so.5
    #8 0x405ae494 in QDialog::QDialog(QWidget*, QFlags) () from /usr/lib/libQt5Widgets.so.5
    #9 0x45fb6a1c in Marble::EclipsesPlugin::initialize() () from /usr/lib/marble/plugins/libEclipsesPlugin.so
    #10 0x40bf5dba in Marble::LayerManager::renderLayers(Marble::GeoPainter*, Marble::ViewportParams*) () from /usr/lib/libmarblewidget-qt5.so.23

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.