# $Id: Portfile 54943 2009-08-04 23:07:35Z devans@macports.org $

PortSystem          1.0

name                pidgin
version             2.5.8
categories          net
platforms           darwin
maintainers         simon openmaintainer
description         Multi-protocol Instant Messaging client
long_description    Pidgin is an Open Source clone of America OnLine's \
                    Instant Messenger client that uses GTK+ version 2.  It \
                    features multiple groups, group chat, user information \
                    fetching and registration, time stamping, and more.  It \
                    also supports other IM protocols, including Yahoo!, MSN, \
                    ICQ, Jabber, Napster, IRC, and Zephyr via included \
                    plugins.

homepage            http://www.pidgin.im/
master_sites        sourceforge
checksums           md5     c207407dca71c6357c82135875e472f0 \
                    sha1    672f7e16c429c210f33f2499520c436db4e2384c \
                    rmd160  b13108331a3da1639f30a76984c3c09529b7d5aa
use_bzip2           yes

depends_build       port:libtool

depends_lib         port:audiofile \
                    port:dbus \
                    port:dbus-glib \
                    port:gtk2 \
                    port:gconf \
                    port:libao \
                    port:libxml2 \
                    port:nspr \
                    port:nss \
                    port:p5-xml-parser \
                    port:intltool

configure.args      --disable-avahi \
                    --disable-consoleui \
                    --disable-gstreamer \
                    --disable-gtkspell \
                    --disable-meanwhile \
                    --disable-nm \
                    --disable-screensaver \
                    --disable-sm \
                    --disable-startup-notification \
                    --disable-schemas-install \
                    --enable-nss \
                    --mandir=${prefix}/share/man \
                    --with-nspr-includes=${prefix}/include/nspr \
                    --with-nspr-libs=${prefix}/lib/nspr \
                    --with-nss-includes=${prefix}/include/nss \
                    --with-nss-libs=${prefix}/lib/nss
configure.ldflags-append    -bind_at_load
configure.cppflags-append   -no-cpp-precomp

post-build {
    # Don't install perllocal.pod as it collides with other ports.
    system "cd ${worksrcpath}; patch -p0 < ${filespath}/patch-perllocal.pod.diff"
}

post-activate {
    system "dbus-uuidgen --ensure"
    system "export GCONF_CONFIG_SOURCE=`gconftool-2 --get-default-source` && \
        gconftool-2 --makefile-install-rule ${prefix}/etc/gconf/schemas/purple.schemas"
}

variant no_x11 {
    configure.args-append   --without-x
}

variant quartz requires no_x11 description {Build port with gtk2 quartz} {
    patchfiles-append       gtkdocklet-quartz.diff

    configure.args-append   --disable-gestures \
                            --enable-gtkstatusicon

    depends_build           port:autoconf \
                            port:automake \
                            port:intltool

    post-patch {
        reinplace "s|@INTLTOOL_ICONV@|${prefix}/bin/iconv|g" intltool-merge.in
        system "${filespath}/autogen.sh"
    }
}

variant spellcheck description {Allow spell checking} {
    depends_lib-append      port:gtkspell2
    configure.args-delete   --disable-gtkspell
}

livecheck.distname  Pidgin
