Glib2 version 2.22.2 - How to Download and Install on Mac OS X
Saturday the 20th of March, 2010

    version 2.22.2

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


      The glib2 Portfile 58960 2009-10-07 20:41:44Z ryandesign macports.org $

      PortSystem 1.0

      Name: glib2
      conflicts glib2-devel
      set my_name glib
      Version: 2.22.2
      set branch [join [lrange [split ${version} .] 0 1] .]
      Category: devel
      Maintainers: ryandesign
      license GPLv2
      Homepage: http://www.gtk.org/
      Platform: darwin
      dist_subdir glib2
      distname ${my_name}-${version}
      use_bzip2 yes
      use_parallel_build yes

      Description: Library with data structure functions and other constructs

      Long Description: Glib is a library which includes support routines for C, such as lists, trees, hashes, memory allocation, and many other things.

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

      Checksums: md5 846a86c74b74d5b16826aa5508940f9b sha1 bdd9c4b930e81203ea69fe83876cb6c82bdc5a38 rmd160 77227f8feb61c88f9f7fcff586a59ec38114a73d

      # ${prefix}/include/glib-2.0/glib/gi18n.h requires -I${prefix}/include to find libintl.h
      # See http://trac.macports.org/changeset/27148
      Patch Files: patch-configure.in.diff patch-glib-2.0.pc.in.diff patch-gi18n.h.diff patch-gio_xdgmime_xdgmime.c.diff patch-which.diff

      depends_build port:pkgconfig

      depends_lib port:gettext port:libiconv path:bin/perl:perl5 bin:python:python_select

      use_autoconf yes

      # -lresolv is needed at least on Tiger PPC.
      configure.ldflags-append -lresolv -bind_at_load

      configure.cflags-append -fstrict-aliasing

      configure.args --enable-static

      configure.perl ${prefix}/bin/perl
      configure.env-append PERL_PATH=${configure.perl}

      post-patch {
      reinplace "s|data_dirs = \"/usr|data_dirs = \"${prefix}/share:/usr|g" ${worksrcpath}/glib/gutils.c
      reinplace "s|path = \"/bin|path = \"${prefix}/bin:/bin|g" ${worksrcpath}/glib/gutils.c ${worksrcpath}/glib/gspawn.c
      reinplace "s| PREFIX |${prefix}|g" ${worksrcpath}/gio/xdgmime/xdgmime.c
      }

      post-configure {
      system "ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed"
      }

      platform darwin {
      patchfiles-append patch-child-test.c.diff
      }

      test.run yes
      test.target check

      post-destroot {
      file delete ${destroot}${prefix}/lib/charset.alias
      }

      livecheck.type regex
      livecheck.url http://ftp.gnome.org/pub/GNOME/sources/${my_name}/${branch}/?C=M&O=D
      livecheck.regex ${my_name}-(\[0-9.\]+)\\.tar

    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/glib2
      % sudo port install glib2
      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 glib2
      ---> Verifying checksum for glib2
      ---> Extracting glib2
      ---> Configuring glib2
      ---> Building glib2 with target all
      ---> Staging glib2 into destroot
      ---> Installing glib2
    - 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 glib2 with these commands:
      %  man glib2
      % apropos glib2
      % which glib2
      % locate glib2

     Where to find more information:

    Darwin Ports



    Lightbox this page.