maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   telepathy-qt4 and the Nokia QT SDK (https://talk.maemo.org/showthread.php?t=56602)

uvatbc 2010-06-19 09:43

telepathy-qt4 and the Nokia QT SDK
 
This is not so much a question as it is a way for me to provide documentation where there is none.

Requirement:
Must be able to compile an application that uses libtelepathy-qt4 using the Nokia QT SDK on Linux. This will allow compilation for Linux and Maemo using qtcreator.
Yes of course it can be done from within scratchbox with no changes.
But can it be done from outside scratchbox?

Tried the following:
-> Hoped for dumb luck and just attempted to compile. Compilation on x86_64 Ubuntu worked once I installed libtelepathy-qt4-dev. Compilation for maemo5 failed because libtelepathy-qt4.so does not exist in NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-10.2010.19-1-slim/usr/lib
-> Downloaded telepathy-qt4 source tarball from the telepathy website.
-> First time attempting to configure through madde failed with an error stating that I should use --host if I wanted to cross-compile.
-> After reading through config.sub, I figured that the proper host alias should be "armel-linux". Added that and appropriate flags to --prefix and --eprefix.
-> Configure now fails claiming pkg-config not found.
-> Created a shell script to set PKG_CONFIG to the correct path and for completeness, also set up
QTCORE_CFLAGS='-lQtCore' ; export QTCORE_CFLAGS
QTCORE_LIBS='-DQT_SHARED -I/usr/include/QtCore' ; export QTCORE_LIBS
-> After doing all this, configure succeeded and I checked the config.log to ensure that all was well. It seemed like it was.
-> At this point make failed. mad make failed.

Eventually I gave up at this point - and decided to cheat.

tl;dr: Copied the telepathy-qt4 headers and libraries from scratchbox into the Nokia SDK fremantle directories. Now my code that uses telepathy-qt4 compiles for maemo5 and the binary runs flawlessly on the n900.

PS: In my pro file I had to add

unix {
INCLUDEPATH += /usr/include/telepathy-1.0
LIBS += -ltelepathy-qt4
}

to get it to compile for Linux and for Maemo.
****
Edit: These are the steps I took for my Win7 dev vm.

1. Copy
Source: /scratchbox/users/$USERNAME/targets/FREMANTLE_ARMEL/usr/lib
Destination: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\lib\
File: libtelepathy-qt4.a

2. Copy
Within directory: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\lib\
libtelepathy-qt4.so.0 to libtelepathy-qt4.so

3. Copy
Source: /scratchbox/users/$USERNAME/targets/FREMANTLE_ARMEL/usr/include
Destination: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\include
Directory: TelepathyQt4

vivainio 2010-06-19 09:54

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by uvatbc (Post 721457)
Eventually I gave up at this point - and decided to cheat.

tl;dr: Copied the telepathy-qt4 headers and libraries from scratchbox into the Nokia SDK fremantle directories. Now my code that uses telepathy-qt4 compiles for maemo5 and the binary runs flawlessly on the n900.


That's no cheating, it's the right thing to do.

The way to extend NQS madde part is to copy files to sysroot. You could envision doing a program that fetched the packages from the repos and extacted the debs over the sysroot.

uvatbc 2010-06-19 10:27

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by vivainio (Post 721470)
That's no cheating, it's the right thing to do.

The way to extend NQS madde part is to copy files to sysroot. You could envision doing a program that fetched the packages from the repos and extacted the debs over the sysroot.

Very apt way of describing what I did ;)

But while I was doing the copying, I never thought of it that way.

fcrochik 2010-07-12 22:55

Re: telepathy-qt4 and the Nokia QT SDK
 
uvatbc,

It seems that you have had a good fight and end up winning the "battle" to setup telepathy-qt4+tpsession on nokia sdk. Would you be so kind to tell me how you did get the telepathy-qt4 headers? I don't think I can just download the latest version from git and I tried "apt-get sources libtelepathy-qt4-0" but got errors later trying to configure/compile it on scratchbox...

In fact, any information that can help me get from 0 to compile my first qt application using telepathy qt4/tpsession on nokia sdk will be greatly appreciated! I would love for example to be able to generate your qgvdial from source.

Thanks in advance

jaem 2010-07-13 00:31

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by vivainio (Post 721470)
You could envision doing a program that fetched the packages from the repos and extacted the debs over the sysroot.

Quote:

Originally Posted by uvatbc (Post 721493)
Very apt way of describing what I did ;)

Was that pun intentional? If so, consider yourselves hi-fived and subsequently slapped with trout.

On a different note, would anyone be interested in actually putting together some sort of automation for that? I haven't personally heard any rumblings from Nokia about them doing it, but it would be quite useful, even if it was something rough.

uvatbc 2010-07-13 06:55

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by jaem (Post 749729)
Was that pun intentional? If so, consider yourselves hi-fived and subsequently slapped with trout..

