diff -u insight-6.7.1.dfsg.1/debian/rules insight-6.7.1.dfsg.1/debian/rules
--- insight-6.7.1.dfsg.1/debian/rules
+++ insight-6.7.1.dfsg.1/debian/rules
@@ -29,12 +29,12 @@
 	# Add here commands to configure the package.
 	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info \
 	--enable-gdbtk \
-	--with-tclinclude=/usr/include/tcl8.4/tcl-private \
-	--with-tclconfig=/usr/lib/tcl8.4 \
-	--with-tkinclude=/usr/include/tcl8.4/tk-private \
-	--with-tkconfig=/usr/lib/tk8.4 \
-	--with-itclconfig=/usr/share/tcltk/itcl3.2 \
-	--with-itkconfig=/usr/share/tcltk/itk3.2 \
+	--with-tclinclude=/usr/include/tcl8.5/tcl-private \
+	--with-tclconfig=/usr/lib/tcl8.5 \
+	--with-tkinclude=/usr/include/tcl8.5/tk-private \
+	--with-tkconfig=/usr/lib/tk8.5 \
+	--with-itclconfig=$$(ls -d /usr/share/tcltk/itcl*) \
+	--with-itkconfig=$$(ls -d /usr/share/tcltk/itk*) \
 	--enable-sim
 
 
diff -u insight-6.7.1.dfsg.1/debian/changelog insight-6.7.1.dfsg.1/debian/changelog
--- insight-6.7.1.dfsg.1/debian/changelog
+++ insight-6.7.1.dfsg.1/debian/changelog
@@ -1,3 +1,10 @@
+insight (6.7.1.dfsg.1-10.2) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Switched to Tcl/Tk 8.5 to match changes in itcl3 and itk3 packages.
+
+ -- Sergei Golovan <sgolovan@debian.org>  Thu, 03 Sep 2009 16:40:51 +0400
+
 insight (6.7.1.dfsg.1-10.1) unstable; urgency=medium
 
   * Non-maintainer upload.
diff -u insight-6.7.1.dfsg.1/debian/control insight-6.7.1.dfsg.1/debian/control
--- insight-6.7.1.dfsg.1/debian/control
+++ insight-6.7.1.dfsg.1/debian/control
@@ -2,7 +2,7 @@
 Section: devel
 Priority: optional
 Maintainer: Masayuki Hatta (mhatta) <mhatta@debian.org>
-Build-Depends: autotools-dev, binutils-dev, bison, debhelper (>> 4.0.0), dpatch, flex, itcl3-dev, itk3-dev, iwidgets4, libkvm-dev [kfreebsd-amd64 kfreebsd-i386], libncurses-dev, texinfo, tcl8.4-dev, tk8.4-dev
+Build-Depends: autotools-dev, binutils-dev, bison, debhelper (>> 4.0.0), dpatch, flex, itcl3-dev (>= 3.3), itk3-dev (>= 3.3), iwidgets4, libkvm-dev [kfreebsd-amd64 kfreebsd-i386], libncurses-dev, texinfo, tcl8.5-dev, tk8.5-dev
 Standards-Version: 3.8.0
 
 Package: insight
