Unable to install Meld via MacPorts 2.0.3 on OSX 10.6.8 I am trying to get Meld onto my OS X 10.6.8 box using MacPorts 2.0.3 and am not having success.

bobk-mbp:opt bobk$ port version
Version: 2.0.3
bobk-mbp:opt bobk$ sudo port install meld
---&gt;  Computing dependencies for meld
---&gt;  Dependencies to be installed: py26-gnome libgnomeui py26-gtk py26-cairo py26-numpy fftw-3 py26-nose py26-distribute python26 py26-py py26-gobject py26-orbit
---&gt;  Building libgnomeui
Error: Target org.macports.build returned: shell command failed (see log for details)
Error: Failed to install libgnomeui
Log for libgnomeui is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_libgnomeui/libgnomeui/main.log
Error: The following dependencies were not installed: py26-gnome libgnomeui py26-gtk py26-cairo py26-numpy fftw-3 py26-nose py26-distribute python26 py26-py py26-gobject py26-orbit
Error: Status 1 encountered during processing.
To report a bug, see &lt;http://guide.macports.org/#project.tickets&gt;


When I look at /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_libgnomeui/libgnomeui/main.log it has a line like...

:error:build Failed to install libgnomeui
:debug:build couldn't open "/System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/tclIndex": no such file or directory
    while executing
"open [file join $dir tclIndex]"
:notice:build Log for libgnomeui is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_gnome_libgnomeui/libgnomeui/main.log


...and that file is indeed missing on my system.  Where do I go from here?  I really want a piece of that Meld goodness.

Why can't MacPorts install meld on my os x 10.6.8 box?
Running mdfind -name tclIndex on Mac OS X 10.6.8 shows that the path to tclIndex is /System/Library/Frameworks/Tcl.framework/Versions/8.5/Resources/Scripts/tclIndex!

Anyway, if there is a pristine MacPorts 2.0.3 system running on Mac OS X 10.6.8, meld gets installed without any (serious) complaints.

The same goes for koffice provided that it can use an older version of libpng (&lt; 1.4); this can be achieved by giving koffice its own fresh MacPorts 2.0.3 system in a custom location, e. g. /opt/macports-koffice.

Try the following Bash script to see if this approach works for your machine as well:

#!/bin/bash

# cat mpmeld
#
# 1. back up the old /opt/local MacPorts system by moving it to ${opt_local_off}
# 2. install a fresh MacPorts 2.0.3 system to /opt/local for building meld 
# 3. install a fresh MacPorts 2.0.3 system to /opt/macports-koffice for building koffice (due to PNG_MAX_UINT error)

# usage: 
# sudo -H -i                                                 # get a root shell to prevent sudo timeout
# /path/to/mpmeld 3&gt;&amp;1 1&gt;&amp;2 2&gt;&amp;3 3&gt;&amp;- | tee mpmeld.log       # swap stdout &amp; stderr to log stderr messages only

# koffice usage:
# /opt/macports-koffice/bin/port contents koffice | grep '/bin/' | nl
# /opt/macports-koffice/bin/kword 2&gt;/dev/null
# /opt/macports-koffice/bin/koconverter --help-all

# See also:
# What does 'Xlib: extension "RANDR" missing on display "/tmp/launch-XXXXXX/:0"' mean?
# https://trac.macports.org/wiki/FAQ#randr

unset CDPATH PATH IFS LC_ALL

IFS=$' \t\n'
LC_ALL=C
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin
export IFS LC_ALL PATH

#if [[ $(id -u) -ne 0 ]]; then
if [[ $(id -u) -ne 0 ]] || [[ "${HOME}" != '/var/root' ]]; then
   echo 'This script must be run as root!' 1&gt;&amp;2
   echo 'To get a root shell to prevent sudo timeout use: sudo -H -i' 1&gt;&amp;2
   exit 1
fi

# prevent idle sleep
pmset noidle &amp;
PMSETPID=$!
pmset -a force sleep 0 displaysleep 0 disksleep 0

sleep 1
usr_local_off="/usr/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
opt_local_off="/opt/local-off-$(date '+%Y-%m-%d-%H_%M_%S')"
opt_macports_koffice_off="/opt/macports-koffice-off-$(date '+%Y-%m-%d-%H_%M_%S')"


tmpDir="$(mktemp -d /tmp/macports.XXXXXX)" || exit 1

trap "
   #set -xv
   cd    # avoid: sudo: cannot get working directory
   [[ -d '${tmpDir}' ]] &amp;&amp; rm -rfv '${tmpDir}'
   [[ -d '${usr_local_off}' ]] &amp;&amp; sudo mv -iv '${usr_local_off}' /usr/local
   kill -TERM ${PMSETPID}
   exit
" EXIT TERM HUP INT QUIT

# make sure /usr/local is not interfering with MacPorts build processes for /opt/local
[[ -d '/usr/local' ]] &amp;&amp; sudo mv -iv /usr/local "${usr_local_off}"

# back up the old MacPorts system
[[ -d '/opt/local' ]] &amp;&amp; sudo mv -iv /opt/local "${opt_local_off}"

# back up /opt/macports-koffice
[[ -d '/opt/macports-koffice' ]] &amp;&amp; sudo mv -iv /opt/macports-koffice "${opt_macports_koffice_off}"


# meld

cd "${tmpDir}" || exit 1

curl -L -O https://distfiles.macports.org/MacPorts/MacPorts-2.0.3-10.6-SnowLeopard.dmg

hdiutil mount MacPorts-2.0.3-10.6-SnowLeopard.dmg
installer -pkg /Volumes/MacPorts-2.0.3/MacPorts-2.0.3.pkg -target "/"
hdiutil unmount /Volumes/MacPorts-2.0.3

port -v selfupdate
port -f install meld

# enable dbus with launchd
launchctl load -w /Library/LaunchDaemons/org.freedesktop.dbus-system.plist
launchctl load -w /Library/LaunchAgents/org.freedesktop.dbus-session.plist


# koffice

# get a fresh MacPorts 2.0.3 install in /opt/macports-koffice for koffice
# note: koffice @1.6.3, Revision 4  requires libpng &lt; 1.4  (due to PNG_MAX_UINT error)

cd "${tmpDir}" || exit 1

# cf. http://guide.macports.org/#installing.macports.source.multiple
unset PATH
export PATH='/bin:/sbin:/usr/bin:/usr/sbin'
curl -L -O https://distfiles.macports.org/MacPorts/MacPorts-2.0.3.tar.bz2
tar -xjf MacPorts-2.0.3.tar.bz2
cd MacPorts-2.0.3 || exit 1
MP_PREFIX='/opt/macports-koffice'
./configure --prefix="${MP_PREFIX}" --with-applications-dir="${MP_PREFIX}/Applications"
make
make install

# get the Portfiles and update the system
/opt/macports-koffice/bin/port -v selfupdate


# see: "How to install an older version of a port", 
# https://trac.macports.org/wiki/howto/InstallingOlderPort

cd "${tmpDir}" || exit 1
svn co -r 71090 http://svn.macports.org/repository/macports/trunk/dports/graphics/libpng
chmod  755 "${tmpDir}"  # avoid error message: could not read "/path/to/Portfile": permission denied
cd libpng || exit 1
/opt/macports-koffice/bin/port install -v +universal
cd "${tmpDir}" || exit 1

/opt/macports-koffice/bin/port -f install koffice

find /Applications/MacPorts /Library/LaunchAgents /Library/LaunchDaemons -name "*.mp_*[[:digit:]]" -delete

exit 0