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

name                yelp
version             40.2
revision            0
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  bb980c6c4ba7822d82655164dc354ac9a46febe6 \
                    sha256  8aaaaf753ef4d97526f6a5308f1faee4aa627c4451ec92698a12e528535b5a1c \
                    size    1527112

depends_build       port:pkgconfig \
                    port:gettext \
                    port:itstool \
                    port:appstream-glib \
                    port:gtk-doc

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.0.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-m4-ax_compiler_flags_ldflags.m4.diff

use_autoreconf      yes
autoreconf.args     -vfi

# error: redefinition of typedef ‘WebKitWebEditor’
compiler.c_standard 2011

configure.args      --enable-compile-warnings=minimum \
                    --disable-schemas-compile \
                    --disable-silent-rules

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
