# $Id: Portfile,v 1.3 2006/03/31 18:48:42 matt Exp $

PortSystem 1.0
name		gtk26
version		2.6.8
categories	x11
maintainers	teus@teusbenschop.nl
description	Gimp ToolKit version 2.6.8
homepage	http://www.gtk.org/
platforms	darwin

long_description This is GTK+ version 2.6.8. GTK+, which stands for Gimp \
		 ToolKit, is a library for creating GUIs for the X \
		 Windows System. This version of GTK+ doesn't use cairo.

master_sites	gnome:sources/gtk+/2.6

distname	gtk+-${portversion}
checksums	md5 535fa4b62d219445b99953f679b5cf8e

use_bzip2	yes

depends_lib	lib:libglib.2:glib2 lib:libtiff.3:tiff lib:libpng12.0:libpng \
		lib:libatk-1:atk lib:libpango.1:pango lib:libintl.3:gettext \
		lib:libX11.6:XFree86

configure.env	LDFLAGS="-L${prefix}/lib -lpango-1.0" \
		CPPFLAGS="-I${prefix}/include -no-cpp-precomp -DX_LOCALE" \
		CFLAGS="-O3 -funroll-loops -fstrict-aliasing"

configure.args	--disable-shm --disable-gtk-doc --with-included-loaders \
		--mandir=${prefix}/share/man

build.args	CFLAGS+="-I${x11prefix}/include"

platform darwin 6 { patchfiles-append patch-gtk-xdgmime-xdgmimemagic.c }

platform darwin 8 { patchfiles-append patch-gtk-xdgmime-xdgmimecache.c }

post-patch	{ reinplace "s|xdg_data_dirs = \"/usr|xdg_data_dirs = \"${prefix}/share:/usr|g" ${worksrcpath}/gtk/xdgmime/xdgmime.c
		  reinplace "s|g_strdup (\"/usr|g_strdup (\"${prefix}|g" ${worksrcpath}/gtk/gtkicontheme.c }

post-destroot	{ system "install -d -m 755 ${destroot}${prefix}/etc/gtk-2.0"
		  system "cp ${filespath}/gdk-pixbuf.loaders ${destroot}${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
		  reinplace "s|__PREFIX__|${prefix}|g" "${destroot}/${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders"
		  system "env LANG=C DYLD_LIBRARY_PATH=${destroot}${prefix}/lib ${destroot}${prefix}/bin/gtk-query-immodules-2.0 > ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules" }
