# -*- 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 119484 2014-04-27 08:24:10Z devans@macports.org $

PortSystem      1.0

name            zenity
version         3.12.1
set branch      [join [lrange [split ${version} .] 0 1] .]
description     zenity allows you to display dialog boxes from the commandline.
long_description \
    This is zenity - a rewrite of gdialog, the GNOME port of dialog which \
    allows you to display dialog boxes from the commandline and shell scripts.
maintainers     devans openmaintainer
categories      gnome
license         LGPL-2+
platforms       darwin
homepage        https://wiki.gnome.org/Projects/Zenity
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  73360641fa48a9b794ee20ad5fab2fdabdf61493 \
                sha256  a59705cdd1ea5318fdae3075c1cedcbead479230e9bead204391566d973dae11

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

depends_lib     port:gtk3 \
                port:libnotify \
                path:lib/pkgconfig/webkitgtk-3.0.pc:webkit-gtk3

# update m4/intltool.m4 and autoreconf

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

use_autoreconf  yes
autoreconf.args -fvi

configure.args  --disable-silent-rules

# TODO: Check ${configure.cxx_stdlib} directly once MacPorts 2.3 is released
platform darwin {
    set cxxstdlib {}

    if {[info exists configure.cxx_stdlib] &&
        ${configure.cxx_stdlib} ne {} &&
        [string match *clang* ${configure.cxx}]} {
        set cxxstdlib ${configure.cxx_stdlib}
    } elseif {[string match *clang* ${configure.cxx}] &&
              ${os.major} >= 13} {
        set cxxstdlib libc++
    } else {
        set cxxstdlib libstdc++
    }

    if {${cxxstdlib} eq "libstdc++"} {
       depends_lib-delete path:lib/pkgconfig/webkitgtk-3.0.pc:webkit-gtk3
       depends_lib-append path:lib/pkgconfig/webkitgtk-3.0.pc:webkit-gtk3-2.0
    }
}

livecheck.type  gnome
