# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 120095 2014-05-15 04:25:48Z devans@macports.org $

PortSystem      1.0

name            gucharmap
version         3.12.1
set branch      [join [lrange [split ${version} .] 0 1] .]
description     gucharmap is a featureful unicode character map.
long_description ${description}
maintainers     devans openmaintainer
categories      gnome
license         GPL-3+
platforms       darwin
homepage        https://wiki.gnome.org/Apps/Gucharmap
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  c120a8c7166e1f0484e4be2ce3f06f57d2628d47 \
                sha256  5e260767da43f6dc31a8be33ca363da56781349b367464fa9c478bca66aa18d9

depends_build   port:pkgconfig \
                port:intltool \
                port:itstool \
                port:gnome-common \
                port:yelp-tools \
                port:gtk-doc

depends_lib     port:desktop-file-utils \
                port:gtk3 \
                port:gobject-introspection \
                port:vala

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

# update m4/intltool.m4 and autoreconf

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

use_autoreconf  yes
autoreconf.args -fvi

use_parallel_build no

configure.args  --with-gtk=3.0 \
                --enable-introspection=yes \
                --enable-vala=yes \
                --disable-Bsymbolic \
                --disable-schemas-compile \
                --disable-silent-rules

platform darwin {
    if {${os.major} > 9} {
        depends_lib-delete      port:gobject-introspection \
                                port:vala
        configure.args-delete   --enable-introspection=yes \
                                --enable-vala=yes
        configure.args-append   --enable-introspection=no \
                                --enable-vala=no
    }
}

# gobject-introspection uses g-ir-scanner, which uses $CC from env
build.args-append   CC="${configure.cc} ${configure.cc_archflags}"

post-activate   {
    system "${prefix}/bin/update-desktop-database ${prefix}/share/applications"
    system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas"
}

livecheck.type  gnome
