# -*- 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 120098 2014-05-15 14:40:53Z devans@macports.org $

PortSystem      1.0

name            gnome-terminal
version         3.12.2
set branch      [join [lrange [split ${version} .] 0 1] .]
description     Terminal component for the GNOME 3 Desktop
long_description \
                ${description}
maintainers     devans openmaintainer
categories      gnome
license         GPL-3+
platforms       darwin
homepage        https://wiki.gnome.org/Apps/Terminal
master_sites    gnome:sources/${name}/${branch}/

use_xz          yes

checksums       rmd160  fa13408f72fb150b2d03f2a0131016fd628e5251 \
                sha256  ea19ce610af2873d26e1e75491415e17af6a5080366db966f9220fdeea5ebecd

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

depends_lib     port:desktop-file-utils \
                port:gnome-icon-theme \
                port:gnome-icon-theme-symbolic \
                port:gsettings-desktop-schemas \
                port:gtk3 \
                port:vte \
                port:appdata-tools \
                port:dbus \
                port:dconf \
                port:xorg-libX11

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

patchfiles      patch-uuid.diff \
                no-dupfd_cloexec.patch

# 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  --with-gtk=3.0 \
                --with-nautilus-extension=no \
                --disable-migration \
                --disable-search-provider \
                --disable-silent-rules \
                --disable-schemas-compile

variant nautilus description {Build optional nautilus extension} {
    configure.args-replace  --with-nautilus-extension=no --with-nautilus-extension=yes
    depends_lib-append      port:nautilus
}

variant migration description {Enable prefs migration from GConf to GSettings} {
    configure.args-delete   --disable-migration
    depends_lib-append      port:gconf
}

default_variants +nautilus

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
