View Single Post
Old 04-18-2007, 03:48 PM   #1
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,697
Karma: 7194
Join Date: Oct 2006
Location: Indianapolis, IN
Device: iRex iLiad, Nokia 770, Samsung i760
iLiad 3rd Party Program Standardization

Given that an unbricking option is on the horizon, and many new developers will probably start to emerge, I think now is a good time to talk about standardizations in our applications. Nick (smoogle) and I talked a bit about this, and I’d like for everyone to come to a consensus about the best way to approach this.

Packaging and Installation.

Installing apps should be as easy as possible for the average user. I like the way things are done now, a single folder containing everything the user needs to run a program. Copy it to the iLiad, select from the contentlister, and you’re good to go. I also like the way that mtas has these setup in the main menu of the contentlister as well (https://www.mobileread.com/forums/sho...18&postcount=6). However, that should be up to the user.

I’d like for a program to be able to be run from anywhere the user chooses to put it. This can be complicated depending on the program. Nick has made some changes to FBReader that will allow it to run from anywhere (source attached). However, not all programs may be able to be modified to do this without extensive code changes. The more we modify a program, the more difficult it is to update it when a new version is released. What if we were to compile a program with a specific working directory. Let’s say for example /home/root/Apps/programname. This way when the program is run, the start script can check if that directory exits. If it does not, make a symbolic link from there, to the directory the script is actually running from and then execute the program. I don’t know if it is also possible within a script to check as to where the symbolic link is pointing to. This way, if a user moves the folder, after the initial run, the program will still work.

I don’t know if /home/root is the best place to put it, since it will be cleared after every software upgrade. Maybe /mnt/settings would be better. But if the script checks for it’s existence every time, it may not be an issue.

Also, after some thought, the startup script should set the HOME environment variable to the current directory. I didn’t think this would matter at first, but as filling up the root directory can be a real possibility, storing everything on the memory card is a good idea. Besides, that will also survive a software flash.

I don't know anything about ipkg. If we can make an easy way for the user to install it, then I'm all for it. But to select it from the contentlister, changes will need to be made to er_registry.

Shared Libraries

Every program that I’ve ported requires shared libraries. Normally, I include these in a lib directory within the program’s folders. However, as more and more programs are ported, the more space is being wasted by duplicate files. Perhaps in the initial launching script, we can copy the libraries needed with the program to a shared library directory somewhere on the memory card. It should check to see if it is launching from /media/card or /media/cf or /mnt/free. Then, create a folder (if it does not exist) /mnt/wharever/_sharedlibs. From there a script as antartica describes (https://www.mobileread.com/forums/sho...4&postcount=17) would work well.

Also, when a conflicting version is found, it can retain it’s local copy. In the script, we can set the LD_LIBRARY_PATH=/`pwd`/lib:/media/cf/_sharedlibs:/media/mmc/_sharedlibs:/mnt/free/_sharedlibs. This way, I believe it will use the first shared library it finds within it’s own directory.

I had some more ideas, but my mind just went blank….I’ll post more as it comes to me.

What I'd like to do, is make a list of guidelines and files (startup script, manifest template, etc) that should be included when packaging a program for the iLiad. This way users won't be confused with different releases from different developers.
Attached Files
File Type: txt ZLApplicationBase.cpp.txt (6.7 KB, 715 views)
Adam B. is offline   Reply With Quote