# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           yelp 1.0

name                balsa
version             2.5.9
revision            1
license             GPL-3
description         GNOME e-mail client
long_description    Balsa is an e-mail client for GNOME, highly \
                    configurable and incorporating all the features \
                    you would expect in a robust mail client.
maintainers         nomaintainer
categories          gnome mail
platforms           darwin
homepage            http://pawsa.fedorapeople.org/balsa/

use_bzip2           yes

master_sites        ${homepage}

checksums           rmd160  f6305e2ce733bc0fccbaeabc58c4569186b92285 \
                    sha256  31857778029f8a18e5475dca3f4a98894e005adc35bf2a33e938cdb51d0efaa5 \
                    size    4508717

depends_build       port:pkgconfig \
                    port:intltool \
                    port:itstool \
                    port:yelp-tools \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:gsed

depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    port:gspell \
                    port:gmime \
                    path:lib/pkgconfig/gnutls.pc:gnutls \
                    port:gpgme \
                    port:gtksourceview3 \
                    port:html2text \
                    path:lib/pkgconfig/webkit2gtk-4.0.pc:webkit2-gtk \
                    port:libsecret \
                    port:libxml2 \
                    path:lib/libssl.dylib:openssl \
                    port:sqlite3

depends_run         port:adwaita-icon-theme
                
patchfiles          patch-configure.ac.diff \
                    patch-src-sendmsg-window.c.diff

# use upstream autogen.sh to reconfigure with our intltool.m4
                    
post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd       ./autogen.sh

configure.args      --with-gtksourceview \
                    --with-spell-checker=gspell \
                    --with-html-widget=webkit2 \
                    --with-sqlite \
                    --with-libsecret \
                    --with-gnome \
                    --disable-more-warnings \
                    --disable-silent-rules

configure.cflags-append -D_DARWIN_C_SOURCE

post-activate {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
}

livecheck.type      regex
livecheck.url       ${homepage}
livecheck.regex     "${name}-(\\d+(?:\\.\\d+)*)"