Running ddd on Mac OS X

So I think Mac OS X 10.7.5. ships with XQuartz (it's only 10.8 and later that does not come with the installation).

Here's what eventually worked for me:

The unbrewed dylibs, header files, .pc files, and static libraries were placed there by a non-homebrew installation of R so I uninstalled R using the following commands:

rm -rf /Library/Frameworks/R.framework /Applications/R.app \
/usr/bin/R /usr/bin/Rscript

I then uninstalled ddd, unlinked lesstif, and uninstalled lesstif:

brew uninstall ddd
brew unlink lesstif
brew uninstall lesstif

Next, I installed tcl-tk:

brew tap homebrew/dupes
brew install tcl-tk

Then I built lesstif from source with brew install:

brew install --build-from-source lesstif

I relinked lesstif:

brew unlink lesstif && brew link lesstif

Finally, I installed ddd:

brew install ddd

And it worked! I'm not sure which one of these steps was the key step, but I'm guessing it was:

brew install --build-from-source lesstif

I'm still not sure what these two do differently:

brew install --build-from-source lesstif
brew install lesstif

I also looked for the following directory and files:

/opt/X11/lib/libSM.6.dylib exist

but they did not exist on my computer.

@new-host:~$ cd ~
@new-host:~$ cd /opt
-bash: cd: /opt: No such file or directory

Instead I found the X11 files in here:

@new-host:/usr/X11$ cd ~
@new-host:~$ cd /usr/X11/lib
@new-host:/usr/X11/lib$ ls
...
libSM.6.dylib
...

I think I could have solved this problem using some sort of symbolic link, but not entirely sure.

Finally, those unbrewed dylibs, header files, .pc files, and static libraries were placed there by a non-homebrew installation of R. But I'm not sure there is actually any way to safely remove them so as to eliminate the brew doctor warnings. (I probably will have to live with them).

The R installation consisted of three Apple packages:

org.r-project.R.x86_64.fw.pkg
org.r-project.R.x86_64.GUI.pkg
org.r-project.x86_64.tcltk.x11

Per the R website (http://cran.r-project.org/doc/manuals/r-release/R-admin.html#Uninstalling-under-OS-X): You can use pkgutil --unlink (not supported by Lion or later) to remove their files or pkgutil --forget if you want the Apple Installer to forget about the package without deleting its files (useful for the R framework when installing multiple R versions in parallel), or after you have deleted the files

Uninstalling the Tcl/Tk component (which is installed under /usr/local) is not simple. You can list the files it installed in a Terminal by

pkgutil --files org.r-project.x86_64.tcltk.x11

A bit too scary for me to tackle that removal so will live with the brew doctor warnings. Just happy that ddd finally worked.