Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
#!/bin/sh
# This file:
# http://angg.twu.net/TCL/tclmagick-patch.sh
# http://angg.twu.net/TCL/tclmagick-patch.sh.html
#         (find-angg "TCL/tclmagick-patch.sh")
# Small patches to make TclMagick compile on Debian Squeeze.
# The full script to download the source from CVS, patch it,
# compile it and test it, is at:
# http://angg.twu.net/tclmagick.html
#           (find-TH "tclmagick")
# Author:  Eduardo Ochs <[email protected]>
# Version: 2011jan14
# Public domain.

# Note that these patches are such a hurried job that they don't even
# change the changelog... so if you just apply them you'll get a .deb
# like this: tclmagick_0.45-1_i386.deb.

# See:
# (find-es "tcl" "tclmagick-build")
# (find-es "tcl" "tclmagick-build2")


# Hunk #1: (find-tclmagickfile "debian/rules")
# Add "--with-tkinclude=/usr/include/tk/"
#
patch -p0 debian/rules <<'%%%'
28c28
< 	./configure --with-tcl=/usr/lib/tcl$(TCLVERSION)/ --with-tk=/usr/lib/tk$(TCLVERSION)/ --with-magick=/usr/bin/Wand-config --enable-threads  --with-tclinclude=/usr/include/tcl$(TCLVERSION)/
---
> 	./configure --with-tcl=/usr/lib/tcl$(TCLVERSION)/ --with-tk=/usr/lib/tk$(TCLVERSION)/ --with-magick=/usr/bin/Wand-config --enable-threads  --with-tclinclude=/usr/include/tcl$(TCLVERSION)/ --with-tkinclude=/usr/include/tk/
%%%


# Hunk #2: (find-tclmagickfile "debian/control")
# Here I took the lazy way and just suppressed the build-dependency on
# "libmagick6-dev"... But I guess that it should be replaced by
# "libmagickwand-dev", because the pages
#   http://packages.debian.org/libmagick9-dev
#   http://packages.ubuntu.com/libmagick9-dev
# say that nowadays libmagick9-dev is just a "virtual package provided
# by libmagickwand-dev"...
#
patch -p0 debian/control <<'%%%'
5c5
< Build-Depends: debhelper (>= 4.0.0), libmagick6-dev, tcl8.4-dev, tk8.4-dev
---
> Build-Depends: debhelper (>= 4.0.0), tcl8.4-dev, tk8.4-dev
%%%


# Hunk #3: (find-tclmagickfile "tests/test-wand.tcl")
# Skip the MontageImage test, that takes too long
# to run (maybe forever). The tests don't go into
# the .deb, but it is instructive to run them from
# the source directory...
#
patch -p0 tests/test-wand.tcl <<'%%%'
133c133
<     MontageImage                seq     1
---
>     MontageImage                seq     0
%%%


# Hunk #4: (find-tclmagickfile "tests/tkmagick.tcl")
# The Debian build process builds these libs elsewhere.
# Replace the "load" by a "package require" to use
# the global ones (after the .deb is installed).
#
patch -p0 tests/tkmagick.tcl <<'%%%'
9,10c9,11
< load [file join $dirname .. generic .libs libTclMagick[info sharedlibextension]]
< load [file join $dirname .. generic .libs libTkMagick[info sharedlibextension]]
---
> # load [file join $dirname .. generic .libs libTclMagick[info sharedlibextension]]
> # load [file join $dirname .. generic .libs libTkMagick[info sharedlibextension]]
> package require TkMagick
%%%