# -*- 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 57375 2009-09-10 08:16:41Z ryandesign@macports.org $

PortSystem      1.0

name            py25-cairo
set my_name     pycairo
version         1.8.2
categories      python x11
platforms       darwin
maintainers     mcalhoun
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}

checksums       \
    md5     bbfc0c2fef08dfb0c5b8baa5f0b67a87 \
    sha1    b457949ccfa3af82afcffae8a396a1c840a9428a \
    rmd160  ce48a6b71b802f07d0e0d3cfa140fd39ab5fe4d7

depends_build   port:pkgconfig
depends_lib     port:python25 \
                path:lib/pkgconfig/cairo.pc:cairo \
                port:py25-numpy

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

set python_prefix  ${frameworks_dir}/Python.framework/Versions/2.5
# change default includedir to avoid conflict with other python pycairo packages
configure.args-append      --includedir=${prefix}/include/python2.5

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

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

    # avoid conflict with other python pycairo packages
    # pkg-config based ports will have to set configure.pkg_config_path to find this package
    xinstall -d -m 0755 ${destroot}${python_prefix}/lib
    move ${destroot}${prefix}/lib/pkgconfig ${destroot}${python_prefix}/lib
}

livecheck.type   regex
livecheck.url    http://cairographics.org/releases/
livecheck.regex  LATEST-pycairo-(\\d+(?:\\.\\d+)*)
