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

PortSystem          1.0
PortGroup           deprecated 1.0
PortGroup           meson 1.0

# repository moved to GNOME readonly archive
deprecated.upstream_support no

name                devhelp
version             43.0
revision            0

categories          gnome
license             GPL-2+
maintainers         {devans @dbevans} {mascguy @mascguy} openmaintainer
description         Devhelp is an API documentation browser for GTK+ and GNOME.
long_description    Devhelp is an API documentation browser for GTK+ and GNOME. It works \
                    natively with gtk-doc (the API reference framework developed for GTK+ \
                    and used throughout GNOME for API documentation). If you use gtk-doc \
                    with your project, you can use Devhelp to browse the documentation.
homepage            https://gitlab.gnome.org/Archive/devhelp

# Disable unexpected download of subprojects
meson.wrap_mode     nodownload

set port_ver_major  [lindex [split ${version} .] 0]
set branch          [join [lrange [split ${version} .] 0 1] .]
master_sites        gnome:sources/${name}/${port_ver_major}/
use_xz              yes

checksums           rmd160  a8632bba01fda5c1028620b5239dd82c1e219904 \
                    sha256  63ceeefd05392e02044881ef1ecd724293553da5735b7efc082b2d13fe85dd04 \
                    size    327508

depends_build-append \
                    port:gettext \
                    port:gi-docgen \
                    port:gtk-doc \
                    port:itstool \
                    path:bin/pkg-config:pkgconfig

depends_lib-append \
                    port:desktop-file-utils \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \
                    port:gsettings-desktop-schemas \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
                    path:lib/pkgconfig/webkit2gtk-4.1.pc:webkit2-gtk

depends_run-append \
                    port:adwaita-icon-theme

patchfiles-append   patch-dont-use-version-script.diff

configure.args-append \
                    -Dgtk_doc=true

# gobject-introspection uses g-ir-scanner, which uses $CC from env
if {${universal_possible} && [variant_isset universal]} {
    foreach arch ${configure.universal_archs} {
        lappend merger_build_env(${arch})     "CC=${configure.cc} -arch ${arch}"
        lappend merger_destroot_env(${arch})  "CC=${configure.cc} -arch ${arch}"
    }
} else {
    build.env-append       "CC=${configure.cc} ${configure.cc_archflags}"
    destroot.env-append    "CC=${configure.cc} ${configure.cc_archflags}"
}

post-activate {
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type      none
