[Sugar-devel] Bundling libraries, RPMs? (was Re: WatchMe-1, a VNC activity)

Peter Robinson pbrobinson at gmail.com
Mon Aug 17 15:48:02 EDT 2009


>>>>> Indeed.  The #1 thing to do, IMHO, is to get rid of the "yum install"
>>>>> requirement.  In the short term, the only way to do that is to bundle
>>>>> gtk-vnc and gtk-vnc-python into the .xo, which is fine... I'm just not
>>>>> quite sure how to do it.
>>>> If someone does know how to do this sort of thing, a quick how-to
>>>> writeup would be immensely useful!
>>>
>>> Please DON'T do this. There is absolutely NO guarantee that this will
>>> work between Fedora versions, it fact its known to break, just look at
>>> a recent rawhide report and see the breakage for pippy. Its a complete
>>> hack and a complete mess and it will guarantee that things will break
>>> and the activity will then only be supported on the sugar release that
>>> it was based upon rather than be supportable across multiple sugar
>>> releases because the underlying Fedora libraries that the included
>>> binaries link against will have changed. If you have something that
>>> has a dependency you'd be much better to package it up as an rpm where
>>> you can do proper rpm requires which means it can pull in any required
>>> dependencies. I will quite happily assist in rpm creation and support.
>>
>> So, in fact, I have taken a middle way that is somewhat interesting.  In
>> WatchMe-2 (currently pending in activities.sugarlabs.org; I'm not sure why
>> it hasn't been accepted) I have bundled the gtk-vnc and gtk-vnc-python
>> packages from Fedora 9, as well as a static binary of x11vnc (which still
>> has not been accepted into the Fedora repositories).  This makes the
>> bundle work "out of the box" on OLPC's XO distros.
>>
>> To make this work, I've had to modify PATH, LD_LIBRARY_PATH, and
>> PYTHONPATH.  Normally, this setup would be unreliable on other versions of
>> Fedora or another distribution, and absolutely broken on another
>> architecture (e.g. PowerPC).  However, rather than naively setting these
>> PATH variables, I have introduced a compatibility shim that inspects the
>> current PATH, determines the current Python library search path, and
>> parses /etc/ld.so.conf to work out the systemwide libraries path.  It then
>> generates these variables so as to ensure that the bundles libraries are
>> inserted with _lowest_ priority, rather than _highest_ priority as is
>> typically the case.
>>
>> As a result, if you install gtk-vnc, gtk-vnc-python, and x11vnc, WatchMe-2
>> should work on any distribution, on any architecture.  Additionally, it
>> runs on OLPC's Fedora 9 without any root privileges required.
>>
>> I had planned on describing this system after WatchMe-2 appeared on ASLO,
>> but I guess our sysadmins have been a bit too busy fighting fires to
>> approve new Activities.
>
> Congratulations! That's a truly ugly hack. Oh and BTW it won't work on
> any architecture (like PPC and probably not x86_64 too) , and will
> likely break in other ways, its successfully done that for pippy in
> rawhide!

Sorry, I read "install gtk-vnc, gtk-vnc-python, and x11vnc" as if it
was installed in the xo, not locally.

Peter


More information about the Sugar-devel mailing list