System Setup: Win32

  SlashDot  Python Home

 

Configuration
Hardware
Linux
Disks
X Windows
Printer
Modem
Sound
Network
Scanner
CD-RW
Windows
Other

Table of Contents

Overview

Install a UNIX-like environment on a Win32 box. In my case, I have a Toshiba Satellite 305 laptop, 80MB, 2GB, Win95.

Cygwin

Start by dowlonading from http://www.cygwin.com, where Cygnus meets Windows. I got:
ash-20001012.tar.gz
autoconf-2.13.tar.gz
bash-2.04-5.tar.gz
binutils-20001221-1.tar.gz
bison-1.28-1.tar.gz
bootstrap.zip
byacc.tar.gz
clear-1.0.tar.gz
cpio-2.4.2.tar.gz
crypt-1.0.tar.gz
cvs-1.11.0-1.tar.gz
cygwin-1.1.7-1.tar.gz
dejagnu.tar.gz
emacs-20.6-bin-i386.tar.gz
fileutils-4.0-2.tar.gz
findutils.tar.gz
flex.tar.gz
gawk-3.0.4.tar.gz
gcc-2.95.2-6.tar.gz
gdbm-1.8.0-3.tar.gz
gettext-0.10.35-2p1.tar.gz
gperf.tar.gz
grep-2.4.2-1.tar.gz
groff-1.11a-1.tar.gz
inetutils-1.3.2-8.tar.gz
jbigkit-1.2-3.tar.gz
jpeg-6b-3.tar.gz
less-358-2.tar.gz
libpng-1.0.8-2.tar.gz
login-1.4-1.tar.gz
m4.tar.gz
make-3.79.1-2.tar.gz
man-1.5g-2.tar.gz
mingw-20001225-1.tar.gz
mt-1.9.1.tar.gz
patch.tar.gz
readline-4.1-1.tar.gz
regex-4.4.tar.gz
sed-3.02-1.tar.gz
setup.exe
setup.ini
shellutils.tar.gz
tar-1.13.18-2.tar.gz
tcltk-20001125-1.tar.gz
termcap-20001216-1.tar.gz
textutils-2.0-1.tar.gz
tiff-3.5.5-3.tar.gz
time.tar.gz
w32api-20001225-1.tar.gz
xpm-4.0.0-2.tar.gz
zlib-1.1.3-5.tar.gz

Put these in the public dir on the SAMBA server. Open the dir from the laptop, and copy the items into C:\junk\cygwin. Run setup.exe. When it asks, tell it to use the files in the local directory. Tell it to put the files in C:\toolkit. Ask for both an entry on the Start menu and a desktop icon. A few minutes later, you are ready to go.

Edit AUTOEXEC.BAT to add C:\toolkit\bin;C:\toolkit\usr\bin to the PATH. Run autoexec.

Run C:\toolkit\emacs-20.6\bin\addpm.exe. Ask for an entry on the Start menu and a desktop icon.

Personalize

