Editing MADDE/Packaging

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
{{MADDE}}
 
-
 
===Introduction===
===Introduction===
-
This guide explains how to take a simple [[Qt-Maemo|Qt]] application and compile it so that it deploys to the [[Nokia N900|N900]] with an Icon. It is supposed to be step by step guide on how to take a (simple) Qt app and package and deploy it with an Icon using [[MADDE]].
+
This guide explains how to take a simple Qt application and compile it so that it deploys to the N900 with an Icon. It is supposed to be step by step guide on how to take a (simple) Qt app and package and deploy it with an Icon using Madde.
=== Prerequisites ===
=== Prerequisites ===
Line 11: Line 9:
=== Steps ===
=== Steps ===
 +
1. Create simple project through Madde.
 +
  mad pscreate -t qt_simple projectname
-
<ol>
+
2. Edit and test with QT Creator (or whatever your favorite tool is).
-
<li>Create simple project through MADDE.
+
-
  mad pscreate -t qt_simple projectname</li>
+
-
<li>Edit and test with Qt Creator (or whatever your favorite tool is).</li>
+
3. Once ready to deploy create a clean empty top level folder "<projectname>-0.x" where x is your revision number e.g. "c:\Madde\0.5\home\shep\wwcalc-0.1"...In the OS  
-
 
+
-
<li>Once ready to deploy create a clean empty top level folder <code><projectname>-0.x</code> where <code>x</code> is your revision number, for example <code>C:\Madde\0.5\home\shep\wwcalc-0.1</code> in the OS  
+
'''Note: the following 3 steps apply each time you go to build.'''
'''Note: the following 3 steps apply each time you go to build.'''
-
   <ol><li>ensure there is no <code>debian</code> folder at the same level as <code>src</code></li>
+
   3.1 ensure there is no "debian" folder at the same level as "src"
-
   <li>ensure there is no folder structure called <code><projectname>-0.x-orig</code> left over from a failed compile</li>
+
   3.2 ensure there is no folder structure called "<projectname>-0.x-orig" left over from a failed compile
-
   <li>remove old compiles from the <code>Madde\home\user</code>, for example <code>C:\Madde\0.5\home\Shep</code> folder.</li></ol></li>
+
   3.3 remove old compiles from the Madde\home\user (e.g. C:\Madde\0.5\home\Shep) folder.
-
<li>Copy the <code>src</code> folder from the tested Qt project into the <code><projectname-0.x</code> folder</li>
+
4. Copy the "src" folder from the tested Qt project into the "<projectname-0.x" folder
-
<li>Create (or obtain) an application Icon. This should be a 64x64 PNG. Call it <code><projectname>.png</code> and place it in the <code>src</code> folder.</li>
+
5. Create (or obtain) an application Icon. This should be a 64x64 png. Call it <projectname>.png and place it in the "src" folder.
-
<li>Again inside the <code>src</code> folder create a new file called <code><projectname>.desktop</code>
+
6. Again inside the "src" folder create a new file called "<projectname>.desktop"
Code:
Code:
-
<pre>
+
  [Desktop Entry]
-
[Desktop Entry]
+
  Encoding=UTF-8
-
Encoding=UTF-8
+
  Version=0.x
-
Version=0.x
+
  Type=Application
-
Type=Application
+
  Name=<Long Descriptive Project Name>
-
Name=<Long Descriptive Project Name>
+
  Exec=/usr/bin/<projectname>
-
Exec=/usr/bin/<projectname>
+
  Icon=<projectname>
-
Icon=<projectname>
+
  X-HildonDesk-ShowInToolbar=true
-
X-HildonDesk-ShowInToolbar=true
+
  X-Osso-Type=application/x-executable
-
X-Osso-Type=application/x-executable
+
-
</pre></li>
+
-
<li>Inside the <code>src</code> folder added a file called <code>src.pro</code>. Getting this right is the key to getting the Makefile correct and hence the install working. At the end of this file there is a section called <code>INSTALLS += ...</code> for every file you want installed in a location you need an entry here. In the example here we install the target, icon and desktop files.
+
7. Inside the "src" folder added a file called "src.pro". Getting this right is the key to getting the Makefile correct and hence the install working. At the end of this file there is a section called "INSTALLS += "...for every file you want installed in a location you need an entry here. In the example here we install the target, icon and desktop files.
Code:
Code:
-
<pre>
+
  TARGET = wwcalc
