Python + Stdwin + Tkinter on Linux

Fred L Drake Jr (fdrake@csgrad.cs.vt.edu)
26 Sep 1994 20:54:23 GMT

Building Python, Stdwin, and Tkinter under Linux
================================================

The instructions which follow are fairly simple, allowing this software to
be built with a minimum of fuss. The end result will be two executable
programs: python and tkpython. "python" includes the stdwin module, and
"tkpython" includes the Tk interface module. It is unlikely anyone would
want to build a version that contains both X interfaces in a single
interpreter, so I didn't bother myself. (Note that this does *NOT* build the
character-based version of stdwin, only the X11 version.)

================================================

1. Create a new directory to work under, and place the files
python-1.0.3.tar.gz, stdwin0.9.9.tar.gz, and tkinter.tar there.

2. Uncompress & untar the python and stdwin archives.
If you only want python & tkinter, skip the stdwin archive and
go to step 6.

3. Switch to stdwin0.9.9/Packs/textedit and execute:
cc -c -I../../H wprintf.c

4. Switch to ../../Appls/klok and execute:
cc -c bsdsetdate.c

5. Switch to ../.. and execute:
./configure && make

There will be some errors, but ignore them. Stdwin for X11 is
now complete. If you want to install it, copy Ports/x11/libstdwin.a
and Packs/textedit/libtextedit.a to /usr/lib, and toss the include
files in /usr/local/include/stdwin. I've not tested the provided
installation procedure.

Switch to .. (the initial directory you created).

6. Switch to python-1.0.3/Modules and execute:
cp Setup.in Setup

7. Using your favorite editor, load Setup and make the following
changes:

a. *** STDWIN ONLY ***
Uncomment line 57 (the one that says
"STDWINPATH=:$(DESTLIB)/stdwin"). This will allow the
interpreter to locate python modules associated with
stdwin.
b. Enable the dbm module if you have libdbm.a installed.
You will need to add " -ldbm" after "dbmmodule.o" to
get the library linked in. If you don't have one and
would like to add it (not a bad idea), get gdbm from
the FSF and install it; this will provide dbm, gdbm,
and ndbm. Somebody should probably write a gdbmmodule.c
for python, since it polutes the file system less.
c. Comment out lines 97-99 (audioop, imageop, rgbimg), unless
you know more about these than I do (easy). I don't use
multimedia, so I don't miss them. If you want them, let
me know where I can get Linux versions of any appropriate
libraries, and I'll make sure I can get them working
(except sound, 'cus I like my machine quiet!).
d. *** STDWIN ONLY ***
Uncomment and set line 106 to:

STDWIN=../../stdwin0.9.9

e. *** STDWIN ONLY ***
Uncomment and change line 108 to (all on one line):

stdwin stdwinmodule.o -I$(STDWIN)/H
$(STDWIN)/Ports/x11/libstdwin.a
$(STDWIN)/Packs/textedit/libtextedit.a -lX11

Save the file and exit the editor.

8. Change to .. and execute:
./configure && make

If you want to install the interpreter at this point, execute
as super-user:
make install libinstall

To install the object libraries and include files (to use python
as an embedded language or to develop extensions), execute as
super-user:
make libainstall inclinstall

9. Unless you want to use tkinter, you are done. I recommend tkinter
over stdwin, so install tkpython anyway. Here's how:

10. Remember that you are still in the python-1.0.3 directory at this
point. Execute:
zcat ../tkinter.tar.gz | tar -xf - ; cd tkinter

11. If you enabled the dbm module in your first interpreter, edit the
file Makefile.pre.in using your favorite editor. At the end of
line that starts "LIBS=" add " -ldbm" to the end.

12. Execute:
./configure && make && cd ..

13. Execute:
mv python tkpython

14. To install, execute as super-user:
install -c tkpython /usr/local/bin
for i in tkinter/*.py;do install -c $i /usr/local/lib/python/$i;done

15. That's it. Write python programs and get some real work done.

It looks like the python installation for the stdwin module hasn't kept
up with the stdwin distribution, an interesting turn-around, perhaps due
to Guido updating the stdwin configuration. This might (hopefully) become
easier, because it's just a little on the messy side right now.

Hope for a (native) Tk for non-X11 platforms soon; using stdwin on the
Mac has been a real problem (sorry Guido), and it just isn't available for
MS Windows. Whatever your feelings on these platforms, some of us actually
need to get stuff working on them, even if they don't.

Well, that seems to be about it. If anyone has any difficulty using these
instructions send email; I'll try to help & revise these as best I can.

Fred L. Drake, Jr.
fdrake@csgrad.cs.vt.edu