×
Namespaces

Variants
Actions
(Difference between revisions)

Creating Debian packages for Maemo 5 Qt applications and showing in the application menu

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Tidy wiki text)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Add ArticleMetaData)
(2 intermediate revisions by one user not shown)
Line 1: Line 1:
 
[[Category:Maemo]][[Category:Qt]][[Category:Code Examples]]
 
[[Category:Maemo]][[Category:Qt]][[Category:Code Examples]]
{{Abstract|This article shows how to build a '''.deb''' package for a [[:Category:Qt|Qt]] application on Maemo.  Note that the Qt SDK produces Debian package for you, so this is not mandatory to read and follow this article.}} The other problem that this article will address is how to put the Qt application at  '''Menu of Maemo Device'''. The proposed strategy does not use dh_make to create the basic debian package structure, as described in [[Qt_for_Maemo_Developers_Guide|Qt for Maemo Developers Guide]].
+
{{Abstract|This article shows how to build a '''.deb''' package for a [[:Category:Qt|Qt]] application on Maemo.  Note that the Qt SDK produces Debian package for you, so this is not mandatory to read and follow this article.}} The other problem that this article will address is how to put the Qt application at  '''Menu of Maemo Device'''. The proposed strategy does not use dh_make to create the basic debian package structure, as described in [[Qt for Maemo Developers Guide]].
  
{{ArticleMetaData <!-- v1.1 -->
+
{{ArticleMetaData <!-- v1.2 -->
 
|sourcecode= [[Media:Sample-0.0.1.zip]]
 
|sourcecode= [[Media:Sample-0.0.1.zip]]
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
Line 13: Line 13:
 
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
|id= <!-- Article Id (Knowledge base articles only) -->
 
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 
|translated-by= <!-- [[User:XXXX]] -->
 
|translated-by= <!-- [[User:XXXX]] -->
Line 26: Line 25:
 
}}
 
}}
  
[[File:helloworldmaemo5qt_4.png|500x300px]]
+
[[File:helloworldmaemo5qt 4.png|500x300px]]
  
 
===Debian Packages In Brief===
 
===Debian Packages In Brief===
Line 38: Line 37:
 
===Creating the Application===
 
===Creating the Application===
  
[[File:helloworldmaemo5qt_1.png|500x300px]]
+
[[File:helloworldmaemo5qt 1.png|500x300px]]
  
 
You need to create a simple '''Qt HelloWorld'''  Project on computer. I created a project with two labels how is showed below. Remember of to set the size of QWidget to 720 of Width and 420 of Height because the resolution of Maemo Device.
 
You need to create a simple '''Qt HelloWorld'''  Project on computer. I created a project with two labels how is showed below. Remember of to set the size of QWidget to 720 of Width and 420 of Height because the resolution of Maemo Device.
Line 44: Line 43:
 
===Copying the Application to Scratchbox===
 
===Copying the Application to Scratchbox===
  
First , copy the sources files of application to a folder at '''Scratchbox'''. In general the address is '''/scratchbox/users/username/home/username/'''. I do this:
+
First, copy the sources files of application to a folder at '''Scratchbox'''. In general the address is '''/scratchbox/users/username/home/username/'''. I do this:
  
  flavio@flavio-desktop:~/workspace$ cp -r HelloWorld/ /scratchbox/users/${USER}/home/${USER}/
+
  flavio@flavio-desktop:~/workspace$ cp -r HelloWorld/ /scratchbox/users/${USER}/home/${USER}/
  
 
===Compiling the Application at Scratchbox===
 
===Compiling the Application at Scratchbox===
Line 77: Line 76:
 
===Sending the Debian Package to Maemo Device===
 
===Sending the Debian Package to Maemo Device===
  
I used the '''scp''' command with the '''IP''' address of device. The '''IP''' address of device is searched at '''Settings->Connection Manager''' , after that , click at Connection Manager at '''left-Up-Corner->internet connection->IP address'''.
+
I used the '''scp''' command with the '''IP''' address of device. The '''IP''' address of device is searched at '''Settings->Connection Manager''' , after that, click at Connection Manager at '''left-Up-Corner->internet connection->IP address'''.
  
 
  [sbox-FREMANTLE_ARMEL: ~/HelloWorld] > scp hello-world-application.deb root@10.0.0.13:/home/user/
 
  [sbox-FREMANTLE_ARMEL: ~/HelloWorld] > scp hello-world-application.deb root@10.0.0.13:/home/user/
