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

name            py27-gnome
set my_name     gnome-python
version         2.28.1
revision        7
set branch      [join [lrange [split $version .] 0 1] .]
categories      python gnome
license         LGPL-2.1+
platforms       darwin
maintainers     nomaintainer
description     gnome-python is a set of python interfaces to gnome-libs.
long_description    ${description}

homepage        http://www.pygtk.org/
master_sites    gnome:sources/$my_name/$branch/
use_bzip2       yes
distname        $my_name-$version

checksums       md5     a17ad952813ed86f520de8e07194a2bf \
                sha1    de7e66aff141c4c64bc25cdb85193fab0899b983 \
                rmd160  92d6536ed28ae760ea1519fea68565d29249dd33

depends_build   port:pkgconfig

depends_lib     port:libgnomeui \
                port:py27-pygtk \
                port:py27-orbit \
                port:libgnome \
                port:python27 \
                port:libgnomecanvas \
                port:gnome-vfs \
                port:gconf \
                port:libbonobo \
                port:libbonoboui


set python.branch   2.7
set python.prefix   ${frameworks_dir}/Python.framework/Versions/${python.branch}
set python.bin      ${python.prefix}/bin/python${python.branch}

configure.args-append  --prefix=${python.prefix}
configure.env-append    PYGOBJECT_CODEGEN=${python.prefix}/bin/pygobject-codegen-2.0
configure.pkg_config_path  ${python.prefix}/lib/pkgconfig

configure.python    ${python.bin}

use_parallel_build  yes

# fix an import error of bonobo.ui
# when gtk quartz is in use
variant quartz {
	patchfiles-append bonobo.diff
}

platform darwin 9 {
    post-patch {
        reinplace "s| -export-symbols-regex.*||g" \
            ${worksrcpath}/bonobo/Makefile.in \
            ${worksrcpath}/gconf/Makefile.in \
            ${worksrcpath}/gnome/Makefile.in \
            ${worksrcpath}/gnomecanvas/Makefile.in \
            ${worksrcpath}/gnomevfs/Makefile.in
    }
}

post-destroot {
# add link to gtk-doc in devhelp search path (${prefix}/share/gtk-doc/html/*)
# devhelp requires gtk-doc/html directory name  and .devhelp file name (less the .devhelp) to match
    file rename ${destroot}${python.prefix}/share/gtk-doc/html/pygnomevfs/pygnomevfs.devhelp \
                ${destroot}${python.prefix}/share/gtk-doc/html/pygnomevfs/pygnomevfs27.devhelp
    xinstall -d ${destroot}${prefix}/share/gtk-doc/html
    ln -s ${python.prefix}/share/gtk-doc/html/pygnomevfs ${destroot}${prefix}/share/gtk-doc/html/pygnomevfs27
}

livecheck.type  gnome
livecheck.name  ${my_name}