Not just trout - Obligatory trout.

Quote:

Originally Posted by jaem (Post 749729)
On a different note, would anyone be interested in actually putting together some sort of automation for that? I haven't personally heard any rumblings from Nokia about them doing it, but it would be quite useful, even if it was something rough.

That's an excellent idea. I'll make something in the next 1-2 days and post it here so that fcrochik can also pick it up.

matrim 2010-07-15 09:36

Re: telepathy-qt4 and the Nokia QT SDK
 
I'm trying this too and I've gotten it to build and run fine on my device but the problem I'm having is that the editor in QT Creator doesn't seem to see the header files and it shows the classes \ includes as unknown and doesn't offer suggestions as I type.

It's not the biggest problem in the world but would be nice if someone knows a way to get it to add these to QT Creator

Diph 2010-07-15 09:54

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by matrim (Post 752543)
I'm trying this too and I've gotten it to build and run fine on my device but the problem I'm having is that the editor in QT Creator doesn't seem to see the header files and it shows the classes \ includes as unknown and doesn't offer suggestions as I type.

It's not the biggest problem in the world but would be nice if someone knows a way to get it to add these to QT Creator

Defining INCLUDEPATH in pro-file should work. You have run qmake after that?

matrim 2010-07-15 10:39

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by Diph (Post 752569)
Defining INCLUDEPATH in pro-file should work. You have run qmake after that?

Unforutnately it's not.

I've added

INCLUDEPATH += /usr/include/telepathy-1.0
LIBS += -ltelepathy-qt4

to my pro file and run qmake.

Diph 2010-07-15 11:34

Re: telepathy-qt4 and the Nokia QT SDK
 
I tried to include telepathy and it worked. Have you selected Maemo target instead of Desktop or Simulator?

fcrochik 2010-07-15 11:57

Re: telepathy-qt4 and the Nokia QT SDK
 
Would any of you be so kind to tell me the very first steps so I can join the parade? I haven't figure out from where to get the TelepathyQt4 headers ...

Thanks

matrim 2010-07-15 12:04

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by Diph (Post 752674)
I tried to include telepathy and it worked. Have you selected Maemo target instead of Desktop or Simulator?

Yeah have the maemo target selected. As mentioned I can build and run a sample program using them but can't get the QTCreator editor to recognize them e.g. for auto-completion etc


To get it installed I first installed libtelepathy-qt4-dev in scratchbox (armel target) and copied the installed lib and include files to the lib and include directories in the madde fremantle sysroot

fcrochik 2010-07-15 13:07

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by matrim (Post 752710)
To get it installed I first installed libtelepathy-qt4-dev in scratchbox (armel target) and copied the installed lib and include files to the lib and include directories in the madde fremantle sysroot

Sorry to be so needy but is there a "libtpsession-dev" somewhere?

Should I just get the headers from the "garage"? I am trying to compile qt-mobility just to start with and make sure it is working.

I can only find libtpsession on the list of packages for scratchbox/armel and it does not include the headers.

Diph 2010-07-15 13:26

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by fcrochik (Post 752780)
Sorry to be so needy but is there a "libtpsession-dev" somewhere? .

There is in extras devel.

Venemo 2010-07-15 13:34

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by fcrochik (Post 749688)
uvatbc,

It seems that you have had a good fight and end up winning the "battle" to setup telepathy-qt4+tpsession on nokia sdk. Would you be so kind to tell me how you did get the telepathy-qt4 headers? I don't think I can just download the latest version from git and I tried "apt-get sources libtelepathy-qt4-0" but got errors later trying to configure/compile it on scratchbox...

In fact, any information that can help me get from 0 to compile my first qt application using telepathy qt4/tpsession on nokia sdk will be greatly appreciated! I would love for example to be able to generate your qgvdial from source.

Thanks in advance

Download the armel package from here: http://maemo.org/packages/view/libtelepathy-qt4-dev/ and http://maemo.org/packages/view/libtelepathy-qt4-0/

Open the packages (eg. the Windows version of 7-Zip can do it), and extract the contents of the /data.tar.gz/data.tar/./ to the sysroot of MADDE.

If you copy libraries like this into MADDE, note that the default mechanism (LIBS += -lsomelibrary) looks for libsomelibrary.so in /usr/lib of the sysroot. So in this case you'll have to rename "libtelepathy-qt4.so.0.0.0" to "libtelepathy-qt4.so".

The above worked for me with other libs.
Good luck!

matrim 2010-07-15 14:28

Re: telepathy-qt4 and the Nokia QT SDK
 
After some playing around I've found that if I change to


INCLUDEPATH += /home/matrim/QtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-10.2010.19-1-slim/usr/include/telepathy-1.0
LIBS += -ltelepathy-qt4

I can build and run the project as before but now the autocomplete etc works.

Venemo 2010-07-15 17:28

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by matrim (Post 752861)
After some playing around I've found that if I change to


