Files
macports-ports/python/py-matplotlib/Portfile
T
2020-06-21 11:21:11 -04:00

213 lines
7.6 KiB
Tcl

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup python 1.0
name py-matplotlib
version 3.2.2
revision 0
categories-append graphics math
platforms darwin
license {PSF BSD}
maintainers {reneeotten @reneeotten} openmaintainer
description Matplotlib is a python plotting library
long_description Matplotlib strives to produce publication quality 2D \
graphics for interactive graphing, scientific publishing, \
user interface development and web application servers \
targeting multiple user interfaces and hardcopy output \
formats. There is a 'pylab' mode which emulates matlab \
graphics. The library uses numpy for handling large data \
sets and supports a variety of output backends. This port \
provides variants for the different GUIs (gtk2, gtk3, \
tkinter, qt4, qt5, cairo, latex).
homepage https://matplotlib.org/
checksums rmd160 e8bbf097da8ecabc57677781ce68b2399bfbdf78 \
sha256 3d77a6630d093d74cbbfebaa0571d00790966be1ed204e4a8239f5cbd6835c5d \
size 40295831
use_parallel_build no
python.versions 27 35 36 37 38
if {${name} ne ${subport}} {
depends_build-append \
port:pkgconfig \
port:py${python.version}-setuptools
depends_lib-append \
port:freetype \
port:libpng \
port:qhull \
port:py${python.version}-cycler \
port:py${python.version}-dateutil \
port:py${python.version}-kiwisolver \
port:py${python.version}-numpy \
port:py${python.version}-parsing
patchfiles patch-v32-setup.cfg.diff \
patch-v32-src-macosx.m.diff \
patch-v32-qhull.diff \
patch-v32-setupext.py.diff \
patch-v32-jquery-ui.diff
if {${python.version} eq 27} {
version 2.2.5
revision 1
checksums rmd160 4532a205e8f40d6f40346b2e461d3dca144b38b9 \
sha256 a3037a840cd9dfdc2df9fee8af8f76ca82bfab173c0f9468193ca7a89a2b60ea \
size 36678633
depends_lib-append \
port:py${python.version}-backports-functools_lru_cache \
port:py${python.version}-six \
port:py${python.version}-subprocess32 \
port:py${python.version}-tz
patchfiles patch-v2-setup.cfg.diff \
patch-v2-src-macosx.m.diff \
patch-v2-qhull.diff \
patch-v2-setupext.py.diff \
patch-v2-jquery-ui.diff
}
if {${python.version} eq 35} {
version 3.0.3
revision 2
checksums rmd160 98ecd1ca25d555bde5d43fcaef800f7436d7d738 \
sha256 e1d33589e32f482d0a7d1957bf473d43341115d40d33f578dad44432e47df7b7 \
size 36640137
patchfiles patch-v30-setup.cfg.diff \
patch-v30-src-macosx.m.diff \
patch-v30-qhull.diff \
patch-v30-setupext.py.diff \
patch-v30-jquery-ui.diff
}
build.env PKG_CONFIG_PATH=${python.prefix}/lib/pkgconfig
post-patch {
reinplace "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/setup.cfg
}
# build fails with gcc-4.0 on Leopard, use gcc-4.2 (#37069)
compiler.blacklist gcc-4.0
# jquery-ui is included in the PyPI files, patch added for setup.py that avoids trying
# to install if from the cache or download from URL. Just copy the directory in the post-
# build phase.
post-build {
set libdir [glob -nocomplain ${worksrcpath}/build/lib*]
if {![file exists ${libdir}/matplotlib/backends/web_backend/jquery-ui-1.12.1]} {
file copy ${worksrcpath}/lib/matplotlib/backends/web_backend/jquery-ui-1.12.1 \
${libdir}/matplotlib/backends/web_backend/ \
}
}
post-destroot {
xinstall -d ${destroot}${prefix}/share/doc/${subport} \
${destroot}${prefix}/share/${subport}
xinstall -m 0644 -W ${worksrcpath} README.rst matplotlibrc.template \
${destroot}${prefix}/share/doc/${subport}
file copy ${worksrcpath}/examples \
${destroot}${prefix}/share/${subport}
}
variant webagg description "Enable WebAgg backend" {
depends_lib-append port:py${python.version}-tornado
}
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} eq 27} {
variant gtk2 description "Enable GTKAgg backend" {
depends_lib-append port:py${python.version}-pygtk
post-patch {
reinplace "s|^gtk=False|gtk=True|" ${worksrcpath}/setup.cfg
reinplace "s|^gtkagg=False|gtkagg=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" {
depends_lib-append port:py${python.version}-pyqt4
post-patch {
reinplace "s|^qt4agg=False|qt4agg=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
}
}
variant cairo description "Enable Cairo backends" {
depends_lib-append port:py${python.version}-cairo
post-patch {
reinplace "s|^cairo=False|cairo=True|" ${worksrcpath}/setup.cfg
}
}
variant dvipng description "Enable dvipng support" {
depends_run-append port:dvipng
}
variant ghostscript description "Enable GhostScript support" {
depends_run-append port:ghostscript
}
variant latex description "Enable LaTeX support" {
depends_run-append bin:latex:texlive
}
variant pdftops description "Enable pdftops support" {
depends_run-append bin:pdftops:poppler
}
default_variants +webagg
if {![variant_isset gtk2] && ![variant_isset tkinter] && ![variant_isset qt5] &&
![variant_isset qt4] && ![variant_isset pyside]} {
default_variants-append +cairo
}
if {[variant_isset gtk3] && [variant_isset cairo]} {
post-patch {
reinplace "s|^gtk3cairo=False|gtk3cairo=True|" ${worksrcpath}/setup.cfg
}
}
livecheck.type none
notes "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:
https://matplotlib.org/tutorials/introductory/usage.html#backends"
}