[Pythonmac-SIG] help about python frameworks in blender

Bob Ippolito bob at redivi.com
Mon Aug 22 00:17:27 CEST 2005


On Aug 15, 2005, at 5:06 AM, Jean-Luc Peurière wrote:

> Hello,
>
> I'm the Os X platform manager for blender (3D app, see
> www.blender.org), and we are facing some problems about embedding last
> version of python in it.
>
> Until now, we were using python 2.3 which meant that we statically
> linked the Os X 10.2 build with a fink installed python, and used the
> apple framework for 10.3 and later.
>
> Blender need to link against a core python for its internal use,  
> and if
> an installed python is present, for non-core modules used by scripts.
>
> Now, our python team wants to switch to python 2.4.1 for blender 2.40
> (nice versions match ;) which puts the Os X version a bit in  
> jeopardy :
>
> - compiling with the "unofficial official" version works of course,  
> but
> that means that users must have the same lib installed, or there is
> crash at launch as the lib resides in a different place than the apple
> one. Although installing the lib is not hard, we are not pleased to
> introduce a dependancy.
> - weak linking the framework leads to errors as non weak references  
> are
> presents (which is normal) in our core python API
> - i did not manage yet to compile a static version out of the  
> framework
> (which is straightforward with a fink installed python), and dont want
> to force coders to install by fink (or darwinports).
> - The 10.2 build will stay with its static 2.3 lib, so is out of
> questioning
> - Those building against CVS wont have problems as we can automate
> choice of the correct lib, but we are in trouble for releases
>
> So my questions are :
>
> - Do we have a way of linking against the 2.4 framework that allow a
> fallback against the apple provided 2.3 lib ?
>
> - If that dont work, how static compiling out of the framework, or
> include the framework in the app bundle ?
>
> Blender is build with 3 systems : makefiles, scons or xcode
>
> scons build settings for framework :
>
> PYTHON_INCLUDE =
> ['/Library/Frameworks/Python.framework/Versions/2.4/include/ 
> python2.4']
> PYTHON_LIBPATH =
> ['/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/
> config']
> PYTHON_LIBRARY = []
> PYTHON_LINKFLAGS = ['-u', '_PyMac_Error', '-framework', 'python' ]

You want to include the framework in the application bundle.  If you  
run the macho_standalone utility from py2app over blender.app after  
it's built, this will happen automatically (and any other library  
dependencies will also be included).  This can save you a  
considerable amount of time, as you no longer have to worry about  
statically compiling everything and ensuring that the dynamic  
libraries are not present on the linker's path.

-bob



More information about the Pythonmac-SIG mailing list