Installing Gtk2 on my macbook

Note that I no longer use darwin ports to get GTK, instead I go to the GTK+ OS X Framework site, and get their latest package, wich comes as a self contained DMG and seems to work fine.

I have had my macbook for two days, so I am new to all this. I have installed Xcode, which came as a dmg file, and that was dead simple. Now I am eager to get gtk2, and Darwinports has a very up to date version (2.12.9, which is more recent than the 2.12.8 on my up to date Fedora Core 8 linux machine). I follow the instructions to install darwinports, then do the following. I am astounded by the multitude of supporting packages. (It fetches them all from the penultimate sites, and builds them for me, not what I would have expected.) I go home and leave it running. In the morning it seems to have happily finished, with the trail of activity appended at the end of this page.

It even installs perl-5.8.8 !!

I then procede to build my gtk2 application, which goes smoothly, until I try to actually run the application, at which point I get a "cannot open display :0.0" error. This is easily fixed by removing the line which sets the display variable in my .profile file. I am told that with Leopard (Mac OSx 10.5), the DISPLAY environment variable will be magically set to some pipe in /tmp and this will just work (and in fact it does!) if you don't screw with it. In other words the advice to set DISPLAY for darwinports is just out of date information for Leopard. In fact, this seems to be really nice in that Leopard will start the X server as needed if this pipe scheme is used.

It just works, pretty cool. No need to install X11 (or even start X11).

