a project to simplify installation of open source software
on Mac OS X and Darwin
# $Id: Portfile 23053 2007-03-23 20:35:47Z pipping@macports.org $
PortSystem 1.0
name gtk2
version 2.10.11
categories x11
maintainers mij@macports.org
description Gimp ToolKit version 2
homepage http://www.gtk.org/
platforms darwin
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.
master_sites gnome:sources/gtk+/2.10 \
ftp://ftp.gtk.org/pub/gtk/v2.10 \
http://ftp.gtk.org/pub/gtk/v2.10
distname gtk+-${version}
checksums md5 3b32eab43bf5195d981867d25ba55d66 \
sha1 3c68f3fa13ab72f6b190cbe958813d29955042e2 \
rmd160 2c1297ace8c6893fdf6e682e7f7faabdb1866b3a
use_bzip2 yes
depends_lib port:glib2 port:tiff port:libpng port:atk port:pango \
port:gettext lib:libX11.6:XFree86
pre-configure {
if {[variant_isset quartz]} {
if { ![file exists ${prefix}/include/cairo/cairo-quartz.h] } {
ui_msg "\nYou must first build cairo with the quartz variant enabled. Please\nuninstall (or deactivate) the cairo port and reinstall by running:\n\n\"port install cairo +quartz\"\n"
exit 1
}
}
if {[file exists ${prefix}/bin/cups-config]} {
ui_msg "\nThe cups-headers port may prevent building this port. Please uninstall\n(or deactivate) cups-headers and restart the build.\n"
exit 1
}
}
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 }
variant quartz { configure.args-append --with-gdktarget=quartz }
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}/lib/gtk-2.0/2.10.0/immodules/*.so | sed -e 's|${destroot}||g' > ${destroot}${prefix}/etc/gtk-2.0/gtk.immodules" }
post-activate { system "gdk-pixbuf-query-loaders ${prefix}/lib/gtk-2.0/2.10.0/loaders/*.so > ${prefix}/etc/gtk-2.0/gdk-pixbuf.loaders" }