Ticket #18562: Portfile

File Portfile, 3.8 KB (added by krunk7@…, 16 years ago)

Portfile

Line 
1# $Id: Portfile 45788 2009-01-22 04:19:55Z ram@macports.org $
2
3PortSystem         1.0
4PortGroup          python26 1.0
5
6categories-append  graphics math
7name               py26-matplotlib
8version            0.98.5.2
9revision           1
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 3e8210ec8bb71a18962ec8b43688509c \
26                   sha1 fbce043555de4f5a34e2a47e200527720a90b370 \
27                   rmd160 12c64fce5758259f10e31aa1c8e3b47152bda09f
28
29depends_lib-append port:freetype \
30                   port:libpng \
31                   port:py26-dateutil \
32                   port:py26-tz \
33                   port:py26-numpy \
34                   port:py26-configobj \
35                   port:py26-pyobjc2-cocoa
36
37patchfiles         patch-setupext.py.diff \
38                   patch-setup.cfg.diff \
39                   patch-disable_optional_deps.diff \
40                   patch-backend_cocoaagg.py.diff
41
42build.env          MPLIB_BASE="${prefix}"
43
44post-patch {
45  reinplace "s|@@MPORTS_PREFIX@@|${prefix}|" ${worksrcpath}/setupext.py
46}
47
48post-destroot {
49  xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name} \
50    ${destroot}${prefix}/share/${name}
51  xinstall -m 644 -W ${worksrcpath} CHANGELOG INSTALL \
52    INTERACTIVE KNOWN_BUGS README.txt TODO \
53    ${destroot}${prefix}/share/doc/${name}
54  file copy ${worksrcpath}/license \
55    ${destroot}${prefix}/share/doc/${name}
56  file copy ${worksrcpath}/examples \
57    ${destroot}${prefix}/share/${name}
58}
59
60post-activate {
61  ui_msg "\nThe default backend is now the non-interactive Agg backend, different
62backends can be specified using the ~/.matplotlib/matplotlibrc file.
63More details, regarding backends, can be found in the matplotlib FAQ:
64\nhttp://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend\n"
65}
66
67variant cairo description "Enable Cairo backends" {
68  depends_lib-append port:py26-cairo
69  post-patch {
70    reinplace "s|MP_Cairo=False|MP_Cairo=True|" ${worksrcpath}/setupext.py
71  }
72}
73
74variant gtk2 description "Enable GTKAgg backend" {
75  depends_lib-append port:py26-gtk
76  post-patch {
77    reinplace "s|^gtk=False|gtk=True|" ${worksrcpath}/setup.cfg
78    reinplace "s|^gtkagg=False|gtkagg=True|" ${worksrcpath}/setup.cfg
79  }
80}
81
82variant tkinter description "Enable tkAgg backend" {
83  depends_lib-append port:py26-tkinter
84  post-patch {
85    reinplace "s|^tkagg=False|tkagg=True|" ${worksrcpath}/setup.cfg
86  }
87}
88
89variant wxpython description "Enable wxAgg backend" {
90  depends_lib-append port:py26-wxpython
91  post-patch {
92    reinplace "s|^wxagg=False|wxagg=True|" ${worksrcpath}/setup.cfg
93  }
94}
95
96variant latex description "Enable LaTeX support" {
97  depends_lib-append port:texlive
98  post-patch {
99    reinplace "s|MP_LaTeX=False|MP_LaTeX=True|" ${worksrcpath}/setupext.py
100  }
101}
102
103variant ghostscript description "Enable GhostScript support" {
104  depends_lib-append port:ghostscript
105  post-patch {
106    reinplace "s|MP_GhostScript=False|MP_GhostScript=True|" ${worksrcpath}/setupext.py
107  }
108}
109
110if { ![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset wxpython] } {
111  default_variants   +tkinter
112}
113
114livecheck.check    regex
115livecheck.url      ${homepage}
116livecheck.regex    {Current version: <b>(\d+(?:\.\d+)*)</b>}