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

PortSystem      1.0

name            ghex
version         3.10.1
revision        1
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     juanrgar devans openmaintainer
categories      gnome
platforms       darwin
homepage        https://wiki.gnome.org/Apps/Ghex
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  3873579075c035627fdc9d901977df40f0ae68b9 \
                sha256  34b66cb5c84410c420df72f229d25aee5979e58048a246ed719b046f0c241132

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

depends_lib     port:desktop-file-utils \
                port:atk \
                port:gtk3

depends_run     port:yelp \
                port:gnome-settings-daemon


# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

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

configure.cmd   ./autogen.sh

configure.cflags-append \
                -Wno-format-nonliteral

configure.args  --disable-schemas-compile

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

livecheck.type  gnome