INCLUDEPATH += /home/matrim/QtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-10.2010.19-1-slim/usr/include/telepathy-1.0
LIBS += -ltelepathy-qt4

I can build and run the project as before but now the autocomplete etc works.

Yeah, but it won't build on Scratchbox (nor the autobuilder) that way.

I reported it previously here:
http://bugreports.qt.nokia.com/browse/QTCREATORBUG-1858

You can vote on the bug if you experience it, too.

matrim 2010-07-15 18:02

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by Venemo (Post 753030)
Yeah, but it won't build on Scratchbox (nor the autobuilder) that way.

I reported it previously here:
http://bugreports.qt.nokia.com/browse/QTCREATORBUG-1858

You can vote on the bug if you experience it, too.

Thanks for the info. I've voted for it

uvatbc 2010-07-15 18:14

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by Venemo (Post 752809)
Download the armel package from here: http://maemo.org/packages/view/libtelepathy-qt4-dev/ and http://maemo.org/packages/view/libtelepathy-qt4-0/

Open the packages (eg. the Windows version of 7-Zip can do it), and extract the contents of the /data.tar.gz/data.tar/./ to the sysroot of MADDE.

Excellent - This makes my efforts to create a script to auto-extract and place into the SDK redundant.

Quote:

Originally Posted by Venemo (Post 752809)
If you copy libraries like this into MADDE, note that the default mechanism (LIBS += -lsomelibrary) looks for libsomelibrary.so in /usr/lib of the sysroot. So in this case you'll have to rename "libtelepathy-qt4.so.0.0.0" to "libtelepathy-qt4.so".

Please don't rename. In Linux, make a symlink. In Windows, make a copy and then rename.

Venemo 2010-07-15 19:07

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by uvatbc (Post 753085)
Please don't rename. In Linux, make a symlink. In Windows, make a copy and then rename.

Yeah, that is the more elegant way.
But madde always looks for the libsomething.so, so it doesn't give a damn about the *.so.0, nor *.so.0.0.0 files.

Diph 2010-07-16 06:23

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by Venemo (Post 753143)
Yeah, that is the more elegant way.
But madde always looks for the libsomething.so, so it doesn't give a damn about the *.so.0, nor *.so.0.0.0 files.

Rename the symlink. :)

uvatbc 2010-07-19 00:28

Re: telepathy-qt4 and the Nokia QT SDK
 
First post updated to show steps

cyphunk 2010-10-13 00:48

Re: telepathy-qt4 and the Nokia QT SDK
 
Quote:

Originally Posted by uvatbc (Post 721457)

Eventually I gave up at this point - and decided to cheat.

tl;dr: Copied the telepathy-qt4 headers and libraries from scratchbox into the Nokia SDK fremantle directories. Now my code that uses telepathy-qt4 compiles for maemo5 and the binary runs flawlessly on the n900.

PS: In my pro file I had to add

unix {
INCLUDEPATH += /usr/include/telepathy-1.0
LIBS += -ltelepathy-qt4
}

to get it to compile for Linux and for Maemo.
****
Edit: These are the steps I took for my Win7 dev vm.

1. Copy
Source: /scratchbox/users/$USERNAME/targets/FREMANTLE_ARMEL/usr/lib
Destination: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\lib\
File: libtelepathy-qt4.a

2. Copy
Within directory: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\lib\
libtelepathy-qt4.so.0 to libtelepathy-qt4.so

3. Copy
Source: /scratchbox/users/$USERNAME/targets/FREMANTLE_ARMEL/usr/include
Destination: C:\NokiaQtSDK\Maemo\4.6.2\sysroots\fremantle-arm-sysroot-10.2010.19-1-slim\usr\include
Directory: TelepathyQt4

Instead of installing scratchbox to copy the libs to MADDE you can download the individual .deb's from the scratchbox installation repositories. Example:

$ wget --mirror --no-parent --no-host-directories --cut-dirs=5 --accept *armel.deb -e robots=off http://repository.maemo.org/extras-d...telepathy-qt4/
$ cd telepathy-qt4
$ for i in *.deb; do dpkg-deb --extract $i `echo -n $i | sed 's/.deb//'`; done

So for telepathy:

$ cp ./libtelepathy-qt4-0_0.2.0-1maemo5_armel/usr/lib/libtelepathy-qt4.so.0* /home/user/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/lib/.

I question if it is wise to use the headers from the local QT telepathy installation on the local workstation so you "might" consider using the headers from the .deb's as well and then adding it to your INCLUDEPATH of the .pro:

$ cp ./libtelepathy-qt4-dev_0.2.0-2maemo5_armel/usr/lib/libtelepathy-qt4.a /home/user/NokiaQtSDK/Maemo/4.6.2/sysroots/fremantle-arm-sysroot-1030-slim/usr/lib/.


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

vBulletin® Version 3.8.8