# -*- 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

PortSystem      1.0
PortGroup       gobject_introspection 1.0

name            vte-gtk2-compat
set gname       vte
version         0.28.2
revision        5
checksums       rmd160  8f3396d4e98023b74898e938331917b181964158 \
                sha256  86cf0b81aa023fa93ed415653d51c96767f20b2d7334c893caba71e42654b0ae \
                size    962340

set branch      [join [lrange [split $version .] 0 1] .]
maintainers     {devans @dbevans} openmaintainer
categories      gnome
license         LGPL

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        https://www.gnome.org/
master_sites    gnome:sources/$gname/$branch/
use_xz          yes

distname        ${gname}-${version}

depends_build   port:pkgconfig \
                port:intltool \
                port:gperf \
                port:gtk-doc \
                port:gnome-common \
                port:autoconf \
                port:automake \
                port:libtool

depends_lib     path:lib/pkgconfig/gtk+-2.0.pc:gtk2

gobject_introspection no

patchfiles      patch-configure.in.diff \
                patch-src-pty.c.diff

# reconfigure using upstream autogen.sh for intltool 0.51 compatibility

configure.checks.implicit_function_declaration.whitelist-append strchr
configure.cmd   ./autogen.sh
configure.args  --with-gtk=2.0 \
                --disable-Bsymbolic \
                --disable-python

configure.cflags-append -fstrict-aliasing

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

# default to optional python27 bindings

default_variants +python27

# rename gnome-pty-helper to avoid a conflict with port vte

post-destroot {
    move ${destroot}${prefix}/libexec/gnome-pty-helper ${destroot}${prefix}/libexec/gnome-pty-helper-0.0
}

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  none
