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

name                gnome-system-log
version             3.9.90
revision            3
license             GPL-2+
set branch          [join [lrange [split ${version} .] 0 1] .]
description         GNOME system log viewer.
long_description    GNOME Log File Viewer is a graphical, menu-driven viewer that you can use \
                    to view and monitor your system logs. GNOME Log File Viewer comes with \
                    a few functions that can help you manage your logs, including a log \
                    monitor and log statistics display.

maintainers         {devans @dbevans} openmaintainer
categories          gnome
platforms           darwin
homepage            https://www.gnome.org
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  37b004ca1ef7b62b2ecc261ac41d309916e935bf \
                    sha256  9eeb51982d347aa7b33703031e2c1d8084201374665425cd62199649b29a5411

depends_build       port:pkgconfig \
                    port:intltool \
                    port:itstool \
                    port:yelp-tools \
                    port:autoconf \
                    port:automake \
                    port:libtool \
                    port:gnome-common

depends_lib         port:desktop-file-utils \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3

depends_run         port:adwaita-icon-theme

# apply upstream patch to prevent configuration failure when using autogen.sh 
# see patch comments for details

patchfiles          patch-fix-autogen-and-configure.diff

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

post-patch {
    xinstall -m 755 ${filespath}/autogen.sh ${worksrcpath}
}

configure.cmd       ./autogen.sh

configure.args      --disable-zlib \
                    --disable-schemas-compile \
                    --disable-silent-rules

default_variants    +zlib

variant zlib description {Enable zlib support} {
    depends_lib-append port:zlib
    configure.args-delete --disable-zlib
    configure.args-append --enable-zlib
}

# port installs hicolor and HighContrast icons, desktop application file, and gschemas
post-activate {
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/hicolor"
    system "${prefix}/bin/gtk-update-icon-cache -f -t ${prefix}/share/icons/HighContrast"
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome-with-unstable
