# -*- 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: Portfile 119415 2014-04-25 00:42:24Z devans@macports.org $

PortSystem      1.0

name            ghex
version         3.10.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     gmail.com:juanrgar 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

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

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

# update m4/intltool.m4 and autoreconf

pre-configure {
    copy -force ${prefix}/share/aclocal/intltool.m4 ${worksrcpath}/m4
}

use_autoreconf  yes
autoreconf.args -fvi

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
