# -*- 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.6.4
license             GPL-2+
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
homepage            https://pawsa.fedorapeople.org/balsa/

use_xz              yes

master_sites        ${homepage}

checksums           rmd160  16b4a2a9ed8d8f83dd92e06532e9d890c27c1c3b \
                    sha256  befa5984511db33d41f2b1ecbfc99e22a15d45d08efe5d737b5174a1a6ac8fc1 \
                    size    3710272

depends_build       port:pkgconfig \
                    port:intltool \
                    port:itstool \
                    port:yelp-tools

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

depends_run         port:adwaita-icon-theme

post-patch {
    reinplace "s|webkit2gtk-4.0|webkit2gtk-4.1|g" ${worksrcpath}/configure
}

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+)*)"
