py2app has issues determining python version and framework name
While testing a build using Maya's bundled python2.6 interpreter, I found that it would constantly fail with two different issues:
- The python version would not be detected and result in a "pythonNone" directory name
- The framework location would be located at the incorrect filesystem depth, and would crash when attempting to copy header files from "include"
$ mayapy setup.py py2app
copying /Applications/Autodesk/maya2012/Maya.app/Contents/bin/../Frameworks/Python.framework/Python -> /Users/justin/temp/struct/dist/test.app/Contents/Frameworks/Python.framework
copying /Applications/Autodesk/maya2012/Maya.app/Contents/bin/../Frameworks/Python.framework/Resources/Info.plist -> /Users/justin/temp/struct/dist/test.app/Contents/Frameworks/Python.framework/Resources
error: can't copy '/Applications/Autodesk/maya2012/Maya.app/Contents/bin/../Frameworks/Python.framework/include/python2.6/pyconfig.h': doesn't exist or not a regular file
The fix I have found to work is to add another fallback condition to
copy_python_framework() when the version or include dir are not properly found.
Proposed patch attached, along with my sample setup,py that I am using.