# -*- 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 84924 2011-10-04 18:19:00Z jmr@macports.org $

PortSystem      1.0

name            vte
version         0.28.2
set branch      [join [lrange [split $version .] 0 1] .]
maintainers     nomaintainer
categories      gnome
license         LGPL
platforms       darwin
description     Terminal widget with improved accessibility and I18N support.

long_description \
    Terminal widget with improved font, internationalisation and \
    accessibility support for the GNOME 2 desktop.  Designed to \
    replace libzvt.

homepage        http://www.gnome.org/
master_sites    gnome:sources/$name/$branch/
use_xz          yes

checksums       rmd160  8f3396d4e98023b74898e938331917b181964158 \
                sha256  86cf0b81aa023fa93ed415653d51c96767f20b2d7334c893caba71e42654b0ae

depends_build   port:intltool \
                port:pkgconfig
depends_lib     port:gtk2

patchfiles      patch-configure.diff

configure.args  --disable-introspection --disable-Bsymbolic \
                --disable-python

configure.cflags-append -fstrict-aliasing

# default to python27 bindings
if {![variant_isset python27] && ![variant_isset python26] && ![variant_isset without_python]} {
    default_variants +python27
}

variant python27 conflicts python26 \
description {Build Bindings for Python 2.7} {
    configure.args-delete --disable-python
    set python_prefix ${frameworks_dir}/Python.framework/Versions/2.7
    depends_lib-append port:py27-gtk
    configure.python ${prefix}/bin/python2.7
    configure.pkg_config_path   ${python_prefix}/lib/pkgconfig
    configure.env               PATH=${python_prefix}/bin:$env(PATH)
}

variant python26 conflicts python27 \
description {Build Bindings for Python 2.6} {
    configure.args-delete --disable-python
    set python_prefix ${frameworks_dir}/Python.framework/Versions/2.6
    depends_lib-append port:py26-gtk
    configure.python ${prefix}/bin/python2.6
    configure.pkg_config_path   ${python_prefix}/lib/pkgconfig
    configure.env               PATH=${python_prefix}/bin:$env(PATH)
}

variant without_python description {Disable Python support (deprecated, use -pythonXX instead)} {
	default_variants -python27 -python26
}

platform darwin 9 {
    post-patch {
        reinplace "s| -export-symbols-regex.*||g" \
            ${worksrcpath}/python/Makefile.in
        reinplace "s|-export-symbols-regex.*| \\\\|g" \
            ${worksrcpath}/src/Makefile.in
    }
}

livecheck.type  regex
livecheck.url   http://ftp.gnome.org/pub/gnome/sources/$name/$branch/
livecheck.regex {LATEST-IS-(\d+(?:\.\d+)*)}
