# -*- 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           meson 1.0
PortGroup           active_variants 1.1

name                yelp
version             42.3
license             GPL-2+
set branch          [lindex [split ${version} .] 0]
description         Help browser for GNOME.
long_description    Yelp is the default help browser for the \
                    GNOME desktop. Yelp provides a simple graphical \
                    interface for viewing DocBook, HTML, man, and info \
                    formatted documentation.
maintainers         {devans @dbevans} openmaintainer
categories          gnome
homepage            https://wiki.gnome.org/Apps/Yelp
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  4715774bbb40274cf87de0492cd360ec861f47b2 \
                    sha256  26ccc422679a9e6a7a3aa083d90fcdb347f5f2300be3e01431a30d0cdd2a89a3 \
                    size    1223408

depends_build       port:gettext \
                    port:itstool \
                    path:bin/pkg-config:pkgconfig

depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    port:sqlite3 \
                    port:xz \
                    port:bzip2 \
                    port:yelp-xsl \
                    port:libhandy \
                    path:lib/pkgconfig/webkit2gtk-4.1.pc:webkit2-gtk

# libyelp/yelp-help-list.c:26:10: fatal error: 'gio/gdesktopappinfo.h' file not found
require_active_variants path:lib/pkgconfig/glib-2.0.pc:glib2 x11

#
# if yelp is invoked without a URI argument
# it defaults to help:user-guide
#

depends_run         port:gnome-user-docs \
                    port:gnome-getting-started-docs \
                    port:adwaita-icon-theme

patchfiles          patch-no-undefined-link-flag.diff

post-patch {
    # fix default XML catalog path
    reinplace "s|/etc/xml/catalog|${prefix}/etc/xml/catalog|g" \
        ${worksrcpath}/libyelp/yelp-docbook-document.c
}

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

livecheck.type      gnome
