[25372] trunk/dports/python/py-matplotlib/Portfile

source_changes at macosforge.org source_changes at macosforge.org
Sun May 20 07:04:16 PDT 2007


Revision: 25372
          http://trac.macosforge.org/projects/macports/changeset/25372
Author:   jochen at macports.org
Date:     2007-05-20 07:04:16 -0700 (Sun, 20 May 2007)

Log Message:
-----------
Add variants for different array-packages (numarray, Numeric, numpy) and for
different GUIs (gtk2, tkinter, wxpython).

The wxpython variant does not work right now, as there is a problem with 
wxPython/wxWidget version mismatches, but at least all others should work.
With the old Portfile py-matplotlib could not be installed when a recent
py-wxpython is installed. Problem is reported upstream.

Modified Paths:
--------------
    trunk/dports/python/py-matplotlib/Portfile

Modified: trunk/dports/python/py-matplotlib/Portfile
===================================================================
--- trunk/dports/python/py-matplotlib/Portfile	2007-05-20 13:30:27 UTC (rev 25371)
+++ trunk/dports/python/py-matplotlib/Portfile	2007-05-20 14:04:16 UTC (rev 25372)
@@ -2,51 +2,77 @@
 
 PortSystem               1.0
 PortGroup                python24 1.0
+categories-append        graphics math
 name                     py-matplotlib
 version                  0.90.0
-categories-append        graphics math
-maintainers              nomaintainer at macports.org
+revision                 1
+maintainers              openmaintainer at macports.org jochen at macports.org
+
 description              matlab-like syntax for creating plots in python
-long_description \
-        Matplotlib is a pure python plotting library with the goal of making \
-        publication quality plots using a syntax familiar to matlab users.  The \
-        library uses Numeric for handling large data sets and supports a variety \
-        of output backends
-
-platforms                darwin
-
+long_description         Matplotlib is a pure python plotting library with the goal of making \
+                         publication quality plots using a syntax familiar to matlab users.  The \
+                         library uses Numeric for handling large data sets and supports a variety \
+                         of output backends
 homepage                 http://matplotlib.sourceforge.net/
 master_sites             sourceforge:matplotlib
 distname                 matplotlib-${version}
-
 checksums                md5 31ea12395826080b5be9c1e292cda6f1 \
                          sha1 707366d5dc736ce7446a41f748f33e7603d8f023 \
                          rmd160 6be8d7d1f0896378d8c8880b8b0188e2037892cc
 
-depends_lib-append       port:freetype port:libpng \
-                         port:antigraingeometry port:py-numarray \
-                         port:py-numeric port:py-dateutil
+platforms                darwin
 
-patchfiles              patch-setupext.py.diff 
+depends_lib-append       port:antigraingeometry \
+                         port:freetype \
+                         port:libpng \
+                         port:py-dateutil port:py-tz
 
+patchfiles               patch-setupext.py.diff 
 
+build.env                MPLIB_BASE="${prefix}"
 
+
 post-extract {
-        if {![variant_isset gtk2]} {
+        if {[variant_isset gtk2]} {
+                reinplace "s|^BUILD_GTKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_GTKAGG=1|" \
+                  ${worksrcpath}/setup.py
+                reinplace "s|^BUILD_GTK\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_GTK=1|" \
+                  ${worksrcpath}/setup.py
+        } else {
                 reinplace "s|^BUILD_GTKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_GTKAGG=0|" \
                   ${worksrcpath}/setup.py
+                reinplace "s|^BUILD_GTK\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_GTK=0|" \
+                  ${worksrcpath}/setup.py
+        }
+        if {[variant_isset tkinter]} {
+                reinplace "s|^BUILD_TKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_TKAGG=1|" \
+                        ${worksrcpath}/setup.py
         } else {
-                reinplace "s|^BUILD_GTKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_GTKAGG=1|" \
+                reinplace "s|^BUILD_TKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_TKAGG=0|" \
+                        ${worksrcpath}/setup.py
+        }
+        if {[variant_isset wxpython]} {
+                reinplace "s|^BUILD_WXAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_WXAGG=1|" \
                   ${worksrcpath}/setup.py
+        } else {
+                reinplace "s|^BUILD_WXAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_WXAGG=0|" \
+                  ${worksrcpath}/setup.py
         }
-        reinplace "s|^BUILD_TKAGG\[\[:space:\]\]*=\[\[:space:\]\]*'auto'|BUILD_TKAGG=0|" \
-                ${worksrcpath}/setup.py
+        if {[variant_isset numarray]} {
+                reinplace "s|NUMERIX.-1.|'numarray'|" ${worksrcpath}/setup.py 
+        }
+        if {[variant_isset numeric]} {
+                reinplace "s|NUMERIX.-1.|'numeric'|" ${worksrcpath}/setup.py 
+        }
+        if {[variant_isset numpy]} {
+                reinplace "s|NUMERIX.-1.|'numpy'|" ${worksrcpath}/setup.py 
+        }
 }
 
-post-patch { reinplace "s|@@DPORTS_PREFIX@@|${prefix}|" ${worksrcpath}/setupext.py }
+post-patch { 
+        reinplace "s|@@DPORTS_PREFIX@@|${prefix}|" ${worksrcpath}/setupext.py 
+}
 
-build.env                       MPLIB_BASE="${prefix}"
-
 post-destroot {
         xinstall -m 755 -d ${destroot}/${prefix}/share/doc/${name} \
                 ${destroot}/${prefix}/share/matplotlib
@@ -59,7 +85,27 @@
                 ${destroot}/${prefix}/share/matplotlib
 }
 
-variant gtk2 {
+variant gtk2 conflicts tkinter wxpython description "Use gtkAgg for interactive plotting" {
         depends_lib-append      port:py-gtk2
 }
-
+variant tkinter conflicts gtk2 wxpython description "Use tkAgg for interactive plotting" {
+        depends_lib-append      port:py-tkinter
+}
+variant wxpython conflicts gtk2 tkinter description "Use wxAgg for interactive plotting" {
+        depends_lib-append      port:py-wxpython
+}
+variant numarray conflicts numpy Numeric description "Use numarray as array-object" {
+        depends_lib-append      port:py-numarray
+}
+variant Numeric conflicts numarray numpy description "Use Numeric as array-object" {
+        depends_lib-append      port:py-numeric
+}
+variant numpy conflicts numarray Numeric description "Use numpy as array-object" {
+        depends_lib-append      port:py-numpy
+}
+if { ![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset wxpython] } {
+        default_variants        +gtk2
+}
+if { ![variant_isset numarray] && ![variant_isset Numeric] && ![variant_isset numpy] } {
+        default_variants        +numpy
+}

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070520/acfb75b4/attachment.html


More information about the macports-changes mailing list