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

name                ghex
version             3.18.4
revision            0
license             GPL-2+
set branch          [join [lrange [split ${version} .] 0 1] .]
description         GHex – a binary editor.
long_description    GHex allows the user to load data from any file, \
                    view and edit it in either hex or ascii. A must for \
                    anyone playing games that use non-ascii format for saving.
maintainers         {devans @dbevans} openmaintainer
categories          gnome
homepage            https://wiki.gnome.org/Apps/Ghex
master_sites        gnome:sources/${name}/${branch}/

use_xz              yes

checksums           rmd160  dad9f1b0dced038444b6316bc613e9d804436bec \
                    sha256  c2d9c191ff5bce836618779865bee4059db81a3a0dff38bda3cc7a9e729637c0 \
                    size    1420268

patchfiles          patch-meson.build.diff

depends_build-append \
                    port:gettext \
                    port:gnome-common \
                    port:intltool \
                    port:itstool \
                    path:bin/pkg-config:pkgconfig \
                    port:yelp-tools

depends_lib         port:atk \
                    port:gettext-runtime \
                    path:lib/pkgconfig/glib-2.0.pc:glib2 \
                    path:lib/pkgconfig/gtk+-3.0.pc:gtk3

depends_run         port:adwaita-icon-theme \
                    port:desktop-file-utils

# blacklist old compilers that do not support gcc diagnostic pragmas in functions
compiler.blacklist  *gcc-3.* *gcc-4.* {clang < 300}

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

livecheck.type      gnome
