Bundling Python extensions that depend on C libraries

Asheesh Laroia asheesh at creativecommons.org
Fri Dec 7 19:15:48 EST 2007


I'd like to bundle a Python C extension and use it from my activity.  This 
requires Python to dlopen() a shared library whose path can change 
depending on where the activity is installed, but also whose path is 
different than on my desktop where I built the .xo.

Initially I tried to set os['LD_LIBRARY_PATH'] from within Python, but I 
learned this would not affect the running application 
<http://hathawaymix.org/Weblog/2004-12-30>.

In the Log Viewer, I read:

<type 'exceptions.ImportError'>: liblicense.so.0: cannot open shared 
object file: No such file or directory

I tried changing my activity.info to read, in part (all on one line):

exec = LD_LIBRARY_PATH=/home/olpc/Activities/License.activity/built/lib 
sugar-activity ccactivity.LicensingActivity -s

but the error persisted.

I know this is a sort of strange thing to do, but what's a reasonable way 
to do it?  Thanks, as always!

-- Ashees

P.S. I used the copy-nand and flash OpenFirmware commands to get around my 
upgrade troubles from before.

--
One Bell System - it sometimes works.




More information about the Devel mailing list