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: | ||
- | |||
- | |||
===Introduction=== | ===Introduction=== | ||
- | This guide explains how to take a simple | + | 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 project through Madde | ||
- | + | 2. Edit and test with QT Creator | |
- | + | ||
- | + | ||
- | + | 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 | |
- | + | ||
- | + | ||
'''Note: the following 3 steps apply each time you go to build.''' | '''Note: the following 3 steps apply each time you go to build.''' | ||
- | + | 3.1 ensure there is no "debian" folder at the same level as "src" | |
- | + | 3.2 ensure there is no folder structure called "<projectname>-0.x-orig" left over from a failed compile | |
- | + | 3.3 remove old compiles from the Madde\home\user (e.g. C:\Madde\0.5\home\Shep) folder. | |
- | + | 4. Copy the "src" folder from the tested Qt project into the "<projectname-0.x" folder | |
- | + | 5. Create (or obtain) an application Icon. This should be a 64x64 png. Call it <projectname>.png and place it in the "src" folder. | |
- | + | 6. Again inside the "src" folder create a new file called "<projectname>.desktop" | |
Code: | Code: | ||
- | + | [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 | + | |
- | + | ||
- | + | 7. (Optionally) Again inside the "src" folder create a new file called "<projectname>.service" which looks like this. | |
Code: | Code: | ||
- | + | [D-BUS Service] | |
- | + | Name=org.maemo.<projectname> | |
- | + | Exec=/usr/bin/<projectname> | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | 8. 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. | |
- | PREFIX = /usr | + | Code: |
+ | TARGET = wwcalc | ||
+ | TEMPLATE = app | ||
+ | SOURCES += qtmain.cpp \ | ||
+ | mainwindow.cpp | ||
+ | HEADERS += mainwindow.h | ||
+ | FORMS += mainwindow.ui | ||
+ | PREFIX = ../debian/wwcalc/usr | ||
+ | |||
+ | unix { | ||
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 service | ||
+ | |||
+ | target.path =$$BINDIR | ||
+ | |||
+ | desktop.path = $$DATADIR/applications/hildon | ||
+ | desktop.files += wwcalc.desktop | ||
+ | |||
+ | icon64.path = $$DATADIR/icons/hicolor/64x64/apps | ||
+ | icon64.files += wwcalc.png | ||
+ | |||
+ | service.path = $$DATADIR/usr/share/dbus-1/services | ||
+ | service.files += wwcalc.service | ||
+ | |||
+ | } | ||
- | + | 9. Up one level and inside the new top level folder (i.e. "c:\Madde\0.5\home\<YOU!>\<projectname>-0.x" ) created a file called "<projectname>.pro" with the following exact contents. | |
+ | Code: | ||
+ | TEMPLATE = subdirs | ||
+ | SUBDIRS = src | ||
- | + | 10. In Madde make sure the runtime is up and connectible (described [http://wiki.maemo.org/MADDE/Device_runtime]) and then execute. | |
- | + | Code: | |
- | + | mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | 11. (Not needed if you are on 1.1 or higher). Step 10 creates a debian folder at the root level, Go there and edit the "postinst.ex" file. | |
Code: | Code: | ||
- | < | + | #!/bin/sh |
- | + | # postinst script for <projectname> | |
- | + | # | |
- | + | # see: dh_installdeb(1) | |
+ | |||
+ | gtk-update-icon-cache -f /usr/share/icons/hicolor | ||
+ | |||
+ | #maemo-select-menu-location <projectname>.desktop | ||
+ | |||
+ | exit 0 | ||
- | + | 12. Again in Madde | |
Code: | Code: | ||
- | + | mad qmake | |
- | + | mad dpkg-buildpackage | |
- | + | mad remote -r org.maemo.<projectname> send ../<packagename>_0.x-1_armel.deb | |
- | + | mad remote -r org.maemo.<projectname> install <projectname>_0.2-1_armel.deb | |
- | + | ||
- | mad qmake | + | |
- | mad dpkg-buildpackage | + | |
- | mad remote -r org.maemo.<projectname> send ../< | + | |
- | mad remote -r org.maemo.<projectname> install <projectname>_0. | + | |
- | + | 13. Uninstalling - from an X_Terminal. | |
Code: | Code: | ||
- | + | sudo gainroot | |
- | sudo gainroot | + | dpkg -r <projectname> |
- | dpkg -r <projectname> | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + |
Learn more about Contributing to the wiki.