python-matplotlib: simplify

Make TkAgg the default backend.
This commit is contained in:
Alessio Sergi 2015-11-23 03:43:23 +01:00
parent d272fe5e9e
commit 6bfd3b72d8
20 changed files with 38 additions and 223 deletions

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1,19 +1,19 @@
This is the base package which supports only non-GUI and non-interactive
graphics output. For interactive graphics install one of the following
packages:
By default, this package supports only non-interactive graphics output.
For interactive graphics, install:
- python-matplotlib-gtk (for GTK/GTKAgg/GTKCairo backend)
- python-matplotlib-gtk3 (for GTK3Agg/GTK3Cairo backend)
- python-matplotlib-qt4 (for Qt4Agg backend)
- python-matplotlib-qt5 (for Qt5Agg backend)
- python-matplotlib-tk (for TkAgg backend)
- python-matplotlib-web (for webagg backend)
- python-matplotlib-wx (for WX/WXAgg backend)
- pygtk python-cairocffi (for GTK/GTKAgg/GTKCairo backend)
- gtk+3 gir-freedesktop python-gobject python-cairocffi
(for GTK3Agg/GTK3Cairo backend)
- python-PyQt4|python-pyside (for Qt4Agg backend)
- python-PyQt5 (for Qt5Agg backend)
- python-tkinter (for TkAgg backend)
- python-tornado (for webagg backend)
- python-wxPython (for WX/WXAgg backend)
To change the backend, you have two ways:
- /etc/matplotlibrc (system-wide)
- $HOME/.config/matplotlib/matplotlibrc (per-user basis)
- /etc/matplotlibrc (system-wide)
- $HOME/.config/matplotlib/matplotlibrc (per-user basis)
Natively, matplotlib only supports PNG images. Install python-Pillow
to support more file formats.

View file

@ -1,17 +1,17 @@
This is the base package which supports only non-GUI and non-interactive
graphics output. For interactive graphics install one of the following
packages:
By default, this package supports only non-interactive graphics output.
For interactive graphics, install:
- python3.4-matplotlib-gtk3 (for GTK3Agg/GTK3Cairo backend)
- python3.4-matplotlib-qt4 (for Qt4Agg backend)
- python3.4-matplotlib-qt5 (for Qt5Agg backend)
- python3.4-matplotlib-tk (for TkAgg backend)
- python3.4-matplotlib-web (for webagg backend)
- gtk+3 gir-freedesktop python3.4-gobject python3.4-cairocffi
(for GTK3Agg/GTK3Cairo backend)
- python3.4-PyQt4|python3.4-pyside (for Qt4Agg backend)
- python3.4-PyQt5 (for Qt5Agg backend)
- python3.4-tkinter (for TkAgg backend)
- python3.4-tornado (for webagg backend)
To change the backend, you have two ways:
- /etc/matplotlibrc (system-wide)
- $HOME/.config/matplotlib/matplotlibrc (per-user basis)
- /etc/matplotlibrc (system-wide)
- $HOME/.config/matplotlib/matplotlibrc (per-user basis)
Natively, matplotlib only supports PNG images. Install python3.4-Pillow
to support more file formats.

View file

