Gtk2 version 2.18.2 - How to Download and Install on Mac OS X
Saturday the 21st of November, 2009

    version 2.18.2

      View the most recent changes for the gtk2 port at: gtk2.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for gtk2.
      The raw portfile for gtk2 2.18.2 is located here:
      http://gtk2.darwinports.com/dports/x11/gtk2/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/gtk2


      # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
      The gtk2 Portfile 58949 2009-10-07 18:39:38Z devans macports.org $

      PortSystem 1.0
      PortGroup muniversal 1.0

      Name: gtk2
      Version: 2.18.2
      set branch [join [lrange [split ${version} .] 0 1] .]
      Category: x11
      Maintainers: nox openmaintainer
      Platform: darwin
      Description: Gimp ToolKit version 2

      Long Description: This is GTK+ version 2.x. GTK+, which stands for Gimp ToolKit, is a library for creating GUIs for the X Windows System.

      Homepage: http://www.gtk.org/
      distname gtk+-${version}
      use_bzip2 yes

      Master Sites: gnome:sources/gtk+/${branch}/ ftp://ftp.gtk.org/pub/gtk/${branch}/ http://ftp.gtk.org/pub/gtk/${branch}/

      if {[variant_isset no_x11]} {
      default_variants +quartz
      }

      if {![variant_isset quartz]} {
      default_variants +x11
      }

      pre-fetch {
      if {![variant_isset quartz] && ![variant_isset x11]} {
      error "Either +x11 or +quartz is required"
      }

      if {[rpm-vercomp ${os.version} 9.0] >= 0} {
      set minimum_xcodeversion 3.1
      set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
      if {[rpm-vercomp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
      ui_error "You have Xcode ${current_xcodeversion}. Please update to at least Xcode ${minimum_xcodeversion}."
      error "Please update Xcode."
      }
      }

      if {[variant_isset quartz]} {
      if {![file exists ${prefix}/include/cairo/cairo-quartz.h]} {
      error "cairo must be built with the +quartz variant enabled."
      }
      } elseif {![file exists ${prefix}/include/cairo/cairo-xlib.h]} {
      error "cairo must be built without the +no_x11 variant."
      }
      }

      Checksums: md5 9477986b58d7ee5e559b96e7a124bead sha1 f33b9c67541de024fa3867ab41de3e25ec6d52d4 rmd160 c5efa81dadc75c87bc9c7c2725b193f88779b06f

      Patch Files: patch-gtk-builder-convert.diff patch-modules-gail.diff patch-modules-printbackends.diff patch-which-gtkdoc-rebase.diff

      depends_build port:pkgconfig

      depends_lib path:lib/pkgconfig/cairo.pc:cairo port:fontconfig port:freetype path:lib/pkgconfig/glib-2.0.pc:glib2 port:jpeg port:tiff port:libiconv port:libpng port:jasper port:atk path:lib/pkgconfig/pango.pc:pango port:gettext port:zlib

      depends_run port:shared-mime-info

      configure.args --enable-static --disable-glibtest

      if { [variant_isset universal] } {
      if {[info exists universal_sysroot]} {
      configure.env-append CUPS_CONFIG="${universal_sysroot}/usr/bin/cups-config"
      } else {
      configure.env-append CUPS_CONFIG="/usr/bin/cups-config"
      }

      # cups is not 32/64-bit universal on Tiger.
      if {${os.major} == "8"} {
      set merger_configure_args(ppc64) --disable-cups
      set merger_configure_args(x86_64) --disable-cups
      }

      # Find architectures which will not run on build platform.
      if { ${os.arch}=="i386" } {
      if { ${os.major} >= 10 } {
      set cross_archs "ppc ppc64"
      } else {
      set cross_archs "ppc64"
      }
      set host_archs "ppc ppc64"
      } else {
      set cross_archs "i386 x86_64"
      set host_archs "i386 x86_64"
      }

      set run_arch [lindex ${universal_archs} 0]
      if { [lsearch ${cross_archs} ${run_arch}] >= 0 } {
      ui_msg "When building a universal binary of ${name}, make sure none of {${cross_archs}} is first in universal_archs in ${prefix}/etc/macports/macports.conf"
      error "incompatible universal_archs value"
      }

      foreach arch ${host_archs} {
      lappend merger_configure_env(${arch}) NM='/usr/bin/nm -p'
      }

      foreach arch ${cross_archs} {
      lappend merger_configure_env(${arch}) gio_can_sniff=yes GTK_UPDATE_ICON_CACHE=${worksrcpath}-${run_arch}/gtk/gtk-update-icon-cache GDK_PIXBUF_CSOURCE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf-csource
      lappend merger_build_env(${arch}) GDK_PIXBUF_MODULE_FILE=${worksrcpath}-${run_arch}/gdk-pixbuf/gdk-pixbuf.loaders
      }

      post-configure {
      # Let gtk_host in .pc files be the same on all architectures
      foreach arch ${host_archs} {
      if { [lsearch ${universal_archs_to_use} ${arch}] >= 0 } {
      foreach pc [glob -directory ${worksrcpath}-${arch} *.pc.in] {
      if { ${os.arch}=="i386" } {
      reinplace "s|gtk_host= host |gtk_host=i686-apple-darwin${os.version}|" ${pc}
      } else {
      reinplace "s|gtk_host= host |gtk_host=powerpc-apple-darwin${os.version}|" ${pc}
      }
      }
      }
      }
      }
      }

      configure.ccache no
      configure.cppflags-append -DX_LOCALE
      configure.cflags-append -fstrict-aliasing

      use_parallel_build yes

      test.run yes
      test.target check

      post-destroot {
      set docdir ${prefix}/share/doc/gtk+-${version}
      xinstall -d ${destroot}${docdir}
      xinstall -m 644 -W ${worksrcpath} AUTHORS COPYING HACKING NEWS README ${destroot}${docdir}

      ui_debug "Creating gtk.immodules..."
      system "DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/gtk-query-immodules-2.0 ${destroot}${prefix}/lib/gtk-2.0/2.10.0/immodules/*.so >${destroot}${prefix}/etc/gtk-2.0/gtk.immodules"
      reinplace "s|${destroot}||" ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules
      }

      post-activate {
      ui_debug "Updating gdk-pixbuf.loaders..."
      system "${prefix}/bin/gdk-pixbuf-query-loaders >${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
      }

      platform darwin 7 {
      configure.args-append --disable-cups
      }

      platform darwin 8 {
      if {[variant_isset quartz] || [variant_isset no_x11]} {
      configure.ldflags-append -framework Cocoa -framework Carbon
      }
      }

      Variant: no_x11 {
      pre-fetch {
      if {[file exists ${prefix}/lib/libpangox-1.0.dylib]} {
      ui_error "Please uninstall or deactivate the pango port and reinstall it by running `port install pango +no_x11`."
      error "pango must be installed with the no_x11 variant enabled."
      }
      }
      }

      Variant: quartz requires no_x11 conflicts x11 description {Enable Quartz rendering} {
      patchfiles-append patch-gnome-bug-531599.diff
      configure.args-append --with-gdktarget=quartz
      }

      Variant: x11 conflicts quartz description {Enable rendering in X11} {
      depends_lib-append port:xorg-libXi port:xorg-libXrandr port:xorg-libXcursor port:xorg-libXinerama port:xorg-libXdamage port:xorg-libXcomposite port:xorg-libXfixes

      configure.args-append --with-xinput --enable-xinerama --x-include=${prefix}/include --x-lib=${prefix}/lib
      }

      livecheck.type regex
      livecheck.url ftp://ftp.gnome.org/pub/gnome/sources/gtk+/${branch}/
      livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/gtk2
      % sudo port install gtk2
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching gtk2
      ---> Verifying checksum for gtk2
      ---> Extracting gtk2
      ---> Configuring gtk2
      ---> Building gtk2 with target all
      ---> Staging gtk2 into destroot
      ---> Installing gtk2
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using gtk2 with these commands:
      %  man gtk2
      % apropos gtk2
      % which gtk2
      % locate gtk2

     Where to find more information:

    Darwin Ports



    Lightbox this page.