# -*- 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
# $Id$

PortSystem          1.0

name                bibledit
set gname           bibledit-gtk
version             4.8
revision            2
categories          textproc
license             GPL-3+
maintainers         nomaintainer
platforms           darwin

description         A USFM text editor for Bible translators using Linux and Mac OS X.

long_description    Bibledit is a USFM text editor that works in Linux or Mac OS X \
                    for Bible translators to create Bible text. It is unique in that \
                    it is organized in two distinct hierarchies. One, it has sections \
                    and paragraphs, like any other text. Second, it is made up of \
                    books that contain chapters that contain verses.

homepage            http://www.nongnu.org/bibledit/
master_sites        http://download.savannah.gnu.org/releases/bibledit/source/gtk/ \
                    http://download-mirror.savannah.gnu.org/releases/bibledit/source/gtk/

checksums           md5 e509449e52142757c2c75af124847941 \
                    rmd160 02e628f018d075cc72ff5c2bf8fb0989e2dc63cc

depends_build       port:pkgconfig \
                    bin:merge:rcs

depends_lib         port:desktop-file-utils \
                    port:gtk2  \
                    port:sqlite3 \
                    port:git \
                    port:enchant \
                    port:nspr \
                    port:gtksourceview2 \
                    port:libsoup \
                    path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk

distname            ${gname}-${version}
worksrcdir          ${gname}-${version}

patchfiles          patch-src-keyterms.cpp.diff

platform darwin {
    if {${configure.cxx_stdlib} eq "libstdc++"} {
       depends_lib-delete path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk
       depends_lib-append path:lib/pkgconfig/webkit-1.0.pc:webkit-gtk-2.0
    }
}

post-activate {
        system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
}

livecheck.type      regex
livecheck.url       [lindex ${master_sites} 0]
livecheck.regex     "${gname}-(\\d+(?:\\.\\d+)*)${extract.suffix}"