# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4
# $Id: Portfile 84433 2011-09-26 09:26:59Z jmr@macports.org $

PortSystem      1.0

name            py26-cairo
set my_name     py2cairo
version         1.8.10
revision        1
categories      python x11
platforms       darwin
license         {LGPL-2.1 MPL-1.1}
maintainers     mcalhoun openmaintainer
description     Pycairo is set of Python bindings for the cairo graphics library

long_description \
    ${description}

homepage        http://cairographics.org/pycairo/
master_sites    http://cairographics.org/releases/
distname        ${my_name}-${version}
worksrcdir         pycairo-${version}

checksums           md5     87421a6a70304120555ba7ba238f3dc3 \
                    sha1    6bb0b3e0249bce9fc0480aadad0c602d32f26ec1 \
                    rmd160  932e19f2f582bdf5735bdc92720b76edfb0a0c8e

depends_build   port:pkgconfig
depends_lib     port:python26 \
                path:lib/pkgconfig/cairo.pc:cairo
# depends_test
depends_build-append port:py26-numpy

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

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

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

post-destroot {
    set docdir ${prefix}/share/doc/${name}
    xinstall -d -m 0755 ${destroot}${docdir}
    xinstall -m 0644 -W ${worksrcpath} AUTHORS COPYING NEWS README \
        ${destroot}${docdir}
}

depends_build-append port:py26-py 
test.run         yes
test.cmd         "cd test && py.test-2.6"
test.target      

livecheck.type   regex
livecheck.url    http://cairographics.org/releases/
livecheck.regex "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