osx:~ tom$ sudo port install gtk2
--->  Fetching expat
--->  Attempting to fetch expat-2.0.1.tar.gz from http://downloads.sourceforge.net/expat
--->  Verifying checksum(s) for expat
--->  Extracting expat
--->  Configuring expat
--->  Building expat with target all
--->  Staging expat into destroot
--->  Installing expat 2.0.1_0
--->  Activating expat 2.0.1_0
--->  Cleaning expat
--->  Fetching gperf
--->  Attempting to fetch gperf-3.0.3.tar.gz from http://ftp.gnu.org/gnu/gperf
--->  Verifying checksum(s) for gperf
--->  Extracting gperf
--->  Configuring gperf
--->  Building gperf with target all
--->  Staging gperf into destroot
--->  Installing gperf 3.0.3_0
--->  Activating gperf 3.0.3_0
--->  Cleaning gperf
--->  Fetching libiconv
--->  Attempting to fetch libiconv-1.12.tar.gz from http://ftp.gnu.org/gnu/libiconv
--->  Verifying checksum(s) for libiconv
--->  Extracting libiconv
--->  Applying patches to libiconv
--->  Configuring libiconv
--->  Building libiconv with target all
--->  Staging libiconv into destroot
--->  Installing libiconv 1.12_0
--->  Activating libiconv 1.12_0
--->  Cleaning libiconv
--->  Fetching ncursesw
--->  Attempting to fetch ncurses-5.6.tar.gz from http://ftp.gnu.org/gnu/ncurses
--->  Verifying checksum(s) for ncursesw
--->  Extracting ncursesw
--->  Applying patches to ncursesw
--->  Configuring ncursesw
--->  Building ncursesw with target all
--->  Staging ncursesw into destroot
--->  Installing ncursesw 5.6_1
--->  Activating ncursesw 5.6_1
--->  Cleaning ncursesw
--->  Fetching ncurses
--->  Verifying checksum(s) for ncurses
--->  Extracting ncurses
--->  Applying patches to ncurses
--->  Configuring ncurses
--->  Building ncurses with target all
--->  Staging ncurses into destroot
--->  Installing ncurses 5.6_0
--->  Activating ncurses 5.6_0
--->  Cleaning ncurses
--->  Fetching gettext
--->  Attempting to fetch gettext-0.17.tar.gz from http://ftp.gnu.org/gnu/gettext
--->  Verifying checksum(s) for gettext
--->  Extracting gettext
--->  Applying patches to gettext
--->  Configuring gettext
--->  Building gettext with target all
--->  Staging gettext into destroot
--->  Installing gettext 0.17_3
--->  Activating gettext 0.17_3
--->  Cleaning gettext
--->  Fetching pkgconfig
--->  Attempting to fetch pkg-config-0.23.tar.gz from http://pkg-config.freedesktop.org/releases/
--->  Verifying checksum(s) for pkgconfig
--->  Extracting pkgconfig
--->  Configuring pkgconfig
--->  Building pkgconfig with target all
--->  Staging pkgconfig into destroot
--->  Installing pkgconfig 0.23_0
--->  Activating pkgconfig 0.23_0
--->  Cleaning pkgconfig
--->  Fetching glib2
--->  Attempting to fetch glib-2.16.3.tar.bz2 from ftp://ftp.gtk.org/pub/glib/2.16/
--->  Attempting to fetch glib-2.16.3.tar.bz2 from http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/glib/2.16/
--->  Verifying checksum(s) for glib2
--->  Extracting glib2
--->  Applying patches to glib2
--->  Configuring glib2
--->  Building glib2 with target all
--->  Staging glib2 into destroot
--->  Installing glib2 2.16.3_0+darwin_9
--->  Activating glib2 2.16.3_0+darwin_9
--->  Cleaning glib2
--->  Fetching atk
--->  Attempting to fetch atk-1.22.0.tar.bz2 from http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/atk/1.22/
--->  Verifying checksum(s) for atk
--->  Extracting atk
--->  Configuring atk
--->  Building atk with target all
--->  Staging atk into destroot
--->  Installing atk 1.22.0_1
--->  Activating atk 1.22.0_1
--->  Cleaning atk
--->  Fetching zlib
--->  Attempting to fetch zlib-1.2.3.tar.bz2 from http://www.zlib.net/
--->  Verifying checksum(s) for zlib
--->  Extracting zlib
--->  Applying patches to zlib
--->  Configuring zlib
--->  Building zlib with target all
--->  Staging zlib into destroot
--->  Installing zlib 1.2.3_1
--->  Activating zlib 1.2.3_1
--->  Cleaning zlib
--->  Fetching freetype
--->  Attempting to fetch freetype-2.3.5.tar.bz2 from http://download.savannah.gnu.org/releases/freetype/
--->  Verifying checksum(s) for freetype
--->  Extracting freetype
--->  Applying patches to freetype
--->  Configuring freetype
--->  Building freetype with target all
--->  Staging freetype into destroot
--->  Installing freetype 2.3.5_1
--->  Activating freetype 2.3.5_1
--->  Cleaning freetype
--->  Fetching fontconfig
--->  Attempting to fetch fontconfig-2.6.0.tar.gz from http://fontconfig.org/release/
--->  Verifying checksum(s) for fontconfig
--->  Extracting fontconfig
--->  Configuring fontconfig
--->  Building fontconfig with target all
--->  Staging fontconfig into destroot
--->  Installing fontconfig 2.6.0_0+macosx
--->  Activating fontconfig 2.6.0_0+macosx
--->  Cleaning fontconfig
--->  Fetching libpixman
--->  Attempting to fetch pixman-0.10.0.tar.bz2 from http://www.x.org/pub/individual/lib/
--->  Verifying checksum(s) for libpixman
--->  Extracting libpixman
--->  Configuring libpixman
--->  Building libpixman with target all
--->  Staging libpixman into destroot
--->  Installing libpixman 0.10.0_0
--->  Activating libpixman 0.10.0_0
--->  Cleaning libpixman
--->  Fetching libpng
--->  Attempting to fetch libpng-1.2.29.tar.bz2 from http://downloads.sourceforge.net/libpng
--->  Verifying checksum(s) for libpng
--->  Extracting libpng
--->  Configuring libpng
--->  Building libpng with target all
--->  Staging libpng into destroot
--->  Installing libpng 1.2.29_0
--->  Activating libpng 1.2.29_0
--->  Cleaning libpng
--->  Fetching render
--->  Attempting to fetch renderext-0.9.tar.bz2 from http://xlibs.freedesktop.org/release/
--->  Verifying checksum(s) for render
--->  Extracting render
--->  Configuring render
--->  Building render with target all
--->  Staging render into destroot
--->  Installing render 0.9_1
--->  Activating render 0.9_1
--->  Cleaning render
--->  Fetching xrender
--->  Attempting to fetch libXrender-0.9.0.tar.bz2 from http://xlibs.freedesktop.org/release/
--->  Verifying checksum(s) for xrender
--->  Extracting xrender
--->  Configuring xrender
--->  Building xrender with target all
--->  Staging xrender into destroot
--->  Installing xrender 0.9.0_2
--->  Activating xrender 0.9.0_2
--->  Cleaning xrender
--->  Fetching cairo
--->  Attempting to fetch cairo-1.6.4.tar.gz from http://cairographics.org/releases/
--->  Verifying checksum(s) for cairo
--->  Extracting cairo
--->  Configuring cairo
--->  Building cairo with target all
--->  Staging cairo into destroot
--->  Installing cairo 1.6.4_0
--->  Activating cairo 1.6.4_0
--->  Cleaning cairo
--->  Fetching jpeg
--->  Attempting to fetch jpegsrc.v6b.tar.gz from http://www.ijg.org/files
--->  Attempting to fetch droppatch.tar.gz from http://sylvana.net/jpegcrop/
--->  Verifying checksum(s) for jpeg
--->  Extracting jpeg
--->  Applying patches to jpeg
--->  Configuring jpeg
--->  Building jpeg with target all
--->  Staging jpeg into destroot
--->  Installing jpeg 6b_2
--->  Activating jpeg 6b_2
--->  Cleaning jpeg
--->  Fetching xorg-util-macros
--->  Attempting to fetch util-macros-1.1.5.tar.bz2 from http://www.x.org/pub/individual/util/
--->  Verifying checksum(s) for xorg-util-macros
--->  Extracting xorg-util-macros
--->  Configuring xorg-util-macros
--->  Building xorg-util-macros with target all
--->  Staging xorg-util-macros into destroot
--->  Installing xorg-util-macros 1.1.5_0
--->  Activating xorg-util-macros 1.1.5_0
--->  Cleaning xorg-util-macros
--->  Fetching xorg-xproto
--->  Attempting to fetch xproto-7.0.11.tar.bz2 from http://www.x.org/pub/individual/proto/
--->  Verifying checksum(s) for xorg-xproto
--->  Extracting xorg-xproto
--->  Applying patches to xorg-xproto
--->  Configuring xorg-xproto
--->  Building xorg-xproto with target all
--->  Staging xorg-xproto into destroot
--->  Installing xorg-xproto 7.0.11_1
--->  Activating xorg-xproto 7.0.11_1
--->  Cleaning xorg-xproto
--->  Fetching Xft2
--->  Attempting to fetch libXft-2.1.12.tar.bz2 from http://xorg.freedesktop.org/releases/individual/lib/
--->  Verifying checksum(s) for Xft2
--->  Extracting Xft2
--->  Configuring Xft2
--->  Building Xft2 with target all
--->  Staging Xft2 into destroot
--->  Installing Xft2 2.1.12_0
--->  Activating Xft2 2.1.12_0
--->  Cleaning Xft2
--->  Fetching pango
--->  Attempting to fetch pango-1.20.3.tar.bz2 from http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/pango/1.20
--->  Verifying checksum(s) for pango
--->  Extracting pango
--->  Applying patches to pango
--->  Configuring pango
--->  Building pango with target all
--->  Staging pango into destroot
--->  Installing pango 1.20.3_0
--->  Activating pango 1.20.3_0
--->  Cleaning pango
--->  Fetching libxml2
--->  Attempting to fetch libxml2-2.6.32.tar.gz from ftp://fr.rpmfind.net/pub/libxml/
--->  Verifying checksum(s) for libxml2
--->  Extracting libxml2
--->  Configuring libxml2
--->  Building libxml2 with target all
--->  Staging libxml2 into destroot
--->  Installing libxml2 2.6.32_0
--->  Activating libxml2 2.6.32_0
--->  Cleaning libxml2
--->  Fetching perl5.8
--->  Attempting to fetch perl-5.8.8.tar.bz2 from http://www.cpan.org/src/5.0/
--->  Verifying checksum(s) for perl5.8
--->  Extracting perl5.8
--->  Applying patches to perl5.8
--->  Configuring perl5.8
--->  Building perl5.8 with target all
--->  Staging perl5.8 into destroot
--->  Installing perl5.8 5.8.8_2+darwin_9
--->  Activating perl5.8 5.8.8_2+darwin_9
--->  Cleaning perl5.8
--->  Fetching p5-xml-parser
--->  Attempting to fetch XML-Parser-2.36.tar.gz from http://ftp.ucr.ac.cr/Unix/CPAN/modules/by-module/XML
--->  Verifying checksum(s) for p5-xml-parser
--->  Extracting p5-xml-parser
--->  Configuring p5-xml-parser
--->  Building p5-xml-parser with target all
--->  Staging p5-xml-parser into destroot
--->  Installing p5-xml-parser 2.36_0
--->  Activating p5-xml-parser 2.36_0
--->  Cleaning p5-xml-parser
--->  Fetching shared-mime-info
--->  Attempting to fetch shared-mime-info-0.23.tar.bz2 from http://people.freedesktop.org/~hadess/
--->  Verifying checksum(s) for shared-mime-info
--->  Extracting shared-mime-info
--->  Applying patches to shared-mime-info
--->  Configuring shared-mime-info
--->  Building shared-mime-info with target all
--->  Staging shared-mime-info into destroot
--->  Installing shared-mime-info 0.23_2
--->  Activating shared-mime-info 0.23_2
--->  Cleaning shared-mime-info
--->  Fetching tiff
--->  Attempting to fetch tiff-3.8.2.tar.gz from ftp://ftp.remotesensing.org/pub/libtiff/
--->  Verifying checksum(s) for tiff
--->  Extracting tiff
--->  Configuring tiff
--->  Building tiff with target all
--->  Staging tiff into destroot
--->  Installing tiff 3.8.2_1+darwin_9+macosx
--->  Activating tiff 3.8.2_1+darwin_9+macosx
--->  Cleaning tiff
--->  Fetching gtk2
--->  Attempting to fetch gtk+-2.12.9.tar.bz2 from http://mandril.creatis.insa-lyon.fr/linux/gnome.org/sources/gtk+/2.12/
--->  Verifying checksum(s) for gtk2
--->  Extracting gtk2
--->  Applying patches to gtk2
--->  Configuring gtk2
--->  Building gtk2 with target all
--->  Staging gtk2 into destroot
--->  Installing gtk2 2.12.9_0+x11
--->  Activating gtk2 2.12.9_0+x11
--->  Cleaning gtk2
osx:~ tom$ 

Have any comments? Questions? Drop me a line!

Adventures in Computing / [email protected]