Active Topics

 


Reply
Thread Tools
Posts: 60 | Thanked: 23 times | Joined on Jan 2010
#21
I just made a simpler step by step process:

1. Open MADDE terminal

2. Execute: mad pscreate -t qt_simple qtx

3. Place a 64x64 image named qtx.png in the qtx folder. (NOT the src folder)

4. Create a file named qtx.desktop in qtx folder with this content:
Code:
[Desktop Entry]
Encoding=UTF-8
Version=0.1
Type=Application
Name=qtx
Exec=/usr/bin/qtx
Icon=qtx
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
5. Add these lines to the end of qtprog.pro:
Code:
PREFIX = ./debian/qtx/usr

unix {
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share

DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"

#MAKE INSTALL

INSTALLS += target desktop icon64

  target.path =$$BINDIR

  desktop.path = $$DATADIR/applications/hildon
  desktop.files += qtx.desktop

  icon64.path = $$DATADIR/icons/hicolor/64x64/apps
  icon64.files += qtx.png
  

}
6. Exectute these commands in MADDE terminal:
Code:
cd qtx
mad qmake
mad dpkg-buildpackage
mad remote -r N900 send ../qtx_0.1_armel.deb
mad remote -r N900 install qtx_0.1_armel.deb
Thats it, its now installed with shortcut and icon! (shows a blue icon before you restart the device)

Can someone show me how the debian/postinst file is supposed to look like to update the icon without the need for a restart ?

Last edited by tmsha; 2010-01-18 at 22:01.
 

The Following 3 Users Say Thank You to tmsha For This Useful Post:
Posts: 432 | Thanked: 645 times | Joined on Mar 2009
#22
Originally Posted by tmsha View Post
Can someone show me how the debian/postinst file is supposed to look like to update the icon without the need for a restart ?
Here is an example. Line 6 does the trick. But be aware that there is a bug in the platform itself, so that it might not work.

Daniel
 

The Following 2 Users Say Thank You to danielwilms For This Useful Post:
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#23
OK, discovered how to remove my package from the N900 too

In X-Terminal
Code:
sudo gainroot
dpkg -r <packagename>
That appears to be it!

Shep
 
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#24
OK, Here is the full guide with the final 2 steps included (update icon cache and uninstall). It is supposed to be step by step guide onhow to take a (simple) Qt app and package and deploy it with an Icon using Madde.

The project I have is simple, 1 window called mainwindow.

Note: As a convention I like to keep all my code together, so I have created any extra files in the "src" folder.

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.
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:
[Desktop Entry]
Encoding=UTF-8
Version=0.x
Type=Application
Name=<Long Descriptive Project Name>
Exec=/usr/bin/<projectname>
Icon=<projectname>
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
7. Again inside the "src" folder create a new file called "<projectname>.service" which looks like this
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. I've colour coded the 4 installs below for clarity.
Code:
TARGET = wwcalc
TEMPLATE = app
SOURCES += qtmain.cpp \
    mainwindow.cpp 
HEADERS += mainwindow.h 
FORMS += mainwindow.ui 
PREFIX = ../debian/wwcalc/usr

unix {
BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share

DEFINES += DATADIR=\"$$DATADIR\" PKGDATADIR=\"$$PKGDATADIR\"

#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 here) and then execute
Code:
mad dh_make --createorig --single -e foo.bar@gmail.com -c gpl
11. Step 10 creates a debian folder at the root level, Go there and edit the "postinst.ex" file
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:
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
13. Uninstalling - from an X_Terminal
Code:
sudo gainroot
dpkg -r <projectname>
I hope this helps/works!

Many thanks to many users who helped me understand this structure especially too, Salser and danielwilms.

Shep
Attached Files
File Type: zip wwcalc-0.4.zip (375.4 KB, 108 views)
 

The Following 2 Users Say Thank You to shep For This Useful Post:
VDVsx's Avatar
Posts: 1,070 | Thanked: 1,604 times | Joined on Sep 2008 @ Helsinki
#25
Originally Posted by shep View Post
11. Step 10 creates a debian folder at the root level, Go there and edit the "postinst.ex" file
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
Please note that icon cache was dropped since PR1.1, so software targeting PR1.1 and future releases don't need this file.

Please wikify this tutorial[1], these kind of tutorials get lost over time here at TMO.

Thanks for your contributions.

[1] - http://wiki.maemo.org/MADDE
__________________
Valério Valério
www.valeriovalerio.org
 
Posts: 60 | Thanked: 23 times | Joined on Jan 2010
#26
If we are going to put this on a wiki I dont think the guide shep made is any good, its too complicated. You realy dont need to do all those steps, just look at my post at the top of this page..
 

The Following User Says Thank You to tmsha For This Useful Post:
VDVsx's Avatar
Posts: 1,070 | Thanked: 1,604 times | Joined on Sep 2008 @ Helsinki
#27
Originally Posted by tmsha View Post
If we are going to put this on a wiki I dont think the guide shep made is any good, its too complicated. You realy dont need to do all those steps, just look at my post at the top of this page..
Oh, I missed your, perhaps you should do it

@shep - Step 7 is also optional, perhaps your app need it, but I doubt it
__________________
Valério Valério
www.valeriovalerio.org
 
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#28
Originally Posted by VDVsx View Post
Please note that icon cache was dropped since PR1.1, so software targeting PR1.1 and future releases don't need this file.

Please wikify this tutorial[1], these kind of tutorials get lost over time here at TMO.

Thanks for your contributions.

[1] - http://wiki.maemo.org/MADDE
Thanks for the hints VDVsx, Now Wikified: http://wiki.maemo.org/MADDE/Packaging .... feedback appreciated.

What is that service file for then? I pieced this all together from different bits and pieces around the forums.

Last edited by shep; 2010-01-19 at 19:01.
 

The Following User Says Thank You to shep For This Useful Post:
shep's Avatar
Posts: 85 | Thanked: 65 times | Joined on Jan 2010 @ Ireland
#29
Originally Posted by tmsha View Post
If we are going to put this on a wiki I dont think the guide shep made is any good, its too complicated. You realy dont need to do all those steps, just look at my post at the top of this page..
Oh I don't know...I'm rather partial to mine it's simple enough to follow...I know because I did!
 
VDVsx's Avatar
Posts: 1,070 | Thanked: 1,604 times | Joined on Sep 2008 @ Helsinki
#30
Originally Posted by shep View Post
Thanks for the hints VDVsx, Now Wikified: http://wiki.maemo.org/MADDE/Packaging .... feedback appreciated.

What is that service file for then? I pieced this all together from different bits and pieces around the forums.
For advertise/register/link a d-bus service in this case.
__________________
Valério Valério
www.valeriovalerio.org
 

The Following User Says Thank You to VDVsx For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 09:08.