# strip everything before this and feed to /bin/sh
#
#
patch -p1 -N <<'__END_OF_PATCH__'

Index: pTk/Makefile.PL
--- Tk800.025/pTk/Makefile.PL	2003-07-19 17:19:25.000000000 +0100
+++ Tk8/pTk/Makefile.PL	2003-11-16 10:44:09.000000000 +0000
@@ -9,7 +9,7 @@
     'NAME'	=> 'Tk::pTk',
     'VERSION'	=> $Tk::Config::VERSION,
     'LINKTYPE'	=> 'static',
-    'OBJECT'	=> '$(O_FILES)', 
+    'OBJECT'	=> '$(O_FILES)',
     macro	=> { WINARCH     => $win_arch },
     'DEFINE'	=> $define,
     'INC'	=> "$inc -I. -Ibitmaps",
@@ -27,11 +27,11 @@
 sub MY::xs_c {
 '
 # Rules for building .t table files from .h files
-.SUFFIXES: .t .h .m 
+.SUFFIXES: .t .h .m
 .h.t :
-	$(PERL) mkVFunc -t $(WINARCH) $< 
+	$(PERL) mkVFunc -t $(WINARCH) $<
 .h.m :
-	$(PERL) mkVFunc -m $(WINARCH) $< 
+	$(PERL) mkVFunc -m $(WINARCH) $<
 '
 }
 
@@ -70,47 +70,47 @@
    if (open(EXC,$self->catfile($src,"pTk.inc")))
     {
      while (<EXC>)
-      {          
-       chomp;    
+      {
+       chomp;
        s/#.*$//;
        next unless /\S/;
        $mTk{$_} = $self->catfile($src,$_) unless (exists $mTk{$_});
-      }          
+      }
      close(EXC);
     }
    else
     {
      opendir(DIR,$src) || die "Cannot open $src:$!";
      if (open(EXC,$self->catfile($src,"pTk.exc")))
-      {            
+      {
        while (<EXC>)
-        {          
-         chomp;    
+        {
+         chomp;
          s/#.*$//;
          next unless /\S/;
          $exc{$_} = 1;
          if (-f $_)
-          {        
+          {
            chmod(0777,$_);
-           unlink($_); 
+           unlink($_);
            warn "Loose $_\n";
-          }        
-        }          
-       close(EXC); 
-      }            
-     else          
-      {            
+          }
+        }
+       close(EXC);
+      }
+     else
+      {
        warn "Cannot open $src/pTk.exc:$!";
-      }            
-     my $file;     
+      }
+     my $file;
      while (defined($file = readdir(DIR)))
-      {            
+      {
        next if $exc{$file};
        if ($file =~ /\.[ch]$/)
-        {          
+        {
          $mTk{$file} = $self->catfile($src,$file) unless (exists $mTk{$file});
-        }          
-      }            
+        }
+      }
      closedir(DIR);
     }
   }
@@ -174,15 +174,15 @@
  '';
 }
 
-sub MY::test 
+sub MY::test
 {
  q[
-test :: 
+test ::
 	@echo 'No tests defined for $(NAME)'
  ];
 }
 
-sub MY::post_constants 
+sub MY::post_constants
 {
  '
 INST_STATIC=libpTk$(LIB_EXT)
@@ -199,7 +199,7 @@
 
 sub MY::dynamic     { my $self = shift; "dynamic :: static\n\t".$self->{'NOECHO'}."\$(NOOP)\n" }
 
-sub MY::static 
+sub MY::static
 {
   my $self = shift;
   my $str  = $self->MM::static(@_);
@@ -211,7 +211,7 @@
 	$(AR) $(AR_STATIC_ARGS) $@ dllMain$(OBJ_EXT) && $(RANLIB) $@
 ';
    }
- return $str; 
+ return $str;
 }
 
 sub MY::realclean {
@@ -228,11 +228,6 @@
 my $self = shift;
 my $dep = $self->Tk::MMutil::mTk_postamble;
 
-$dep .= $self->dir_target(@{$self->{'dir_targets'}}); 
-
-$dep .= "config :: " . join(" \\\n\t",map($self->catfile($_,".exists"),@{$self->{'dir_targets'}})) .
-        "\n\t".$self->{NOECHO}."\$(NOOP)\n";
-
 if ($Tk::MMutil::IsWin32 or ($win_arch eq 'MSWin32' and $^O eq 'cygwin'))
  {
   my $cc = $Config{'cc'};
@@ -254,7 +249,7 @@
     $dep .= 'rc -fo $@ -r -i . -i mTk\win\rc mTk\win\rc\tk.rc';
    }
   $dep .= "\nlibpTk\$(LIB_EXT) : $file\n";
- } 
+ }
 $dep . '
 Lang.t  Lang.m : Lang.h  Lang.exc  mkVFunc
 tk.t tk.m : tk.h    tk.exc    mkVFunc
