View Single Post
Old 04-05-2007, 05:49 PM   #35
Adam B.
Addicted to Porting
Adam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the roughAdam B. is a jewel in the rough
 
Adam B.'s Avatar
 
Posts: 1,695
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
Here's how I port applications. The following steps should work for you. It may be a bit too detailed in parts, and not in others. But if you're up for porting, you should be able to figure it out. If I'm doing something wrong, let me know. The following method works, but it may not be ideal.


First, boot the virtual machine.

Login to the virtual machine as developer. Type "sudo ifconfig" to find out the ip address of the machine.

SSH to that IP address. In Windows, use putty. On linux or Mac, use the terminal. Again, log in as developer.

Enter the command sb-menu. Go to Select, and select 'iliad-dev', you will use this target for all of your compiling. Then type 'scratchbox' to enter the scratchbox environment.

Type 'pwd'. You should be in /home/developer. This is where I store all the build files.

We will be compiling stardict today. It's a dictionary reading software. There's a precompiled version already on MobileRead.

The easiest ways to download files onto the development box is by using wget. First, go to http://sourceforge.net/projects/stardict/, then, click the link that says "download". We will want the stardict package, with the platform independent source. You should eventually see a link called "stardict-2.4.8.tar.bz2". Click that link, and sourceforge will eventually automatically download the file. However, you don't want to download it to your primary machine. Click cancel when the download screen pops up. You're looking for the link that says "If you are experiencing problems with the download please use this direct link.". Right click on 'this direct link' and click "copy link location". Then, go to your scratchbox and type 'wget' and paste the link. For stardict, you should enter something like "wget http://easynews.dl.sourceforge.net/sourceforge/stardict/stardict-2.4.8.tar.bz2" depending on the mirror that is chosen.

After it is finished downloading, you will need to extract the files. Since this is created with bzip compression you will type "tar -xjvf stardict-2.4.8.tar.bz2". If it were a gzipped archive, you would use tar -xzvf.

CD into the stardict directory. Type "./configure --help" to see your configuration options.

Stardict normally requires Gnome to run. However, we do not have gnome on the iLiad. You can compile it with GTK Support, since almost all iLiad apps are based on GTK. To do this, you'll need the --disable-gnome-support flag.
Also, the iLiad has a limited amount of storage on the internal memory. I choose to compile apps with a static directory pointing to the memory card. There may be a better way to do this, but it works well enough for me. To do this, I use the --prefix=/mnt/card/stardict flag. You would use /mnt/cf for conpact flash.

So, to configure the package, we need to run

Code:
./configure --disable-gnome-support --prefix=/mnt/card/stardict
At this point you should be ready to make the executable. But you'll find when you run make on it, that it has problems compiling. This comes down to a problem with the version of libXML that is installed. You will need to download and compile libXML2. dl-and-install.sh should be able to do this for you, but I haven't had much luck with it. To search for a missing package, I open your browser and go to: http://packages.debian.org/cgi-bin/s...ode=searchword . There, you will find libXML2-dev. Select the first link, and scroll down to the bottom. You will see 2 links: [libxml2_2.6.27.dfsg.orig.tar.gz] [libxml2_2.6.27.dfsg-1.diff.gz] .

On your development box, type "cd ~/dependencies-helper/". There, you will need to wget both files. Once both files are downloaded, run the command
Code:
./unpack-n-patch-n-build-install.sh libxml2_2.6.27.dfsg.orig.tar.gz
This will unzip, configure, make, and install the new libxml2 package. After it completes, go back to the stardict directory. Then, type "make; make install". This will build the program, and put all of it's files in your /mnt/card/stardict directory.

Now, we will need to put together the necessary libraries for the program to include in our package. Move stardict to your home directory.

Code:
cd ~/
mv /mnt/card/stardict ~/
Now, we will run the libarary helper program.

Code:
./lib-gen.sh stardict/bin/stardict 
./run-gen.sh stardict/bin/stardict 
mv lib stardict
Now, stardict is built, the libraries are in place, and we need to test the program.

Type 'exit' to exit scratchbox. We will need to start the vnc server.
Code:
 vncserver -ac -geometry 768x1024 -depth 8 :1
Once it is started, open your vnc viewer of choice and connect to IP-ADDRESS:5901

Go back into scratchbox. Type sb-menu and select the iliad-irex target.

Now, we will need to start the window manager:

Code:
cd /
DISPLAY=IP-ADDRESS:1
export DISPLAY
/iliad.sh usr/bin/matchbox-window-manager -use_titlebar no -use_cursor no &
/iliad.sh usr/bin/pageBar &
/iliad.sh usr/bin/matchbox-panel --size 39 --no-menu --bgcolor White &
Now, we will need to move the stardict directory to our virtual memory card and tell it where to load the libraries.

Code:
mv ~/stardict /mnt/card/
export LD_LIBRARY_PATH=/mnt/card/stardict/lib
Finally, lets run stardict.

Code:
/mnt/card/stardict/bin/stardict
There you have it! Stardict should be running in your VNC window. You'll need to zip up the folder, create a launcher, and copy it to your iLiad to test on there. You can download one of my other packages to use that as a template. Good luck and let me know if you have any problems or questions.
Adam B. is offline   Reply With Quote