Building GCompris in KDE Neon

Friday, June 19, 2020

So here is my first blog of the year. I was finally able to start writing again 😁 This time I will be talking about building GCompris.

Why Should I Build

Well the purpose of building is just to compile, make and install the software. Then why should you make the effort in doing all this work and not just download the installation. The answer for that is yes, you can. However, as a developer who wants to work on that, you shouldn't 😛

The reason behind is that the installation doesn't allow you to see the source code working behind the application. It provides you an interface and abstracts away all the details. That is really great for a user but not for a developer who wants to learn more about the software and probably work upon it in the future.

What is GCompris

GCompris is an educational suite with more than 120 activities aimed at children in the ages 2-10. GCompris was originally written in C and Python using the GTK+ widget toolkit, but a rewrite in C++ and QML using the Qt widget toolkit is since early 2014 in process. With the rewrite almost complete, the focus is now to add options to add difficulty levels for each activity to improve the options a kid has while selecting an activity. GCompris is currently a part of KDE.

Building GCompris

And finally the section for which you were reading the blog 😊 The instructions to build GCompris are present in the MediaWiki pages maintained by GCompris. As GCompris is cross-platform, you can build GCompris in Linux, Mac, Windows, Android and even Rasberry Pi. The instructions to build from source are present here

I am currently building GCompris on Linux, KDE Neon 8.15.2 User Edition to be precise. I was earlier using Ubuntu 18.04 and recently shifted to KDE Neon. If you want to work upon and contribute to KDE Applications, I would suggest using KDE Neon or KDE Plasma. As I was not using a bleeding edge software, so I didn’t opt for KDE Developer Edition, which has more bugs but more recent packages.

Well unfortunately, I did not stumble on the same link as I have pointed earlier (bad searching skiils 😛) I found this link first. The blog is in case you reach the first link. Don't worry. It's not that the build doesn't work, just some errors that crop up due to lack of some packages. This is my account of how I dealt with them.

(The errors may not be exactly what I found, as I did not record them and have forgotten the exact text. I tried to salvage what I could from my recent search history 😛)

After cloning the project, opening it in Qt Creator and running it, I was not able to build the first time due to the following error:

CMake Error at CMakeLists.txt:22 (find_package):
  By not providing "FindQt5LinguistTools.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "Qt5LinguistTools", but CMake did not find one.

  Could not find a package configuration file provided by "Qt5LinguistTools"
  with any of the following names:

    Qt5LinguistToolsConfig.cmake
    qt5linguisttools-config.cmake

  Add the installation prefix of "Qt5LinguistTools" to CMAKE_PREFIX_PATH or
  set "Qt5LinguistTools_DIR" to a directory containing one of the above
  files.  If "Qt5LinguistTools" provides a separate development package or
  SDK, be sure it has been installed.


-- Configuring incomplete, errors occurred!

For resolving this error, I found ths link

$ sudo apt-get install qttools5-dev

And I was able to build the activity after that. I had not seen any screenshots of the activity, so I was taken by surprise when I saw it 😁 The format and overall look was reminiscent of the educational games I had played as a kid

Welcome Screen

For the new contributors exercise, I ran the script mentioned in the program and opened it in QtCreator. I then got the unknown cmake command "gcompris_add_rcc" error, turns out I was trying to build from the CMakeLists.txt file of the template activity. So, just building the entire project and checking the activity seems like the way to go.

Now the project was functional but I was not able to invoke on any activity by clicking on it. Checking the debugging section, I found that I had the following error there:

error: module "QtQuick.Particles" is not installed

I just search the same error and got this as a second link from my search result. This helped me find the package name so that I could install the same on my system. As I wanted to install it throughout the system for all users, I did the following:

$ sudo apt install qml-module-qtquick-particles2

And then the games started working, along with really cool particle effects 😊

Some games require packages specific to them. For example, I was unable to play the balance box game. The debugging section showed that there was some error due to QtSensor

The solution to this was install the required package:

$ sudo apt install libqt5sensors5-dev

I also had another error. The debugging section showed:

autosink error

I found a link, but it didn't help me 😛. Later it turned out that the name of the package had changed, which I found about from here

Ubuntu Package Search turned out to be super helpful in resolving these issues.

Though I couldn't resolve the autosink error, the software works great. I can play the games, change settings etc. Do try building GCompris yourself! 😊

KDEGCompris

Installing NodeJS binaries in KDE Neon

Creating a Pull Request