Ticket #34889: Portfile

File Portfile, 2.4 KB (added by g5pw (Aljaž Srebrnič), 11 years ago)
Line 
1# -*- 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
2# $Id: Portfile 97335 2012-09-04 06:07:50Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               python 1.0
6PortGroup               active_variants 1.0
7
8name                    py-cairo
9set my_name             pycairo
10version                 1.10.0
11categories              python x11
12license                 {LGPL-2.1 MPL-1.1}
13platforms               darwin
14maintainers             gmail.com:sean.michael.farley openmaintainer
15description             Pycairo is set of Python bindings for the cairo graphics library
16
17long_description        ${description}
18
19homepage                http://cairographics.org/pycairo/
20master_sites            http://cairographics.org/releases/
21
22use_bzip2               yes
23
24checksums               rmd160  7d1c1c05113e5bbad32dbe96c65c918b170cac33 \
25                        sha256  9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be
26
27python.versions         26 27 31 32 33
28python.default_version  27
29
30depends_build           port:pkgconfig
31depends_lib             path:lib/pkgconfig/cairo.pc:cairo
32
33patchfiles-append       setup.py.patch
34
35if {${name} != ${subport}} {
36    depends_build-append port:py${python.version}-numpy
37
38    # pycairo distributes python 2.x versions as py2cairo
39    if {${python.version} < 31} {
40        set my_name      py2cairo
41
42        checksums        rmd160  ce75db9af32ef1a3e90f6aaa649cbb2493a941a4 \
43                         sha256  d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431
44
45        post-patch {
46            reinplace "s|py3cairo|pycairo|g" ${worksrcpath}/setup.py
47        }
48    }
49
50    distname             ${my_name}-${version}
51
52    livecheck.type       none
53} else {
54    livecheck.type       regex
55    livecheck.regex      "${my_name}-(\\d+(?:\\.\\d+)*)${extract.suffix}"
56}
57
58post-configure {
59    if {[variant_isset x11]} {
60        require_active_variants cairo x11
61    }
62}
63
64platform darwin 9 {
65    post-patch {
66        reinplace "s| -export-symbols-regex.*||g" ${worksrcpath}/cairo/Makefile.in
67    }
68}
69
70post-extract {
71    fs-traverse item ${worksrcpath} {
72        if {[file isdirectory ${item}]} {
73            file attributes ${item} -permissions a+rx
74        } elseif {[file isfile ${item}]} {
75            file attributes ${item} -permissions a+r
76        }
77    }
78}
79
80variant x11 {}
81
82default_variants        +x11