# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
# $Id: Portfile 72849 2010-10-28 21:22:12Z devans@macports.org $

PortSystem      1.0

name            py26-pyclutter
set my_name     pyclutter
version         1.0.2
distname        ${my_name}-${version}
set branch      [string range $version 0 [expr [string last "." $version] - 1]]
categories      python graphics
description     Python bindings for Clutter 1.0.
long_description This port contains the Python modules that allow you \
                 to use the Clutter toolkit in Python programs.
maintainers     nodamage.com:nodamage openmaintainer
platforms       darwin
homepage        http://www.clutter-project.org/
master_sites    http://www.clutter-project.org/sources/${my_name}/${branch}/

checksums       md5     9bd6a73bba4a40e5dc79003ccb6bc6a7 \
                sha1    819d4ec117f5a41939fbb18c8e2b308099888f04 \
                rmd160  8b4c89cb701354b62454cf3738c5a55c51c7ca1e

depends_build \
    port:pkgconfig \
    port:libtool
    
depends_lib \
    port:python26 \
    path:lib/pkgconfig/glib-2.0.pc:glib2 \
    port:gtk2 \
    port:py26-cairo \
    port:py26-gobject \
    port:py26-gtk \
    port:py26-gst-python \
    port:clutter

set python_prefix ${frameworks_dir}/Python.framework/Versions/2.6

configure.pre_args-delete  --prefix=${prefix}
configure.pre_args-append  --prefix=${python_prefix}
configure.args-append      --includedir=${python_prefix}/include/python2.6
configure.pkg_config_path  ${python_prefix}/lib/pkgconfig

configure.python    ${prefix}/bin/python2.6

configure.env-append PYGOBJECT_CODEGEN=${prefix}/Library/Frameworks/Python.framework/Versions/2.6/bin/pygobject-codegen-2.0

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING ChangeLog NEWS README \
        ${destroot}${docdir}
    xinstall -d ${destroot}${prefix}/share/gtk-doc/html
    system "ln -s ${python_prefix}/share/${my_name} ${destroot}${prefix}/share/${my_name}26"
# devhelp requires gtk-doc directory name  and .devhelp file name (less the .devhelp) to match
    file rename ${destroot}${python_prefix}/share/gtk-doc/html/${my_name}/${my_name}.devhelp \
                ${destroot}${python_prefix}/share/gtk-doc/html/${my_name}/${my_name}26.devhelp
    system "ln -s ${python_prefix}/share/gtk-doc/html/${my_name} ${destroot}${prefix}/share/gtk-doc/html/${my_name}26"
}

livecheck.type      regex
livecheck.url       ${master_sites}
livecheck.regex     "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