@ -1,7 +1,7 @@
# Template file for 'python-matplotlib'
pkgname=python-matplotlib
version=1.4.3
revision=2
revision=3
wrksrc="matplotlib-${version}"
build_style=python-module
python_versions="2.7 3.4"
@ -11,31 +11,32 @@ makedepends="
python-devel python3.4-devel python-numpy python3.4-numpy
python-six python3.4-six python-dateutil python3.4-dateutil python-pytz
python3.4-pytz python-tornado python3.4-tornado python-parsing
python3.4-parsing python-PyQt4-devel python-PyQt5-devel python-cairocffi
python3.4-cairocffi python-gobject-devel pygtk-devel gtk+3-devel tk-devel
python-tkinter python3.4-tkinter wxPython-devel freetype-devel libpng-devel
libqhull-devel"
python3.4-parsing python-PyQt4-devel python-PyQt5-devel python-pyside
python3.4-pyside python-cairocffi python3.4-cairocffi python-gobject-devel
pygtk-devel gtk+3-devel tk-devel python-tkinter python3.4-tkinter wxPython-devel
freetype-devel libpng-devel libqhull-devel"
depends="python-matplotlib-data>=${version}_${revision} python-numpy python-six
python-dateutil python-parsing python-pytz"
replaces="python-matplotlib-cairo>=0 python-matplotlib-gtk>=0 python-matplotlib-gtk3>=0
python-matplotlib-qtshared>=0 python-matplotlib-qt4>=0 python-matplotlib-qt5>=0
python-matplotlib-tk>=0 python-matplotlib-web>=0 python-matplotlib-wx>=0"
pycompile_module="matplotlib mpl_toolkits pylab.py"
short_desc="Python2 2D/3D plotting library"
_short_desc="${short_desc/Python2/Python3.4}"
maintainer="Alessio Sergi <al3hex@gmail.com>"
homepage="http://matplotlib.org/"
license="matplotlib, BSD, MIT"
distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz"
checksum=61f201c6a82e89e4d9e324266203fad44f95fd8f36d8eec0d8690273e1182f75
nocross=yes
export XDG_RUNTIME_DIR=/tmp
_pysitedir="usr/lib/python2.7/site-packages"
_py34sitedir="usr/lib/python3.4/site-packages"
pre_build() {
# set Agg as default backend
# set TkAgg as default backend
cat > setup.cfg <<-EOF
[packages]
tests = False
[rc_options]
backend = Agg
backend = TkAgg
EOF
# remove shebangs
find . -type f -name '*.py' -exec sed -i "s,^#!.*python$,," {} +
@ -43,10 +44,6 @@ pre_build() {
sed -i 's,\(site-packages/matplotlib/mpl-data\),/etc,' matplotlibrc.template
}
post_install() {
# remove gtk and wx backends, not compatible with python3
rm -f ${DESTDIR}/${_py34sitedir}/matplotlib/backends/backend_{gdk,gtk,gtkagg,gtkcairo,wx,wxagg}.py
# do not install baseline_images, needed for tests only, but huge
rm -rf ${DESTDIR}/usr/lib/python*/site-packages/{matplotlib,mpl_toolkits}/tests/baseline_images
# remove data files
rm -rf ${DESTDIR}/usr/lib/python*/site-packages/matplotlib/{mpl-data,backends/Matplotlib.nib}
}
@ -64,181 +61,16 @@ python-matplotlib-data_package() {
rm -f ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc
}
}
python-matplotlib-cairo_package() {
depends="${sourcepkg}>=${version}_${revision} python-cairocffi"
short_desc+=" - cairo backend"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_cairo.py
}
}
python-matplotlib-gtk_package() {
depends="${sourcepkg}-cairo>=${version}_${revision} pygtk"
short_desc+=" - GTK+ backend"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/_backend_gdk.so
vmove ${_pysitedir}/matplotlib/backends/_gtkagg.so
vmove ${_pysitedir}/matplotlib/backends/backend_gdk.py
vmove ${_pysitedir}/matplotlib/backends/backend_gtk.py
vmove ${_pysitedir}/matplotlib/backends/backend_gtkagg.py
vmove ${_pysitedir}/matplotlib/backends/backend_gtkcairo.py
}
}
python-matplotlib-gtk3_package() {
depends="${sourcepkg}-cairo>=${version}_${revision}
gtk+3 gir-freedesktop python-gobject"
short_desc+=" - GTK+3 backend"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_gtk3.py
vmove ${_pysitedir}/matplotlib/backends/backend_gtk3agg.py
vmove ${_pysitedir}/matplotlib/backends/backend_gtk3cairo.py
}
}
# XXX: the Qt4 backend makes use of the Qt5 backend, which is actually a
# generic Qt backend. So we need to package all the Qt5 stuff in this generic
# package and provide a stub package which pulls in the python-PyQt5 dependency.
python-matplotlib-qtshared_package() {
depends="${sourcepkg}>=${version}_${revision}"
short_desc+=" - shared files for the Qt backends"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_qt5.py
vmove ${_pysitedir}/matplotlib/backends/backend_qt5agg.py
vmove ${_pysitedir}/matplotlib/backends/qt_compat.py
vmove ${_pysitedir}/matplotlib/backends/qt4_compat.py
vmove ${_pysitedir}/matplotlib/backends/qt_editor
}
}
python-matplotlib-qt4_package() {
depends="${sourcepkg}-qtshared>=${version}_${revision} python-PyQt4"
short_desc+=" - Qt4 backend"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_qt4.py
vmove ${_pysitedir}/matplotlib/backends/backend_qt4agg.py
}
}
python-matplotlib-qt5_package() {
build_style=meta
depends="${sourcepkg}-qtshared>=${version}_${revision} python-PyQt5"
short_desc+=" - Qt5 backend"
pkg_install() {
:
}
}
python-matplotlib-tk_package() {
depends="${sourcepkg}>=${version}_${revision} python-tkinter"
short_desc+=" - Tk backend"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/_tkagg.so
vmove ${_pysitedir}/matplotlib/backends/backend_tkagg.py
vmove ${_pysitedir}/matplotlib/backends/tkagg.py
}
}
python-matplotlib-web_package() {
depends="${sourcepkg}>=${version}_${revision} python-tornado"
short_desc+=" - web backend"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_webagg.py
vmove ${_pysitedir}/matplotlib/backends/backend_webagg_core.py
vmove ${_pysitedir}/matplotlib/backends/web_backend
}
}
python-matplotlib-wx_package() {
depends="${sourcepkg}>=${version}_${revision} wxPython"
short_desc+=" - wx backend"
pkg_install() {
vmove ${_pysitedir}/matplotlib/backends/backend_wx.py
vmove ${_pysitedir}/matplotlib/backends/backend_wxagg.py
}
}
python3.4-matplotlib_package() {
replaces="python3.4-matplotlib-cairo>=0 python3.4-matplotlib-gtk3>=0
python3.4-matplotlib-qtshared>=0 python3.4-matplotlib-qt4>=0
python3.4-matplotlib-qt5>=0 python3.4-matplotlib-tk>=0 python3.4-matplotlib-web>=0"
depends="python-matplotlib-data>=${version}_${revision} python3.4-numpy
python3.4-six python3.4-dateutil python3.4-parsing python3.4-pytz"
short_desc="${_short_desc}"
short_desc="${short_desc/Python2/Python3.4}"
pycompile_version="3.4"
pycompile_module="matplotlib mpl_toolkits pylab.py"
pkg_install() {
vmove usr/lib/python3.4
}
}
python3.4-matplotlib-cairo_package() {
depends="python3.4-matplotlib>=${version}_${revision} python3.4-cairocffi"
short_desc="${_short_desc} - cairo backend"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/backend_cairo.py
}
}
python3.4-matplotlib-gtk3_package() {
depends="python3.4-matplotlib-cairo>=${version}_${revision}
gtk+3 gir-freedesktop python3.4-gobject"
short_desc="${_short_desc} - GTK+3 backend"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/backend_gtk3.py
vmove ${_py34sitedir}/matplotlib/backends/backend_gtk3agg.py
vmove ${_py34sitedir}/matplotlib/backends/backend_gtk3cairo.py
}
}
# XXX: the Qt4 backend makes use of the Qt5 backend, which is actually a
# generic Qt backend. So we need to package all the Qt5 stuff in this generic
# package and provide a stub package which pulls in the python3.x-PyQt5 dependency.
python3.4-matplotlib-qtshared_package() {
depends="python3.4-matplotlib>=${version}_${revision}"
short_desc="${_short_desc} - shared files for the Qt backends"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/backend_qt5.py
vmove ${_py34sitedir}/matplotlib/backends/backend_qt5agg.py
vmove ${_py34sitedir}/matplotlib/backends/qt_compat.py
vmove ${_py34sitedir}/matplotlib/backends/qt4_compat.py
vmove ${_py34sitedir}/matplotlib/backends/qt_editor
}
}
python3.4-matplotlib-qt4_package() {
depends="python3.4-matplotlib-qtshared>=${version}_${revision} python3.4-PyQt4"
short_desc="${_short_desc} - Qt4 backend"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/backend_qt4.py
vmove ${_py34sitedir}/matplotlib/backends/backend_qt4agg.py
}
}
python3.4-matplotlib-qt5_package() {
build_style=meta
depends="python3.4-matplotlib-qtshared>=${version}_${revision} python3.4-PyQt5"
short_desc="${_short_desc} - Qt5 backend"
pkg_install() {
:
}
}
python3.4-matplotlib-tk_package() {
depends="python3.4-matplotlib>=${version}_${revision} python3.4-tkinter"
short_desc="${_short_desc} - Tk backend"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/_tkagg.cpython-34m.so
vmove ${_py34sitedir}/matplotlib/backends/backend_tkagg.py
vmove ${_py34sitedir}/matplotlib/backends/tkagg.py
}
}
python3.4-matplotlib-web_package() {
depends="python3.4-matplotlib>=${version}_${revision} python3.4-tornado"
short_desc="${_short_desc} - web backend"
pycompile_version="3.4"
pycompile_module="matplotlib"
pkg_install() {
vmove ${_py34sitedir}/matplotlib/backends/backend_webagg.py
vmove ${_py34sitedir}/matplotlib/backends/backend_webagg_core.py
vmove ${_py34sitedir}/matplotlib/backends/web_backend
}
}

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib

View file

@ -1 +0,0 @@
python-matplotlib