source: trunk/dports/python/py-cairo/Portfile

Last change on this file was 153680, checked in by mmoll@…, 10 months ago

py-cairo: print out some warnings about installing cairo without +x11 enabled, partial fix for #51957

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1# -*- 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
2# $Id: Portfile 153680 2016-10-07 16:49:15Z ryandesign@macports.org $
3
4PortSystem              1.0
5PortGroup               python 1.0
6PortGroup               active_variants 1.1
7
8name                    py-cairo
9set my_name             pycairo
10version                 1.10.0
11revision                3
12categories-append       graphics
13license                 {LGPL-2.1 MPL-1.1}
14platforms               darwin
15maintainers             sean openmaintainer
16description             Pycairo is set of Python bindings for the cairo graphics library
17
18long_description        ${description}
19
20homepage                http://cairographics.org/pycairo/
21master_sites            http://cairographics.org/releases/
22
23# for python 3; python 2.6 and 2.7 is different
24checksums               rmd160  7d1c1c05113e5bbad32dbe96c65c918b170cac33 \
25                        sha256  9aa4078e7eb5be583aeabbe8d87172797717f95e8c4338f0d4a17b683a7253be
26
27python.versions         26 27 33 34 35
28
29if {${name} ne ${subport}} {
30    if {![catch {set result [active_variants cairo x11]}]} {
31       if {!$result} {
32           notes "
33The cairo port is installed without the +x11 variant; you will get runtime\
34errors when installing a binary archive of ${subport}. Install ${subport}\
35from source like so:
36
37    sudo port install -s ${subport}
38"
39        }
40    } else {
41        notes "
42Make sure cairo is installed with the +x11 variant when installing the binary\
43version of ${subport} or install ${subport} from source like so:
44
45    sudo port install -s ${subport}
46"
47    }
48
49    depends_build           port:pkgconfig port:py${python.version}-numpy
50    depends_lib-append      path:lib/pkgconfig/cairo.pc:cairo
51
52    # pycairo distributes python 2.x versions as py2cairo
53    if {${python.version} < 31} {
54        set my_name     py2cairo
55
56        checksums       rmd160  ce75db9af32ef1a3e90f6aaa649cbb2493a941a4 \
57                        sha256  d30439f06c2ec1a39e27464c6c828b6eface3b22ee17b2de05dc409e429a7431
58
59        post-patch {
60            reinplace "s|py3cairo|pycairo|g" ${worksrcpath}/setup.py
61        }
62    }
63
64    distname            ${my_name}-${version}
65
66    use_bzip2           yes
67    patchfiles-append   setup.py.patch
68
69    post-extract {
70        fs-traverse item ${worksrcpath} {
71            if {[file isdirectory ${item}]} {
72                file attributes ${item} -permissions a+rx
73            } elseif {[file isfile ${item}]} {
74                file attributes ${item} -permissions a+r
75            }
76        }
77    }
78
79    if {${python.version} >= 31} {
80        post-destroot {
81            ln -s ${python.prefix}/include/pycairo/py3cairo.h ${destroot}${python.prefix}/include/pycairo/pycairo.h
82            ln -s ${python.prefix}/lib/pkgconfig/py3cairo.pc ${destroot}${python.prefix}/lib/pkgconfig/pycairo.pc
83        }
84    }
85
86    livecheck.type      none
87} else {
88    livecheck.type      regex
89    livecheck.regex     "${my_name}-(\[0-9\\.\]+).tar.bz2"
90}
Note: See TracBrowser for help on using the repository browser.