📜 ⬆️ ⬇️

Development in QtCreator for Maemo SDK

Some time ago, Qt4.6.2 for Maemo was released. Under the cat, the instruction is expected how to install the SDK in Linux Debian and configure the development environment for Qt (based on QtCreator).

Installation


So, first of all we need to download the scripts to install the SDK. This is done by the commands:
  wget http://repository.maemo.org/stable/5.0/maemo-scratchbox-install_5.0.sh 
 wget http://repository.maemo.org/stable/5.0/maemo-sdk-install_5.0.sh 

Expose them to the right of execution:
  chmod + x ./maemo-scratchbox-install_5.0.sh ./maemo-sdk-install_5.0.sh 

And we launch the first one under the root, indicating the user, who will be given access to the sandbox with the SDK:
  sudo ./maemo-scratchbox-install_5.0.sh -u tass 

The script will install a sandbox via apt, and it will install it in / scratchbox. I was not satisfied with such a state of affairs and I made this directory a link to / home / scratchbox (due to the constant shortage of space on the root partition).
Also, the script will add the specified user to the sbox group, but in order for it to be visible in this group, you must either make the relogin, or simply tell the system that we are in it:
  newgrp sbox 

Now run the second script:
  ./maemo-sdk-install_5.0.sh 

Now we need to go into the sandbox and put the necessary packages on the emulator.
Logging in is easy:
  / scratchbox / login 

In order to download packages, we first need to confirm our agreement with the EULA . After confirmation, the site will give us a string similar to
  deb http://repository.maemo.org/ fremantle / 0123456789abcdef0123456789abcdef nokia-binaries 

In the sandbox we need to add it and one more line to the /etc/apt/sources.list file
  deb http://repository.maemo.org/extras-devel/ fremantle free non-free 

Now we are ready to deliver the packages:
  apt-get update
 fakeroot apt-get install nokia-binaries nokia-apps libqt4-maemo5 * 

Upon completion, we have a fully ready to develop Maemo emulator.

Launch


For launch we need Xephyr:
  apt-get install xserver-xephyr 

Now run it
  Xephyr: 2 -host-cursor -screen 800x480x16 -dpi 96 -ac & 

A black window 800x480 will appear on the screen.
Now you need to run the Maemo environment, for this we login in the sandbox and execute the startup script:
  / scratchbox / login
 export DISPLAY =: 2
 af-sb-init.sh start 

In the black window of Xephyr, the n900 desktop will appear (I advise you to leave English as the Russian translation is incomplete for some reason and many of the inscriptions will be displayed by their identifiers). There is also a certain problem with colors (where there should be blue, orange sometimes appears, icons have a “loop” on top and other similar artifacts. But this does not affect the overall work and you can test applications quite well).

QtCreator


Immediately I will clarify that all development should be carried out in the user's home folder in the sandbox, so that you can reach the necessary files from within the sandbox.
Afaik full support for Maemo (and MADDE) is only in self-assembly creators, I use snapshots, which have a menu for choosing a Maemo device, but nothing more can be done about it. Well, yes this is not a problem, the assembly and launch of the project can always be completely reconfigured to custom steps. And this will do.
First we need a script in our home directory in the sandbox that will allow us to run applications in the sandbox.
Create a sbox-run file with the following content:
  #! / bin / sh -l
 # go to the directory there
 cd $ 1
 shift
 # export here
 export DISPLAY =: 2
 $ * 

This script takes the first argument to the directory where you need to execute the command and the other parameters what you need to do (that is, for example, the name of the binary with the parameters of this binary).
We also need a mechanism to run this script from outside the sandbox. The script is called sbox-command and is included in the small set of utilities sbox-utils, a link to which is at the end of the article. The script takes the same parameters as above.
We start QtCreator and create a new project. We need to change all the steps of assembling, cleaning and running for proxy calls through the sbox-command. Doing this every time is a bit tedious, so another create-qtc-project-file script was written, which is also in sbox-utils. It must be run in the folder with the project without parameters and it will create a .pro.user-file with minimum settings for QtCreator.
Now you can safely use QtCreator as a development tool for Maemo (do not forget to run Xephyr and the Maemo environment through the commands mentioned above). The only thing that is not covered by this setting is debugging, but I just haven’t dug this way yet.
')

Test application on Qt in Desktop-environment and Maemo-environment


It was also quickly written test application without any logic (only the designer was used) to compare the display of applications on the desktop and in Maemo. Below are his screenshots.
Application itself:



Open application menu:



Links


sbox-utils
test application sources

Source: https://habr.com/ru/post/86689/


All Articles