Taj Morton wrote: >>My suggestion would be to build against 2.4 and document the fact that >>Python support in Scribus will be unavailable without a local install of >>Python . Similarly, I'd tell the user that they must install >>python-imaging and Tkinter to get full functionality out of the bundled >>scripts. >> >> >What about statically linking libpython? Would that work? I'm already >statically linking lcms, libtiff, and fontconfig because their >interface versioning is really messed up. > As far as I know, no you can't do it.
libpython by its self will go "splat" on a system without the rest of Python installed - the core modules and scripts, mostly. These core modules are bound to a specific Python minor version (due to the unstable ABI) and as such you'd have to ship them too or statically link them. You'd also need to provide init.py and the other core scripts, and even then it'd be ugly as hell and wouldn't see the user's installed modules without additional configuration (and then only if they're for the same version). Personally, I think trying to include a full Python bundle is just a bad idea. Let Scribus disable Python support if the system doesn't have the appropriate version. If you want to depend on a version of Python, depend on the current "autopackage" one if such a thing exists. If you really must bundle Python, I think you'll have to include a full Python distribution - and Tcl/Tk and Tkinter and Python-imaging if you want to use the bundled scripts . The Python scripting support in Scribus is very handy, but I'm not sure it's worth the horror described above. And that's coming from someone who's spent a bunch of time on it and thinks app scripting is a crucial feature for the future. Then again, I'm not an autopackage user. On a side-note, this is another reason why Lua or TrollTech's QtScript for Applications (QSA) might be better for basic scripting. Both are built for embedding and static linking, have few or no dependencies, etc.. The downside is that both are much more limited than Python, so when you want to start grabbing data from an external DB, giving your script a GUI, or doing other advanced things you run into problems. -- Craig Ringer
