# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:et:fenc=utf-8::et:sw=4:ts=4:sts=4 # $Id: Portfile 153680 2016-10-07 16:49:15Z mmoll@macports.org $ PortSystem 1.0 PortGroup python 1.0 PortGroup active_variants 1.1 name py-cairo set my_name pycairo version 1.10.0 revision 3 categories-append graphics license {LGPL-2.1 MPL-1.1} platforms darwin maintainers sean 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/ # for python 3; python 2.6 and 2.7 is different checksums rmd160 7d1c1c05113e5bbad32dbe96c65c918b170cac33 \ sha256 9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be python.versions 26 27 33 34 35 if {${name} ne ${subport}} { if {![catch {set result [active_variants cairo x11]}]} { if {!$result} { notes " The cairo port is installed without the +x11 variant; you will get runtime\ errors when installing a binary archive of ${subport}. Install ${subport}\ from source like so: sudo port install -s ${subport} " } } else { notes " Make sure cairo is installed with the +x11 variant when installing the binary\ version of ${subport} or install ${subport} from source like so: sudo port install -s ${subport} " } depends_build port:pkgconfig port:py${python.version}-numpy depends_lib-append path:lib/pkgconfig/cairo.pc:cairo # pycairo distributes python 2.x versions as py2cairo if {${python.version} < 31} { set my_name py2cairo checksums rmd160 ce75db9af32ef1a3e90f6aaa649cbb2493a941a4 \ sha256 d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431 post-patch { reinplace "s|py3cairo|pycairo|g" ${worksrcpath}/setup.py } } distname ${my_name}-${version} use_bzip2 yes patchfiles-append setup.py.patch post-extract { fs-traverse item ${worksrcpath} { if {[file isdirectory ${item}]} { file attributes ${item} -permissions a+rx } elseif {[file isfile ${item}]} { file attributes ${item} -permissions a+r } } } if {${python.version} >= 31} { post-destroot { ln -s ${python.prefix}/include/pycairo/py3cairo.h ${destroot}${python.prefix}/include/pycairo/pycairo.h ln -s ${python.prefix}/lib/pkgconfig/py3cairo.pc ${destroot}${python.prefix}/lib/pkgconfig/pycairo.pc } } livecheck.type none } else { livecheck.type regex livecheck.regex "${my_name}-(\[0-9\\.\]+).tar.bz2" }