[Pythonmac-SIG] Retroactively adding readline support to OS X Python 2.2

Chris Barker Chris.Barker at noaa.gov
Mon Jul 7 16:11:59 EDT 2003


Hi all,

I recently tried to help set up a friends box to use the Python shipped 
with jaguar, and get readline working with it. I did exactly what I did 
on my box, with no success. (where the heck did the Framework readline 
come form anyway? on my sytem it's there and complete, on his it didn't 
have any header files...)

Anyway, I remembered this note from bob Ippolito:

On Wednesday, June 25, 2003, at 06:30 PM, Bob Ippolito wrote:
> Almost equivalent to b.bum's readline-0.0.0 hack, this one downloads 
> readline 4.3, compiles a static libreadline.a, and link the python 2.3 
> readline.c against that.  This avoids any 
> PrivateFrameworks/readline.framework version compatibility issues 
> because it's linked to a static version of readline, so it should be 
> safe to redistribute the resultant binary so long as you comply with 
> the relevant licenses.  It should also be safe to redistribute this 
> "source" archive under the same license as Python.

so I took that, and altered it to work with Python2.2. It works great, 
and you can get it here if you want:

ftp://ftp.orr.noaa.gov/From_ORR/HMRD/FromChris/readlinePy2.2-0.0.1.tgz

Here is the readme:

A Python module that downloads and compiles a static readline 4.3 that 
can be used to add interactive readline support to the Python 2.2 
installation that comes with OS-X Jaguar. It should work with any 
unix-y Python2.2.*, but I havn't tested it. Requires Developer Tools.

readline.c is the verbatum, unmodified source file from Python 2.2.1s 
src/Modules directory.  setup.py is just a quick hack to make it work.

To install:
    python setup.py build
    sudo pythonsetup.py install

This assumes "python" is the apple python, also I like to build as a 
regular user, and then install with sudo

Note that the wierd extra "-arch i386" line in 
/usr/lib/python2.2/config/Makefile needs to be removed for this to 
work, as it does for using distutils for compileing any Python 
extension.

(You can explicitly use of /usr/bin/python to prevent conflicts with a 
fink installed Python or any other python.)

Originally by:
b.bum
bbum at codefab.com

Repackaged for Python 2.3 and explicit compilation of readline 4.3 by:
bob at redivi.com

And then repackaged again for Jaguar Python 2.2 by:
Chris.Barker at noaa.gov

Enjoy!
-Chris


Christopher Barker, Ph.D.
Oceanographer
                                     		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker at noaa.gov




More information about the Pythonmac-SIG mailing list