Line 97: Line 96:
 
===Snapshoot of HelloWorld Application===
 
===Snapshoot of HelloWorld Application===
  
[[File:helloworldmaemo5qt_5.png||500x300px]]
+
[[File:helloworldmaemo5qt 5.png||500x300px]]
<!-- Translation --> [[pt:Como criar Pacotes Debian para aplicações em Qt para Maemo 5 e mostrá-la no Menu]]
+
<!-- Translation --> [[pt:Como criar Pacotes Debian para aplicações em Qt para Maemo 5 e mostrá-la no Menu]][[Category:MeeGo Harmattan]] [[Category:Symbian]]

Revision as of 10:31, 24 July 2012

This article shows how to build a .deb package for a Qt application on Maemo. Note that the Qt SDK produces Debian package for you, so this is not mandatory to read and follow this article. The other problem that this article will address is how to put the Qt application at Menu of Maemo Device. The proposed strategy does not use dh_make to create the basic debian package structure, as described in Qt for Maemo Developers Guide.

Article Metadata
Code ExampleCompatibility
Platform(s):
Symbian
Article
Created: flaviofabricioferreira (25 Sep 2009)
Last edited: hamishwillee (24 Jul 2012)

Helloworldmaemo5qt 4.png

Contents

Debian Packages In Brief

.deb is the extension of the Debian software package format and the most often used name for such binary packages. Like the Deb part of the term Debian. Debian packages are used in distributions based on Debian, such as Ubuntu and others.

Prerequisites

You need to have libqt4-dev and Maemo 5 SDK installed on your Computer and libqt4-dev installed on your Scratchbox ARM target. For more information on Maemo 5 SDK Installation follow the link.

Creating the Application

Helloworldmaemo5qt 1.png

You need to create a simple Qt HelloWorld Project on computer. I created a project with two labels how is showed below. Remember of to set the size of QWidget to 720 of Width and 420 of Height because the resolution of Maemo Device.

Copying the Application to Scratchbox

First, copy the sources files of application to a folder at Scratchbox. In general the address is /scratchbox/users/username/home/username/. I do this:

flavio@flavio-desktop:~/workspace$ cp -r HelloWorld/ /scratchbox/users/${USER}/home/${USER}/

Compiling the Application at Scratchbox

At Start, you need login at Scratchbox:

~$ /scratchbox/login

If necessary select the ARM target using sb-conf se FREMANTLE_ARMEL . To compile do this :

[sbox-FREMANTLE_ARMEL: ~] > cd HelloWorld
[sbox-FREMANTLE_ARMEL: ~/HelloWorld] > qmake
[sbox-FREMANTLE_ARMEL: ~/HelloWorld] > make

Creating the Debian Source Package

The method of creation Debian packages is described in an external article Packaging a Qt application. Maemo is derivative of Debian Linux distribution, thus, should you have a question, feel free to consult Debian documentation Debian New Maintainer's Guide.

Sample source Debian package containing a very simple Qt application File:Sample-0.0.1.zip.

Building the Debian Package

To build both source and binary packages with checking build dependencies use the following command

[sbox-FREMANTLE_ARMEL: ~/HelloWorld] > dpkg-buildpackage -i -rfakeroot -D

Append "-nc -b" keys to avoid cleaning the source tree. This will speed up building a binary package. This is relevant for huge packages like Qt libraries, which are being built for several hours.

Sending the Debian Package to Maemo Device

I used the scp command with the IP address of device. The IP address of device is searched at Settings->Connection Manager , after that, click at Connection Manager at left-Up-Corner->internet connection->IP address.

[sbox-FREMANTLE_ARMEL: ~/HelloWorld] > scp hello-world-application.deb root@10.0.0.13:/home/user/

Installing the Debian Package at Maemo Device

[sbox-FREMANTLE_ARMEL: ~/HelloWorld] > ssh root@10.0.0.13 dpkg -i /home/user/hello-world-application.deb

Now, the application is installed at Maemo Device.

You will need to click at More... Menu and you will can see the HelloWorld Application with a icon of N900 :

Snapshoot of HelloWorld Application

Helloworldmaemo5qt 5.png

291 page views in the last 30 days.
×