At this point, the system is ready for personalization.

  • Edit /etc/profile, changing the PS1 prompt:
    PS1='\u@\h:\w
    $ '
    
    This takes out the color coding, making it usable in an emacs shell.

  • Copy over .profile. Comment out the test for /etc/profile. bash is already looking at /etc/profile, and using that to check for a local profile. So it gets into a loop. Also comment out the call to .bashrc, because this is already being called on bash startup. In other words, the file is empty.

  • Copy over .bashrc. Comment out the test for /etc/profile.
    # Bash knows 3 diferent shells: normal shell, interactive shell, login shell.
    # ~/.bashrc is read for interactive shells and ~/.profile is read for login
    # shells. We just let ~/.profile also read ~/.bashrc and put everything in
    # ~/.bashrc.
    
    #test -z "$PROFILEREAD" && . /etc/profile
    
    # commands common to all logins
    
    if ! [ $TERM ] ; then
        eval `tset -s -Q`
        case $TERM in
          con*|vt100) tset -Q -e ^?
            ;;
        esac
    fi
    
    #
    # nearly no known program needs $TERMCAP - 'Slang'-programs get confused
    # with a set $TERMCAP -> unset it.
    # unset TERMCAP
    
    # Some programs support several languages for their output.
    # If you want them to use german, please uncomment the following line.
    #export LANG=de_DE.ISO-8859-1
    
    #
    # try to set DISPLAY smart (from Hans) :)
    #
    if test -z "$DISPLAY" -a "$TERM" = "xterm" -a -x /usr/bin/who ; then
        WHOAMI="`/usr/bin/who am i`"
        _DISPLAY="`expr "$WHOAMI" : '.*(\([^\.][^\.]*\).*)'`:0.0"
        if [ "${_DISPLAY}" != ":0:0.0" -a "${_DISPLAY}" != " :0.0" \
             -a "${_DISPLAY}" != ":0.0" ]; then
            export DISPLAY="${_DISPLAY}";
        fi
        unset WHOAMI _DISPLAY
    fi
    
    
    test -e ~/.alias && . ~/.alias
    
    
    export DISPLAY LESS PS1 PS2
    umask 022
    
    ##########################
    #added 
    ##########################
    alias emacs='//c/toolkit/emacs-20.6/bin/emacs -g 80x30+10+10 '
    
    #---export paths-------------------
    export PATH LD_LIBRARY_PATH MANPATH PYTHONPATH 
    

    The alias for emacs makes it fit on my rather small window.

  • Copy over .emacs, or actually .gnu-emacs-local, into .emacs. Edit to comment out the mail and gnus server items.

    ;;; -*- Mode: Emacs-Lisp -*-
    
    ;;;-----------------------------
    ;;;Set buffer list to use current window if >1 else split
    ;;;
    (defun my-list-buffers (&rest args)
      (interactive)
      (let ((buff-window (get-buffer-window "*Buffer List*")))
        (if (and (not buff-window)                ; Not visible
    	     (not (one-window-p 'no-mini)))   ; Multi-window
    	;; Attach "*Buffer List*" to current window
    	(switch-to-buffer "*Buffer List*")))
      (apply 'list-buffers args)
      (pop-to-buffer "*Buffer List*")            ; Go there
      (forward-line 3))                          ; Skip uninteresting stuff
    
    (global-set-key "\C-x\C-b" 'my-list-buffers)
    
    ;;;----------------------------------
    ;;; bury menu buffer after selecting buffer
    ;;;
    (defun Buffer-menu-this-window ()
      "Select this line's buffer in this window, and bury buffer menu"
      (interactive)
      (let ((menu-buffer (current-buffer)))
        (switch-to-buffer (Buffer-menu-buffer t))
        (bury-buffer menu-buffer)))
    
    ;;;-----------------------
    (setq column-number-mode t)
    
    ;;;------------------------
    ;;; pdx
     (load-library "pdx-mode")
     (setq auto-mode-alist
           (append
           '(("\\.pdx\\'" . pdx-mode))
           auto-mode-alist))
    
    ;;;------------------------
    ;;; python
     (load-library "python-mode")
     (setq auto-mode-alist
           (cons '("\\.py$" . python-mode) auto-mode-alist))
     ;;;(add-hook 'python-mode-hook 'turn-on-font-lock)
     (setq indent-tabs-mode ())
    ;;;-------------------------
    (custom-set-variables
     '(explicit-shell-file-name "c:\\toolkit\\bin\\bash"))
    (custom-set-faces)
    

    Then copy over the pdx-mode.elc and python-mode.elc, into //c/toolkit/emacs-20.6/lisp/progmodes.

  • In //c/toolkit/bin, make a symlink for python:
      ln -s //c/'Program files'/python/python.exe python
    
    Since this is a window-ized app, it thinks in terms of DOS-style file names. So to use it:

    go:
       c:/toolkit/bin/pdx2html.py hello.pdx
    
    pdx2html.pdx:
       #!/bin/python 
    
       import sys,Pdx.Html
    
       if __name__ == '__main__':
          p=Pdx.Html.Html()
          p.parse(sys.argv[1:])
    

 
Creator: Harry George
Updated/Created: 2001-01-07