Meego Wiki
Views

SDK/Tutorials/Use 3rd party libraries

From MeeGo wiki
< SDK | Tutorials(Difference between revisions)
Jump to: navigation, search
(Initial draft)
 
Line 1: Line 1:
This tutorial introduce how to use the 3rd party libraries in MeeGo SDK.  
This tutorial introduce how to use the 3rd party libraries in MeeGo SDK.  
 +
The contents in this page is still under development. Some features are in development and some bugs are in fixing. Please just take it as a reference instead of a formal released document.
-
== The contents in this page is still under development. Some features are in development and some bugs are in fixing. Please just take it as a reference instead of a formal released document. ==
+
----
-
+
-
When you use the 3rd party library on MeeGo, at first you need to make sure the 3rd party library is built for MeeGo and has been packaged to a rpm which can be installed on MeeGo.
+
When you use the 3rd party library in MeeGo, first you need to make sure the 3rd party library is built for MeeGo and has been packaged in rpm so it can be installed on MeeGo devices.
-
We will create a library called gameengine, which is a simple summator for only 2 operands. We will create an application called game-no-1, which will use that library.  
+
This tutorial creates a library called gameengine, which is a simple summator for only 2 operands. We will create an application called game-no-1 to use that library. It's simple story for developer to develop and use libraries which is not in default MeeGo distribution.  
-
== Create the 3rd party library rpm package ==
+
== Create rpm package of the 3rd party library ==
* Download the source of gameengine from http://wiki.meego.com/images/3rdparty_GameEngine.tgz
* Download the source of gameengine from http://wiki.meego.com/images/3rdparty_GameEngine.tgz
* Uncompress it to your preferred directory. Here we use home directory.  
* Uncompress it to your preferred directory. Here we use home directory.  

Latest revision as of 05:30, 9 March 2011

This tutorial introduce how to use the 3rd party libraries in MeeGo SDK.

The contents in this page is still under development. Some features are in development and some bugs are in fixing. Please just take it as a reference instead of a formal released document.


When you use the 3rd party library in MeeGo, first you need to make sure the 3rd party library is built for MeeGo and has been packaged in rpm so it can be installed on MeeGo devices. This tutorial creates a library called gameengine, which is a simple summator for only 2 operands. We will create an application called game-no-1 to use that library. It's simple story for developer to develop and use libraries which is not in default MeeGo distribution.

Contents

Create rpm package of the 3rd party library

cd ~/
tar zxvf 3rdparty_GameEngine.tgz
  • Open the ~/GameEngine/GameEngine.pro with Qt Creator installed by MeeGo SDK.
  • Select the correct target you want to deploy the library
  • Build the library
  • Deploy the library by select "Deploy Project "GameEngine" from Build menu.
  • Workaround for rpm package creation. Edit the ~/GameEngine/gameengine.spec and change the last line from:
%{_prefix}/*

to

/*
  • Again deploy the library by select "Deploy Project "GameEngine" from Build menu.
  • You will get the correct rpm package at ~/GameEngine-build-meego/rrpmbuild/gameengine-0.0.1-1.i586.rpm. Since the current Qt Creator has not been able to deploy the package into sysroot automatically, the above steps just generate the rpm package. It will be fixed.

Deploy the 3rd party library to sysroot

sudo mad-admin -t <target> xrpm -i ~/GameEngine-build-meego/rrpmbuild/gameengine-0.0.1-1.i586.rpm

Build the application

cd ~/
tar zxvf 3rdparty_game-no-1.tgz
  • Open the ~/game-no-1/game-no-1.pro from Qt Creator
  • Select the same target as the GameEngine project
  • Build the application.

Test the application

  • Start the MeeGo Emulator from Qt Creator
  • Deploy the library to runtime. Right click GameEngine project to popup the context menu and select "Deploy Project "GameEngine".
  • Deploy the application to runtime. Right click game-no-1 project to popup the context menu and select "Deploy Project "game-no-1".
  • Launch the game-no-1 from Qt Creator. The application will show up in MeeGo Emulator and show the result calculated from the gameengine.
Personal tools