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

name                gtk-doc
version             1.28
revision            1
categories          gnome devel
license             GPL-2+
installs_libs       no
platforms           darwin freebsd linux
supported_archs     noarch
installs_libs       no
maintainers         {devans @dbevans} openmaintainer
description         GTK+/GNOME API documentation generator

long_description    GTK-Doc generates API documentation from comments added to C code. \
                    It is typically used to document the public API of GTK+  and GNOME \
                    libraries, but it can also be used to document application code.

homepage            http://www.gtk.org/gtk-doc/
master_sites        gnome:sources/${name}/${version}/

use_xz              yes

checksums           rmd160  cbf70474d838612da096ec98af69d3cfffe3da78 \
                    sha256  911e29e302252c96128965ee1f4067d5431a88e00ad1023a8bc1d6b922af5715 \
                    size    725972

# set 'pbranch' to the desired perl version to use
# currently 5.26 (#55208)

set pbranch         5.26

depends_build       port:pkgconfig \
                    path:lib/pkgconfig/glib-2.0.pc:glib2

depends_lib         port:libxml2 \
                    port:libxslt \
                    port:perl${pbranch} \
                    port:python36 \
                    port:py36-anytree \
                    port:py36-lxml \
                    port:py36-pygments \
                    port:py36-six \
                    port:dblatex \
                    port:docbook-xml \
                    port:docbook-xsl-nons \
                    port:itstool \
                    port:source-highlight

depends_test        port:py36-mock

configure.perl      ${prefix}/bin/perl${pbranch}
configure.python    ${prefix}/bin/python3.6
configure.env-append XSLTPROC=${prefix}/bin/xsltproc
configure.args      --with-xml-catalog=${prefix}/etc/xml/catalog \
                    --with-highlight=source-highlight \
                    --disable-silent-rules

post-configure {
    reinplace "s|^#!.*|#!${configure.perl} -w|" \
        ${worksrcpath}/tools/docpercentages.pl
}

test.run            yes
test.dir            ${worksrcpath}/tests
test.target         check

livecheck.type      gnome-with-unstable