Further tweaks to OS X bits in cx_freeze:
--fix for file types that install_name_tool cannot handle (directories, zip files)
--fix for better integration with Mac framework structure, especially Tcl/Tk
--inject code in build to add linking to Cocoa frameworks (required for Mac App Store)
The changes to hooks.py and macdist.py look good. The changes to setup.py are a bit more controversial, though. There are hard coded paths and compiler arguments that might not be what everyone has on their systems or might event want. Could you remove those changes and/or clean them up a bit first? Thanks.
You say "On OS X, Tcl and Tk are organized in frameworks, different layout" - is this always the case with different install methods? I know for Qt, the binary package uses frameworks, but if you install it from macports, it doesn't have frameworks by default.
anthony: I added those because cx_freeze does not respect the args that I have defined in my system (CFLAGS, compiler paths, etc.), and which I used to build Python. For instance, I have Python built as a 32-bit/64-bit universal binary, but out of the box, cx_freeze only builds as 64-bit. That's a bug in cx_freeze. If you have another suggestion to make sure that cx_freeze builds things correctly, I'd welcome it. The changes to setup.py are a workaround for my own system, and if you simply want to omit that change from the commit, that's fine.
Thomas Johansson: The native Tcl/Tk on Mac are built as frameworks, including (I believe) in MacPorts. Because OS X is a Unix, you can also build Tcl/Tk as an X11/Unix-style library, but that's not common.
System Python (if this even includes Tcl/Tk?)
Linked to Tcl/Tk frameworks installed in /System/Library.
Mac installers from Python.org
These look in /Library/Frameworks for a framework build of Tcl/Tk.
Install from macports (with default settings)
The default Tcl/Tk build on MacPorts is X11. There is an Aqua variant (+quartz) but I'm not sure how much it's used, nor if it installs to a framework. MacPorts isn't much used for deploying Tkinter apps because Tkinter is well-supported by the major builds (ActiveState and Python.org) and tools (py2app), unlike PyQt.
Install from homebrew (")
I'm not familiar with homebrew, so I'm not sure here.
I think it's safe to call a non-framework version of Tcl/Tk an edge case that doesn't need to be supported. py2app doesn't support such builds. PyQt/Qt are a different case because they are so big and complex--py2app doesn't support them very well. In that case a non-framework build via MacPorts is actually simpler.