# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 119851 2014-05-08 04:38:57Z devans@macports.org $

PortSystem      1.0

name            libgtkhtml4
set gname       gtkhtml
version         4.8.1
set branch      [join [lrange [split ${version} .] 0 1] .]

maintainers     devans openmaintainer
categories      gnome
license         LGPL
platforms       darwin
description     GTK+ 3 HTML rendering/editing engine.

long_description \
                GtkHTML4 is a lightweight HTML rendering/printing/editing \
                engine for GTK+ 3. It was originally based on KHTMLW, part of the \
                KDE project, but is now being developed independently.

homepage        https://wiki.gnome.org/RoadMap/GtkHtml
master_sites    gnome:sources/${gname}/${branch}/
distname        ${gname}-${version}

use_xz          yes

checksums       rmd160  292794f6ca372b9300dc99a4e49c3f589b064b2b \
                sha256  558bf8ec61d9e24cd67301613fc26ab54a495b4b75af5770d1259128aaeefa63

depends_build   port:pkgconfig \
                port:intltool

depends_lib     port:gtk3 \
                port:enchant \
                port:gsettings-desktop-schemas \
                port:iso-codes \
                port:orbit2 \
                port:libsoup \
                port:gnuregex

patchfiles      patch-gnuregex.diff \
                patch-components-editor-Makefile.am.diff

# update m4/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/m4
}

use_autoreconf  yes
autoreconf.args -fvi

test.run        yes
test.dir        $worksrcpath/gtkhtml
test.target     test-verbose

variant glade description {Build glade catalog} {
    depends_lib-append port:glade
    configure.args-append --with-glade-catalog
}

post-destroot {
    move ${destroot}${prefix}/bin/gtkhtml-editor-test  ${destroot}${prefix}/bin/gtkhtml-editor-test-4.0
}

livecheck.type  gnome
livecheck.name  ${gname}