-
TARGET = wwcalc
+
  TEMPLATE = app
-
TEMPLATE = app
+
  SOURCES += qtmain.cpp \
-
SOURCES += qtmain.cpp \
+
      mainwindow.cpp  
-
    mainwindow.cpp  
+
  HEADERS += mainwindow.h  
-
HEADERS += mainwindow.h  
+
  FORMS += mainwindow.ui  
-
FORMS += mainwindow.ui  
+
   PREFIX = ../debian/wwcalc/usr
-
 
+
 
-
unix {
+
  unix {
-
   PREFIX = /usr
+
   BINDIR = $$PREFIX/bin
   BINDIR = $$PREFIX/bin
   DATADIR =$$PREFIX/share
   DATADIR =$$PREFIX/share
-
 
+
 
   DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"
   DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"
-
 
+
 
   #MAKE INSTALL
   #MAKE INSTALL
-
 
+
 
   INSTALLS += target desktop icon64  
   INSTALLS += target desktop icon64  
 +
 
 +
    target.path =$$BINDIR
 +
 
 +
    desktop.path = $$DATADIR/applications/hildon
 +
    desktop.files += wwcalc.desktop
 +
 
 +
    icon64.path = $$DATADIR/icons/hicolor/64x64/apps
 +
    icon64.files += wwcalc.png
 +
  }
-
  target.path =$$BINDIR
+
8. Up one level and inside the top level folder (i.e. "c:\Madde\0.5\home\<YOU!>\<projectname>-0.x" ) create a file called "<projectname>.pro" with the following exact contents.
-
 
+
-
  desktop.path = $$DATADIR/applications/hildon
+
-
  desktop.files += wwcalc.desktop
+
-
 
+
-
  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
+
-
  icon64.files += wwcalc.png
+
-
}
+
-
</pre></li>
+
-
 
+
-
<li>Up one level and inside the top level folder (that is,  <code>C:\Madde\0.5\home\<YOU!>\<projectname>-0.x</code> ) create a file called <code><projectname>.pro</code> with the following exact contents.
+
Code:
Code:
-
<pre>
+
  TEMPLATE = subdirs
-
TEMPLATE = subdirs
+
  SUBDIRS  = src
-
SUBDIRS  = src
+
-
</pre></li>
+
-
<li>In Madde make sure the [[MADDE/Device runtime|runtime is up and connectible]] and then execute.
+
10. In Madde make sure the runtime is up and connectible (described here: http://wiki.maemo.org/MADDE/Device_runtime) and then execute.
Code:
Code:
-
<pre>
+
  mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl
-
mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl
+
  mad dpkg-buildpackage
-
</pre>
+
  mad remote -r org.maemo.<projectname> send ../<projectname>_0.x-1_armel.deb
-
''Several people have commented that mad qmake is not required, but I find there are times that it is, ignore this next line if you wish''
+
  mad remote -r org.maemo.<projectname> install <projectname>_0.x-1_armel.deb
-
<pre>
+
-
mad qmake
+
-
mad dpkg-buildpackage
+
-
mad remote -r org.maemo.<projectname> send ../<projectname>_0.x-1_armel.deb
+
-
mad remote -r org.maemo.<projectname> install <projectname>_0.x-1_armel.deb</pre></li>
+
-
<li>Uninstalling - from an X_Terminal.
+
11. Uninstalling - from an X_Terminal.
Code:
Code:
-
<pre>
+
  sudo gainroot
-
sudo gainroot
+
  dpkg -r <projectname>
-
dpkg -r <projectname></pre></li></ol>
+
== Additional information ==
== Additional information ==
-
* [[Packaging a Qt application]]
+
1. [http://wiki.maemo.org/Packaging_a_Qt_application Packaging a Qt Application.]
-
* [[Packaging]]
+
[[Category:Development]]
[[Category:Development]]
[[Category:Qt]]
[[Category:Qt]]

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)

Templates used on this page: