Skip to content
Permalink
Browse files

py-matplotlib: update variants/backends

- GTKAgg backend only for Python 2.7
- GTK3Agg backend is available for all Python versions
- PySide backend is available for all Python versions
- add qt5 backend
- add "default_variants +webagg" so that it still gets installed by
   default (removed py-tornado as standard dependency earlier)
  • Loading branch information
reneeotten authored and pmetzger committed Oct 11, 2018
1 parent 279db77 commit a235b08f4326e90d23a315cd5dd9b92e73564ea8
Showing with 24 additions and 22 deletions.
  1. +24 −22 python/py-matplotlib/Portfile
@@ -82,14 +82,14 @@ if {${name} ne ${subport}} {
depends_lib-append port:py${python.version}-tornado
}

variant tkinter description "Enable tkAgg backend" {
variant tkinter description "Enable TkAgg backend" {
depends_lib-append port:py${python.version}-tkinter
post-patch {
reinplace "s|^tkagg=False|tkagg=True|" ${worksrcpath}/setup.cfg
}
}

if {${python.version} < 30} {
if {${python.version} eq 27} {
variant gtk2 description "Enable GTKAgg backend" {
depends_lib-append port:py${python.version}-pygtk
post-patch {
@@ -99,32 +99,31 @@ if {${name} ne ${subport}} {
}
}

if {${python.version} == 27} {
variant gtk3 description "Enable GTK3Agg backend" {
depends_lib-append port:py${python.version}-gobject3 port:gtk3
post-patch {
reinplace "s|^gtk3agg=False|gtk3agg=True|" ${worksrcpath}/setup.cfg
}
variant gtk3 description "Enable GTK3Agg backend" {
depends_lib-append port:py${python.version}-gobject3 port:gtk3
post-patch {
reinplace "s|^gtk3agg=False|gtk3agg=True|" ${worksrcpath}/setup.cfg
}
}

variant qt4 description "Enable QT4Agg backend" {
variant qt4 description "Enable Qt4Agg backend" {
depends_lib-append port:py${python.version}-pyqt4
post-patch {
reinplace "s|^qt4agg=False|qt4agg=True|" ${worksrcpath}/setup.cfg
}
}

if {${python.version} == 27 ||
${python.version} == 34 ||
${python.version} == 35 ||
${python.version} == 36 ||
${python.version} == 37} {
variant pyside description "Enable PySide backend" {
depends_lib-append port:py${python.version}-pyside
post-patch {
reinplace "s|^pyside=False|pyside=True|" ${worksrcpath}/setup.cfg
}
variant qt5 description "Enable Qt5Agg backend" {
depends_lib-append port:py${python.version}-pyqt5
post-patch {
reinplace "s|^qt5agg=False|qt5agg=True|" ${worksrcpath}/setup.cfg
}
}

variant pyside description "Enable PySide backend" {
depends_lib-append port:py${python.version}-pyside
post-patch {
reinplace "s|^pyside=False|pyside=True|" ${worksrcpath}/setup.cfg
}
}

@@ -151,8 +150,11 @@ if {${name} ne ${subport}} {
depends_run-append bin:pdftops:poppler
}

if { ![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset qt4] && ![variant_isset pyside] } {
default_variants-append +cairo
default_variants +webagg

if {![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset qt5] &&
![variant_isset qt4] && ![variant_isset pyside]} {
default_variants-append +cairo
}

post-patch {
@@ -169,7 +171,7 @@ The default backend is the interactive Mac OS X backend. Different\
backends can be specified using the ~/.matplotlib/matplotlibrc file.\
More details regarding backends can be found in the matplotlib FAQ:
http://matplotlib.sourceforge.net/faq/installing_faq.html#what-is-a-backend
https://matplotlib.org/tutorials/introductory/usage.html#backends
"
} else {
github.livecheck.regex {([\d+(?:.\d+)*"]+)}

0 comments on commit a235b08

Please sign in to comment.
You can’t perform that action at this time.