Pdaxrom: Development
From OESF
(Moved the "Development" page here, because it was pdaXrom specific) |
(Added detailed instuctions about the ipk files and ipk making) |
||
Line 40: |
Line 40: | ||
== Building an ipk == | == Building an ipk == | ||
| + | === How does it look like? === | ||
| - | .... | + | An .ipk file is essentially a .tar.gz file containing two other .tar.gz files and an optional file called debian-binary. |
| + | Let's try to unpack one: | ||
| + | $ tar xvzf myprogram_1.0.0_armv5tel.ipk | ||
| + | ./debian-binary | ||
| + | ./data.tar.gz | ||
| + | ./control.tar.gz | ||
| + | |||
| + | * debian-binary - This file is optional and ignored by ipkg. It is there for comparability with the Debian package system. This file contains a single line containing "2.0" (without the quotes). | ||
| + | * control.tar.gz - This archive contains a file describing the package (name, version, author, dependencies, etc.), and several optional installation scripts. | ||
| + | * data.tar.gz - This archive contains the actual files that make up your program and the contents is extracted to / when installed. | ||
| + | |||
| + | |||
| + | === Build one yourself! === | ||
| + | |||
| + | Our test program will be called ''myprogram'', it's version is ''1.0.0'', it depends on the ''libmyprogram'' package and it needs at least ''1.5.0'' version, and it also depends on ''otherprogram''. Our email adress will be ''myemail@address.com''. | ||
| + | |||
| + | The program installs itself in the ''/usr/local'' directory if you don't change it. The binaries are in the ''/usr/local/bin'', the manpages in the ''/usr/local/share/man'' and the documentation in the ''/usr/local/share/doc'' | ||
| + | |||
| + | |||
| + | Here, we assume you reached the stage when you only need to do a "make install" to install the compiled program. Follow these steps to make an ipk from it: | ||
| + | * make a directory called (for example) ipkg_tmp in the program's source folder | ||
| + | $ mkdir ipkg_tmp | ||
| + | * install the program in the created directory: | ||
| + | $ make DESTDIR=/somewhere/myprogram-1.0.0/ipkg_tmp install | ||
| + | * the program files will be copied into the ipkg_tmp folder, the ipkg_tmp directory is the virtual root folder | ||
| + | * we don't usually include the manpages and documentation in the ipk file, so delete them | ||
| + | rm -r ipkg_tmp/usr/local/share/man | ||
| + | rm -r ipkg_tmp/usr/local/share/doc | ||
| + | * strip the binary files to remove the debug info from them and spare space on the Zaurus (they can be much smaller after this step, so don't forget it!) | ||
| + | $ strip -g -S -d --strip-debug ipkg_tmp/usr/local/bin/* | ||
| + | * make a directory in the ipkg_tmp directory, called "CONTROL" and add a file in it with the following content: | ||
| + | Package: myprogram | ||
| + | Version: 1.0.0 | ||
| + | Depends: libmyprogram (1.5.0), otherprogram | ||
| + | Architecture: armv5tel | ||
| + | Maintainer: myemail@address.com | ||
| + | Description: This is a description about our package | ||
| + | * finally, make the ipk file | ||
| + | $ mkipkg ipkg_tmp | ||
| + | * it will be called myprogram_1.0.0_armv5tel.ipk and it's in the current folder | ||
| + | * upload the file in the pdaXrom unstable feed, if you think it's good enough ''(where "good enough" means: it works "out of the box", no hacking is needed, you added shortcuts in the pdaXrom menu and so on...)'' | ||
| + | * if you don't have a developer acc, request one: [mailto:support@pdaXrom.org support@pdaXrom.org] | ||
== Compiling Qt Apps == | == Compiling Qt Apps == | ||
Revision as of 21:26, 21 March 2005
Contents |
Native or cross compilation
Cross compilation means compiling application on a standard pc, up to now a x86 pc running Linux, that will runs on the Zaurus. Native Compilation means compiling application on the Z itself.
Cross compilation is (normally) a lot faster than on the compilation on the Z, but developpers do not always have cross compilation in mind when they write their configure / makefile / build scripts. Meaning it might not work out of the box. When compiling natively your are not subject to cross compilation problems, but other problems arise:
- compilation might require more ram than the Z have
- compilation might creates a lot of files that takes a lot of space on your storage
- and most importantly the compilation might requires some external tools that are normally found on a standard Linux distribution but for space reason are not by default installed with pdaxrom. (or worse not yet compiled). For instance you might need to install perl just to be able to compile your application.
Cross compilation
See the installation and tutorial section inside the documentation on [1].
Note that starting from RC5 the directory /opt/arm/3.3.2 has been renamed to /opt/arm/3.3.2-vfp so if you use the latest sdk read use 3.3.2-vfp where you see 3.3.2
Native compilation
more space
The space problem can be easily solved by mounting an nfs partition of a unix server of yours. Then you can have as much space as is available on the server.
Using a nfs or samba drive on MS windows server will probably NOT work because of the difference of the filesystem (no symbolic link etc..). If you only have a windows machine there is still a solution:
- create an image file with dd
- format this image with ext2 format
- mount this image.
This will not speed up the compilation.
more ram
The ram problem can be solved by creating a swap (search on this subject). You can even create a swap image on an network drive if your are afraid to damage your cards/ internal flash.
This will definitely not make the build faster.
more speed
If you have a linux pc you can use distcc to speed up a bit the compilation. Distcc allows to distribute the compilation between the zaurus and the pc.
For now see this thread
Building an ipk
How does it look like?
An .ipk file is essentially a .tar.gz file containing two other .tar.gz files and an optional file called debian-binary. Let's try to unpack one:
$ tar xvzf myprogram_1.0.0_armv5tel.ipk ./debian-binary ./data.tar.gz ./control.tar.gz
- debian-binary - This file is optional and ignored by ipkg. It is there for comparability with the Debian package system. This file contains a single line containing "2.0" (without the quotes).
- control.tar.gz - This archive contains a file describing the package (name, version, author, dependencies, etc.), and several optional installation scripts.
- data.tar.gz - This archive contains the actual files that make up your program and the contents is extracted to / when installed.
Build one yourself!
Our test program will be called myprogram, it's version is 1.0.0, it depends on the libmyprogram package and it needs at least 1.5.0 version, and it also depends on otherprogram. Our email adress will be myemail@address.com.
The program installs itself in the /usr/local directory if you don't change it. The binaries are in the /usr/local/bin, the manpages in the /usr/local/share/man and the documentation in the /usr/local/share/doc
Here, we assume you reached the stage when you only need to do a "make install" to install the compiled program. Follow these steps to make an ipk from it:
- make a directory called (for example) ipkg_tmp in the program's source folder
$ mkdir ipkg_tmp
- install the program in the created directory:
$ make DESTDIR=/somewhere/myprogram-1.0.0/ipkg_tmp install
- the program files will be copied into the ipkg_tmp folder, the ipkg_tmp directory is the virtual root folder
- we don't usually include the manpages and documentation in the ipk file, so delete them
rm -r ipkg_tmp/usr/local/share/man rm -r ipkg_tmp/usr/local/share/doc
- strip the binary files to remove the debug info from them and spare space on the Zaurus (they can be much smaller after this step, so don't forget it!)
$ strip -g -S -d --strip-debug ipkg_tmp/usr/local/bin/*
- make a directory in the ipkg_tmp directory, called "CONTROL" and add a file in it with the following content:
Package: myprogram Version: 1.0.0 Depends: libmyprogram (1.5.0), otherprogram Architecture: armv5tel Maintainer: myemail@address.com Description: This is a description about our package
- finally, make the ipk file
$ mkipkg ipkg_tmp
- it will be called myprogram_1.0.0_armv5tel.ipk and it's in the current folder
- upload the file in the pdaXrom unstable feed, if you think it's good enough (where "good enough" means: it works "out of the box", no hacking is needed, you added shortcuts in the pdaXrom menu and so on...)
- if you don't have a developer acc, request one: support@pdaXrom.org
Compiling Qt Apps
To natively compile Qt applications, make sure you use gcc with CXXFLAGS=-fno-rtti, otherwise you might get into problems at the linking stage, with errors such as "undefined reference to `typeinfo for QWidget'".
For further info, see [2].
Compiling the distribution from scratch
You can find a HOWTO on the PdaXrom: pdaXrom-builder page about the compilation of the distribution.

