[Pythonmac-SIG] py2app and universal TkAqua

Kevin Walzer kw at kevin-walzer.com
Thu Jul 13 22:44:30 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bob Ippolito wrote:
> 
> On Jul 6, 2006, at 4:06 PM, Kevin Walzer wrote:
> 
>> I have been unable to build the "hello-tk" demo that ships with py2app
>> if I am building against a "universal" build of Tcl/Tk.
>>
>> Here is my setup:
>>
>> from distutils.core import setup
>> import py2app
>>
>> setup(
>>     app=['hello.py'],
>>     options=dict(
>>         py2app=dict(
>>             archs="ppc,i386",
>>
>> frameworks=["/Library/Frameworks/Tcl.framework","/Library/Frameworks/Tk.framework"]
>>
>>             )
>>         )
>>     )
> 
> I gave up on that broken universal support in 0.2.x and cleaned up what
> I had in the trunk (0.3). The way it hooks into distutils now (via
> setuptools) is totally different so it needs a change to your setup files.
> 
> 1. remove your existing installation of py2app::
> 
>     rm -rf
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app
>     rm
> /Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/py2app.pth
> 
> 2. install setuptools
> <http://bob.pythonmac.org/archives/2006/01/17/single-line-setuptools-install/>
> 
> 3. sudo easy_install py2app
> 4. Change the setup.py::
> 
>     # used to be "from distutils.core import setup"
>     from setuptools import setup
>     setup(
>         app=['hello.py'],
>         # this is actually useless...
>         options=dict(py2app=dict(frameworks=['Tcl', 'Tk'])),
>         # this is new
>         setup_requires=['py2app'],
>     )
> 
> Explicitly specifying the Tcl and Tk frameworks is pointless because the
> Tkinter extension either links to them or it doesn't. If it does link to
> them, py2app will find them and include them. If it doesn't link to them
> (or it links to the /System version, for example) then it still won't
> use them even if they are present in the app bundle.
> 
> FYI, the repositories for py2app, macholib, bdist_mpkg, altgraph have
> all moved to svn.pythonmac.org, e.g.:
> http://svn.pythonmac.org/py2app/py2app/trunk/
> 
> I didn't bother trying to preserve the history, so don't bother trying
> to svn switch.
> 
> -bob
> 

This new approach seems to work well. I've tested it not just with the
basic demo but with a different script that incorporates a Tk-specific
extension with a Python wrapper (Tile). Thank you.

My only reason for wanting to use a universal build of Tcl/Tk is to
avoid things breaking if the application runs on a later version of OS X
with a later version of Tcl/Tk installed in /System. Can the tkinter
module accommodate a later 8.4.x build of Tcl/Tk without breaking?


- --
Kevin Walzer
Poetic Code
http://www.kevin-walzer.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEtrCtrTC5hIgjqTMRAjOAAJ4hDc9dgyNuPFdFokL7ImAdw0cU6wCghGba
T4jqS+qsNxx5N9haOfERjZc=
=Yf0E
-----END PGP SIGNATURE-----


More information about the Pythonmac-SIG mailing list