diff -u insight-6.7.1.dfsg.1/debian/patches/00list insight-6.7.1.dfsg.1/debian/patches/00list
--- insight-6.7.1.dfsg.1/debian/patches/00list
+++ insight-6.7.1.dfsg.1/debian/patches/00list
@@ -4,0 +5 @@
+05_build_fix_for_tcl8.5
only in patch2:
unchanged:
--- insight-6.7.1.dfsg.1.orig/debian/patches/05_build_fix_for_tcl8.5.dpatch
+++ insight-6.7.1.dfsg.1/debian/patches/05_build_fix_for_tcl8.5.dpatch
@@ -0,0 +1,97 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 05_build_fix_for_tcl8.5.dpatch by Sergei Golovan <sgolovan@debian.org>
+
+## DP: Build fix for Tcl8.5
+## DP: 1) Don't build internal tcl, tk, itcl because external ones are used
+## DP: 2) Fixed combobox version in pkgIndex.tcl as Tcl 8.5 has stricter rules
+## DP: 3) Added /usr/include/tcl8.5/itcl-private and /usr/include/tcl8.5/itk-private
+## DP:    to Itcl and Itk headers search paths, otherwise internal were found
+## DP: 4) Added a hack redefining XCALLOC and XMALLOC in gdb/gdbtk/generic/gdbtk.c
+## DP:    because of similar macros with the same names in Tcl 8.5 headers.
+
+@DPATCH@
+--- insight-6.7.1.dfsg.1.orig/configure.ac
++++ insight-6.7.1.dfsg.1/configure.ac
+@@ -154,7 +154,7 @@
+ 
+ # these libraries are used by various programs built for the host environment
+ #
+-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr"
++host_libs="intl mmalloc libiberty opcodes bfd readline libgui zlib libcpp libdecnumber gmp mpfr"
+ 
+ # these tools are built for the host environment
+ # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
+--- insight-6.7.1.dfsg.1.orig/configure
++++ insight-6.7.1.dfsg.1/configure
+@@ -1843,7 +1843,7 @@
+ 
+ # these libraries are used by various programs built for the host environment
+ #
+-host_libs="intl mmalloc libiberty opcodes bfd readline tcl tk itcl libgui zlib libcpp libdecnumber gmp mpfr"
++host_libs="intl mmalloc libiberty opcodes bfd readline libgui zlib libcpp libdecnumber gmp mpfr"
+ 
+ # these tools are built for the host environment
+ # Note, the powerpc-eabi build depends on sim occurring before gdb in order to
+--- insight-6.7.1.dfsg.1.orig/libgui/library/pkgIndex.tcl
++++ insight-6.7.1.dfsg.1/libgui/library/pkgIndex.tcl
+@@ -8,5 +8,5 @@
+ # script is sourced, the variable $dir must contain the
+ # full path name of this file's directory.
+ 
+-package ifneeded combobox 2.2.1 [list source [file join $dir combobox.tcl]]
++package ifneeded combobox 2.3 [list source [file join $dir combobox.tcl]]
+ package ifneeded debug 1.0 [list source [file join $dir debug.tcl]]
+--- insight-6.7.1.dfsg.1.orig/gdb/acinclude.m4
++++ insight-6.7.1.dfsg.1/gdb/acinclude.m4
+@@ -563,7 +563,7 @@
+ AC_DEFUN([CY_AC_PATH_ITCLH], [
+ AC_MSG_CHECKING(for Itcl private headers. srcdir=${srcdir})
+ if test x"${ac_cv_c_itclh}" = x ; then
+-  for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
++  for i in /usr/include/tcl8.5/itcl-private ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
+     if test -f $i/generic/itcl.h ; then
+       ac_cv_c_itclh=`(cd $i/generic; pwd)`
+       break
+@@ -688,7 +688,7 @@
+ AC_DEFUN([CY_AC_PATH_ITKH], [
+ AC_MSG_CHECKING(for Itk private headers. srcdir=${srcdir})
+ if test x"${ac_cv_c_itkh}" = x ; then
+-  for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
++  for i in /usr/include/tcl8.5/itk-private ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
+     if test -f $i/generic/itk.h ; then
+       ac_cv_c_itkh=`(cd $i/generic; pwd)`
+       break
+--- insight-6.7.1.dfsg.1.orig/gdb/configure
++++ insight-6.7.1.dfsg.1/gdb/configure
+@@ -22679,7 +22679,7 @@
+ echo "$as_me:$LINENO: checking for Itcl private headers. srcdir=${srcdir}" >&5
+ echo $ECHO_N "checking for Itcl private headers. srcdir=${srcdir}... $ECHO_C" >&6
+ if test x"${ac_cv_c_itclh}" = x ; then
+-  for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
++  for i in /usr/include/tcl8.5/itcl-private ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itcl; do
+     if test -f $i/generic/itcl.h ; then
+       ac_cv_c_itclh=`(cd $i/generic; pwd)`
+       break
+@@ -22704,7 +22704,7 @@
+ echo "$as_me:$LINENO: checking for Itk private headers. srcdir=${srcdir}" >&5
+ echo $ECHO_N "checking for Itk private headers. srcdir=${srcdir}... $ECHO_C" >&6
+ if test x"${ac_cv_c_itkh}" = x ; then
+-  for i in ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
++  for i in /usr/include/tcl8.5/itk-private ${srcdir}/../itcl ${srcdir}/../../itcl ${srcdir}/../../../itcl ${srcdir}/../itcl/itk; do
+     if test -f $i/generic/itk.h ; then
+       ac_cv_c_itkh=`(cd $i/generic; pwd)`
+       break
+--- insight-6.7.1.dfsg.1.orig/gdb/gdbtk/generic/gdbtk.c
++++ insight-6.7.1.dfsg.1/gdb/gdbtk/generic/gdbtk.c
+@@ -43,6 +43,11 @@
+ #define HAS_STDARG 1
+ 
+ #include <itcl.h>
++/* HACK: Undefine XMALLOC & XCALLOC because otherwise they are redefined
++   in tclTomMathDecls.h which appears in Tcl 8.5. Fortunately neither
++   XMALLOC nor XCALLOC aren't used below */
++#undef XMALLOC
++#undef XCALLOC
+ #include <itk.h>
+ #include "guitcl.h"
+ #include "gdbtk.h"