@@ -264,7 +259,7 @@
 tix.t tix.m   : tix.h tix.exc mkVFunc
 tixInt.t tixInt.m : tixInt.h tixInt.exc mkVFunc
 
-config :: LangIO.h Xlib.t Lang.t tk.t tkInt.t tkImgPhoto.t tix.t tixInt.t 
+config :: LangIO.h Xlib.t Lang.t tk.t tkInt.t tkImgPhoto.t tix.t tixInt.t
 	'.$self->{NOECHO}.'$(NOOP)
 
 ';

Index: t/listbox.t
--- Tk800.025/t/listbox.t	2003-07-20 21:57:29.000000000 +0100
+++ Tk8/t/listbox.t	2003-11-16 10:55:57.000000000 +0000
@@ -38,7 +38,7 @@
     }
 }
 
-BEGIN { plan tests => 425 }
+BEGIN { plan tests => 425, todo => [288..289,317,323..324,318,372,417] }
 
 my $partial_top;
 my $partial_lb;

Index: t/wm-time.t
--- Tk800.025/t/wm-time.t	2003-07-20 21:44:14.000000000 +0100
+++ Tk8/t/wm-time.t	2003-11-16 10:48:49.000000000 +0000
@@ -1,12 +1,17 @@
 #!/usr/bin/perl -w
 # -*- perl -*-
 
+
 use strict;
 use Tk;
 use Test::More;
-plan tests => 12;
+# Win32 gets one <visibility> event on toplevel and one on content (as expected)
+# UNIX/X is more complex, as windows overlap (deliberately)
+our $tests = 6;
+our $expect = 0;
+plan tests => $tests;
 
-my $event = '<Visibility>';
+my $event = '<Map>';
 my $why;
 my $start;
 
@@ -14,6 +19,8 @@
 {
  $start = Tk::timeofday();
  $why = shift;
+ $expect = shift;
+ print "# Start $why $expect\n";
 }
 
 my $mw = new MainWindow;
@@ -21,22 +28,22 @@
 #$l->bind($event,[\&mapped,"update"]);
 $mw->bind($event,[\&mapped,"update"]);
 $mw->geometry("+0+0");
-begin('update');
+begin('update',2);
 $mw->update;
 
 my $t = $mw->Toplevel(-width => 100, -height => 100);
 my $l2 = $t->Label(-text => 'Content')->pack;
 $t->bind($event,[\&mapped,"Popup"]);
 #$l2->bind($event,[\&mapped,"Popup"]);
-begin('Popup');
+begin('Popup',2);
 $t->Popup(-popover => $mw);
 $t->update;
-begin('withdraw');
+begin('withdraw',0);
 $t->withdraw;
-begin('Popup Again');
+begin('Popup Again',2);
 $t->Popup(-popover => $mw);
 
-$mw->after(1000, sub { begin('destroy'); $mw->destroy });
+$mw->after(1000, sub { begin('destroy',0); $mw->destroy });
 
 MainLoop;
 
@@ -46,8 +53,11 @@
  my ($w) = @_;
  my $now = Tk::timeofday();
  my $delay = $now - $start;
- printf "# %s $why %.3g\n",$w->PathName,$delay;
- ok($delay < 0.5,$why);
+ printf "# %s $why %.3g $expect\n",$w->PathName,$delay;
+ if ($expect-- > 0)
+  {
+   ok($delay < 0.5,$why);
+  }
 }
 
 
__END_OF_PATCH__
