Getting python to pick up the right Tcl on the Mac has been (still is) a
real PITA. With the Yacop project we've now switched to using a private
fork "Tkynter" of Tkinter with a much simplified build script. It just
*might* be the case that something similar could work for you.

I would recommend to use the ActiveTcl Tcl8.5 installation, since that
is a well-maintained distribution which also gives you many add-on's
that you might find useful. You will need to know the location of their
headers and libraries, though. One way to find out about this is to
start their "wish8.5" and ask for "info library". That should give you
an idea where to look for "tcl.h" and "libtcl<whatever>", "libtk<whatever>".

Then if you unpack yesterday's

   http://nullhomotopie.de/yacop1.0.spkg

you'll find a directory Tkynter-1.0 which is pretty minimalistic:

  c...@jehova:~/sagepkgs/yacop1.0> du -a Tkynter-1.0/
  4     Tkynter-1.0/PKG-INFO
  156   Tkynter-1.0/Tkynter.py
  72    Tkynter-1.0/_tkynter.c
  4     Tkynter-1.0/setup.py
  8     Tkynter-1.0/tkappinit.c

In theory a simple "python Tkynter-1.0/setup.py install" would install
that package. But you should be aware of three things first:

1) you have to manually edit "setup.py" to make it pick up the ActiveTcl
files. Once you know which these files are, this shouldn't be a big
deal, since setup.py is very small:

> from distutils.core import setup, Extension
> import os
> setup(name='Tkynter',
>       version='1.0',
>       ext_modules=[Extension('_tkynter', ['_tkynter.c', 'tkappinit.c'],
>                              define_macros=[('WITH_APPINIT', 1)],
>                              include_dirs = [os.environ.get("SAGE_LOCAL") + 
> os.sep + "include",
>                                              os.environ.get("SAGE_LOCAL") + 
> os.sep + "include" + os.sep + "python2.5"],
>                              libraries = ["tcl8.5","tk8.5"],
>                              library_dirs = [os.environ.get("SAGE_LOCAL") + 
> os.sep + "lib"],
>                              )],
>       py_modules=['Tkynter']
>       )

2) Obviously you should rename "Tkynter" back to "Tkinter". That change
also affects Tkynter.py, _tkynter.c, and tkappinit.c. A simple "sed
's/kynter/kinter/g" should do the trick. Or just copy the original files
from the python source directory.

3) Last thing is that "Tkynter" is an *incomplete* fork of Tkinter. The
original has an extra directory "local/lib/python2.5/lib-tk" with a
couple of python scripts:

c...@jehova:/waste/cn/sage-3.4-linux-openSUSE_11.1_x86_64-x86_64-Linux> ls
local/lib/python2.5/lib-tk/*py
local/lib/python2.5/lib-tk/Canvas.py
local/lib/python2.5/lib-tk/Dialog.py
local/lib/python2.5/lib-tk/FileDialog.py
local/lib/python2.5/lib-tk/FixTk.py
local/lib/python2.5/lib-tk/ScrolledText.py
local/lib/python2.5/lib-tk/SimpleDialog.py
local/lib/python2.5/lib-tk/Tix.py
local/lib/python2.5/lib-tk/tkColorChooser.py
local/lib/python2.5/lib-tk/tkCommonDialog.py
local/lib/python2.5/lib-tk/Tkconstants.py
local/lib/python2.5/lib-tk/Tkdnd.py
local/lib/python2.5/lib-tk/tkFileDialog.py
local/lib/python2.5/lib-tk/tkFont.py
local/lib/python2.5/lib-tk/Tkinter.py
local/lib/python2.5/lib-tk/tkMessageBox.py
local/lib/python2.5/lib-tk/tkSimpleDialog.py
local/lib/python2.5/lib-tk/turtle.py

You might have to copy these over manually.

Hope this helps,
C.


Adam wrote:
> I'm on a mac.  There is no 'tk8.5-dev' package to install with fink.
> I've tried installing the activstate tcl/tk and their devtools.  I've
> also tried installing tcl/tk from source.  Is there anything else I
> can try?
> 
> Certainly, following the FAQ, the instructions on the trac ticket
> above, or other hints posted on this thread should work, but they
> haven't yet.
> 
> Adam
> > 
> 


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to