BuildOpie
This page will describe how to build Opie step by step and play around with it on your x86 linux system.
Contents
Set up your machine
You will need development headers on your machine for various libraries required to build Opie. On Debian Linux (or derivatives such as Ubuntu) you can install these packages using the following commands:
sudo apt-get install libfreetype6-dev libjpeg62-dev libpam0g-dev libpng12-dev zlib1g-dev sudo apt-get install libasound2-dev libsysfs-dev libpcsclite-dev pkg-config
Additional optional dependencies
- Bluetooth: if you want to build the Bluetooth libraries & applications (enabled by default), you will need the following:
sudo apt-get install libbluetooth-dev libobexftp0-dev libopenobex1-dev
- NetworkSettings Wireless plugin: this uses libpcap for wireless scanning, so if you have the wireless plugin enabled (it is by default) you'll need to install the appropriate package:
sudo apt-get install libpcap-dev
- SQLite PIM backends: if these are enabled you'll need the SQLite development files:
sudo apt-get install libsqlite3-dev
- Opie-Mediaplayer2: this is based on Xine, so if you have enabled it you'll need the libxine development files:
sudo apt-get install libxine-dev
Download and checkout Opie
First thing, for convenience, we'll create a folder in which we'll download, install and build everything. Let's assume that the folder is "opiehome", in your home.
cd mkdir opiehome cd opiehome
If you don't want to get the latest version of Opie from git, follow the link and read the instructions on how to download Opie Source and skip the next few steps.
Clone the Opie git repository
git clone git://gitorious.org/opie/opie.git
Later, if you just want to update your local repository, execute the following inside the opie directory:
git pull
Set up build environment
Now you have the Opie source. Go into this directory and start to set up your build environment...
cd opie export OPIEDIR="$(pwd)"
Download/Build Qt/X11 tools
uic compiler
In order to compile Opie, you need to build Qt/Embedded. But in order to compile Qt/Embedded, you need the uic tool from Qt/X11. uic is needed to "translate" UI files (user interface files, created with qt2-designer, the layout designer from TrollTech) to cpp files.
The easiest way is to download this file (statically compiled) from here. If you have the wget tool installed, you can use the following line
cd .. wget http://www.bluelightning.org/files/opie/qt2-dev-tools-bin/uic-qt2
Now we need to change its permissions to make it executable.
chmod u+rx uic-qt2
qvfb
To run Opie on x86 linux platform, you need qvfb (Qt Virtual Frame Buffer). You can download it, as for uic, from here. As usual, if you have wget installed, use the following :
wget http://www.bluelightning.org/files/opie/qt2-dev-tools-bin/qvfb-qt2
and change its permissions to make it executable:
chmod u+rx qvfb-qt2
You could also download designer-qt2 and loads of other tools from the same place.
If you don't want to download those , and would prefer building your own Qt/X11, please read BuildQtX11.
Build Qt-Embedded
To build Opie you will need Qt Embedded 2.3.10, compiled for the appropriate architecture (same as the arch you are building Opie for).
Download and untar Qt-Embedded
If you are not installing Qt-Embedded for a x86 linux platform, please See the BuildingQtForOpie page for details.
The file you need is there : http://download.qt-project.org/archive/qt/2/qt-embedded-2.3.10-free.tar.gz If you have wget installed, you can execute the line below.
wget http://download.qt-project.org/archive/qt/2/qt-embedded-2.3.10-free.tar.gz
Next thing is to untar the file:
tar zxvf qt-embedded-2.3.10-free.tar.gz
and set the QTDIR environment variable:
cd qt-2.3.10 export QTDIR="$(pwd)"
Link/move QT/X11 tools
We downloaded the uic compiler before, we now need to link it to the QT/Embedded binary folder
mkdir bin ln -s $QTDIR/../uic-qt2 bin/uic
We now do the same for qvfb (not needed yet, but then it's done)
ln -s $QTDIR/../qvfb-qt2 bin/qvfb
If you have compiled your own QT/X11 uic and qvfb, the source path for the files won't be the same. If you plan to delete the QT/X11 folder, be sure to move and not to link the uic and qvfb file.
Patch and stuff
link to QTE config-file for Opie needs
ln -s $OPIEDIR/qt/qconfig-qpe.h src/tools/
patch Qt/Embedded to work correctly with Opie and remove some Qt/Embedded errors
patch -p1 < $OPIEDIR/qt/qt-2.3.10.patch/qte-2.3.10-all.patch
On systems with gcc 4.x.x, apply the gcc4 patch:
patch -p1 < $OPIEDIR/qt/qt-2.3.10.patch/gcc4.patch
Additionally, if you are compiling with gcc 4.x.x on an AMD64 system, apply this patch also:
patch -p1 < $OPIEDIR/qt/qt-2.3.10.patch/gcc4_amd64.patch
When building against a modern Linux kernel you will also need to apply another patch (especially if you get the error "asm/page.h: No such file or directory" without it):
patch -p1 < $OPIEDIR/qt/qt-2.3.10.patch/fix-qte-asm-include.patch
configure and make Qt/Embedded
./configure -qconfig qpe -depths 4,16,24,32 -system-jpeg -system-libpng -system-zlib -no-xft -qvfb make
Once Qt is built, set the PATH to it:
export PATH=$QTDIR/bin:$PATH
Build Opie
Configure and make Opie
It's time to initialize the tree, select what you want to build in Opie, and build it:
cd $OPIEDIR make menuconfig make
Setup Opie
All that is left for you to do is set up everything so Opie will run : Here are a few lines you should put in a file and source before running Opie (you can add those to your ~/.bashrc file for example, or leave it in a file you source manually).
export QTDIR=~/opiehome/qt-2.3.10 export OPIEDIR=~/opiehome/opie export LD_LIBRARY_PATH=$QTDIR/lib:$OPIEDIR/lib export PATH=$QTDIR/bin:$OPIEDIR/bin:$PATH export QWS_DISPLAY=QVFb:0
Once you have added those lines to your file, you need to source it (that is, make it as if you were typing those commands directly into the shell).
source <filename>
Run Opie
You need to run ($QTDIR/bin/)qvfb, then ($OPIEDIR/bin/)qpe -qws : you'll see Opie running in the qvfb window if everything went well!
qvfb& qpe -qws
FYI, you can also run individual applications instead of the entire Opie environment, but some functions (notably those that require qcop) will not work when you do this.
Next step! the hello world app
Once Opie (or at least the libraries you need) are compiled, you can start developing your HelloWorldApp! :)