source: trunk/dports/python/py-matplotlib/Portfile @ 82741

Last change on this file since 82741 was 82741, checked in by jmr@…, 6 years ago

typo

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.2 KB
Line 
1# $Id: Portfile 82741 2011-08-19 19:22:41Z jmr@macports.org $
2
3PortSystem         1.0
4PortGroup          python 1.0
5
6categories-append  graphics math
7name               py-matplotlib
8version            1.0.1
9revision           4
10maintainers        ram openmaintainer
11platforms          darwin
12
13description        matlab-like syntax for creating plots in python
14long_description   Matplotlib is a pure python plotting library with the \
15                   goal of making publication quality plots using a syntax \
16                   familiar to matlab users. The library uses numpy for \
17                   handling large data sets and supports a variety of \
18                   output backends. This port provides variants for the \
19                   different GUIs (gtk2, tkinter, wxpython).
20
21homepage           http://matplotlib.sourceforge.net
22master_sites       sourceforge:matplotlib
23distname           matplotlib-${version}
24
25checksums          md5 2196c0482d5b33dc8d33f67bbafc1323 \
26                   sha1 c7a832f28a66817626e7a8af21e14ea0e15f4008 \
27                   rmd160 e3e326f7f31ef995253da483444cb593b8e6753b
28
29python.versions    24 25 26 27
30
31if {${subport} == "py24-matplotlib"} {
32  depends_lib-append port:py-dateutil \
33                     port:py-tz \
34                     port:py-numpy \
35                     port:py-configobj \
36                     port:py-pyobjc2 \
37                     port:py-pyobjc2-cocoa
38} elseif {${subport} != ${name}} {
39  depends_lib-append port:py${python.version}-dateutil \
40                     port:py${python.version}-tz \
41                     port:py${python.version}-numpy \
42                     port:py${python.version}-configobj \
43                     port:py${python.version}-pyobjc-cocoa
44}
45
46if {$subport != $name} {
47
48depends_lib-append port:freetype \
49                   port:libpng
50
51patchfiles         patch-setupext.py.diff \
52                   patch-setup.cfg.diff \
53                   patch-disable_optional_deps.diff \
54                   patch-04b4e50919.diff
55
56build.env          MPLIB_BASE="${prefix}" PKG_CONFIG_PATH="${python.prefix}/lib/pkgconfig/"
57
58post-patch {
59  reinplace "s|@@MPORTS_PREFIX@@|${prefix}|" ${worksrcpath}/setupext.py
60  reinplace "s|@@PYTHON_BRANCH@@|${prefix}|" ${worksrcpath}/setupext.py
61}
62
63post-destroot {
64  if {${name} != ${subport}} {
65  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${subport} \
66    ${destroot}${prefix}/share/${subport}
67  xinstall -m 644 -W ${worksrcpath} CHANGELOG INSTALL \
68    INTERACTIVE KNOWN_BUGS README.txt TODO \
69    ${destroot}${prefix}/share/doc/${subport}
70  file copy ${worksrcpath}/license \
71    ${destroot}${prefix}/share/doc/${subport}
72  file copy ${worksrcpath}/examples \
73    ${destroot}${prefix}/share/${subport}
74  }
75}
76
77post-activate {
78  ui_msg "\nThe default backend is now the non-interactive Agg backend, different
79backends can be specified using the ~/.matplotlib/matplotlibrc file.
80More details, regarding backends, can be found in the matplotlib FAQ:
81\nhttp://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend\n"
82}
83
84variant cairo description "Enable Cairo backends" {
85  if {${subport} == "py24-matplotlib"} {
86    depends_lib-append port:py-cario
87  } elseif {${subport} != ${name}} {
88    depends_lib-append port:py${python.version}-cairo
89  }
90  post-patch {
91    reinplace "s|MP_Cairo=False|MP_Cairo=True|" ${worksrcpath}/setupext.py
92  }
93}
94
95variant gtk2 description "Enable GTKAgg backend" {
96  if {${subport} == "py24-matplotlib"} {
97    depends_lib-append port:py-gtk
98  } elseif {${subport} != ${name}} {
99    depends_lib-append port:py${python.version}-gtk
100  }
101  post-patch {
102    reinplace "s|^gtk=False|gtk=True|" ${worksrcpath}/setup.cfg
103    reinplace "s|^gtkagg=False|gtkagg=True|" ${worksrcpath}/setup.cfg
104  }
105}
106
107variant tkinter description "Enable tkAgg backend" {
108  if {${subport} == "py24-matplotlib"} {
109    depends_lib-append port:py-tkinter
110  } elseif {${subport} != ${name}} {
111    depends_lib-append port:py${python.version}-tkinter
112  }
113  post-patch {
114    reinplace "s|^tkagg=False|tkagg=True|" ${worksrcpath}/setup.cfg
115  }
116}
117
118variant wxpython description "Enable wxAgg backend" {
119  if {${subport} == "py24-matplotlib"} {
120    depends_lib-append port:py-wxpython
121  } elseif {${subport} != ${name}} {
122    depends_lib-append port:py${python.version}-wxpython
123  }
124  post-patch {
125    reinplace "s|^wxagg=False|wxagg=True|" ${worksrcpath}/setup.cfg
126  }
127}
128
129variant qt4 description "Enable QT4Agg backend" {
130  if {${subport} == "py24-matplotlib"} {
131    depends_lib-append port:py-pyqt4
132  } elseif {${subport} != ${name}} {
133    depends_lib-append port:py${python.version}-pyqt4
134  }
135  post-patch {
136    reinplace "s|MP_QT4=False|MP_QT4=True|" ${worksrcpath}/setupext.py
137  }
138}
139
140variant latex description "Enable LaTeX support" {
141  depends_lib-append bin:latex:texlive
142  post-patch {
143    reinplace "s|MP_LaTeX=False|MP_LaTeX=True|" ${worksrcpath}/setupext.py
144  }
145}
146
147variant ghostscript description "Enable GhostScript support" {
148  depends_lib-append port:ghostscript
149  post-patch {
150    reinplace "s|MP_GhostScript=False|MP_GhostScript=True|" ${worksrcpath}/setupext.py
151  }
152}
153
154if { ![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset qt4] } {
155  default_variants   +tkinter
156}
157
158}
159
160livecheck.type     regex
161livecheck.url      ${homepage}
162livecheck.regex    {matplotlib (\d+(\.\d+)*) is available}
Note: See TracBrowser for help on using the repository browser.