From 077b2860cbb200faa9af85dc9d00f755986e4a1e Mon Sep 17 00:00:00 2001 From: Alessio Sergi Date: Tue, 27 Jan 2015 19:17:00 +0100 Subject: [PATCH] New package: python-matplotlib-1.4.2 --- srcpkgs/python-matplotlib-cairo | 1 + srcpkgs/python-matplotlib-data | 1 + srcpkgs/python-matplotlib-gtk | 1 + srcpkgs/python-matplotlib-gtk3 | 1 + srcpkgs/python-matplotlib-qt4 | 1 + srcpkgs/python-matplotlib-qt5 | 1 + srcpkgs/python-matplotlib-qtshared | 1 + srcpkgs/python-matplotlib-tk | 1 + srcpkgs/python-matplotlib-web | 1 + srcpkgs/python-matplotlib-wx | 1 + srcpkgs/python-matplotlib/INSTALL.msg | 22 ++ .../20_matplotlibrc_path_search_fix.patch | 29 +++ .../python3.4-matplotlib.INSTALL.msg | 20 ++ srcpkgs/python-matplotlib/template | 242 ++++++++++++++++++ srcpkgs/python3.4-matplotlib | 1 + srcpkgs/python3.4-matplotlib-cairo | 1 + srcpkgs/python3.4-matplotlib-gtk | 1 + srcpkgs/python3.4-matplotlib-gtk3 | 1 + srcpkgs/python3.4-matplotlib-qt4 | 1 + srcpkgs/python3.4-matplotlib-qt5 | 1 + srcpkgs/python3.4-matplotlib-qtshared | 1 + srcpkgs/python3.4-matplotlib-tk | 1 + srcpkgs/python3.4-matplotlib-web | 1 + 23 files changed, 332 insertions(+) create mode 120000 srcpkgs/python-matplotlib-cairo create mode 120000 srcpkgs/python-matplotlib-data create mode 120000 srcpkgs/python-matplotlib-gtk create mode 120000 srcpkgs/python-matplotlib-gtk3 create mode 120000 srcpkgs/python-matplotlib-qt4 create mode 120000 srcpkgs/python-matplotlib-qt5 create mode 120000 srcpkgs/python-matplotlib-qtshared create mode 120000 srcpkgs/python-matplotlib-tk create mode 120000 srcpkgs/python-matplotlib-web create mode 120000 srcpkgs/python-matplotlib-wx create mode 100644 srcpkgs/python-matplotlib/INSTALL.msg create mode 100644 srcpkgs/python-matplotlib/patches/20_matplotlibrc_path_search_fix.patch create mode 100644 srcpkgs/python-matplotlib/python3.4-matplotlib.INSTALL.msg create mode 100644 srcpkgs/python-matplotlib/template create mode 120000 srcpkgs/python3.4-matplotlib create mode 120000 srcpkgs/python3.4-matplotlib-cairo create mode 120000 srcpkgs/python3.4-matplotlib-gtk create mode 120000 srcpkgs/python3.4-matplotlib-gtk3 create mode 120000 srcpkgs/python3.4-matplotlib-qt4 create mode 120000 srcpkgs/python3.4-matplotlib-qt5 create mode 120000 srcpkgs/python3.4-matplotlib-qtshared create mode 120000 srcpkgs/python3.4-matplotlib-tk create mode 120000 srcpkgs/python3.4-matplotlib-web diff --git a/srcpkgs/python-matplotlib-cairo b/srcpkgs/python-matplotlib-cairo new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-cairo @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-data b/srcpkgs/python-matplotlib-data new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-data @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-gtk b/srcpkgs/python-matplotlib-gtk new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-gtk @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-gtk3 b/srcpkgs/python-matplotlib-gtk3 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-gtk3 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-qt4 b/srcpkgs/python-matplotlib-qt4 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-qt4 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-qt5 b/srcpkgs/python-matplotlib-qt5 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-qt5 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-qtshared b/srcpkgs/python-matplotlib-qtshared new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-qtshared @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-tk b/srcpkgs/python-matplotlib-tk new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-tk @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-web b/srcpkgs/python-matplotlib-web new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-web @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib-wx b/srcpkgs/python-matplotlib-wx new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python-matplotlib-wx @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python-matplotlib/INSTALL.msg b/srcpkgs/python-matplotlib/INSTALL.msg new file mode 100644 index 0000000000..7aa0e74f52 --- /dev/null +++ b/srcpkgs/python-matplotlib/INSTALL.msg @@ -0,0 +1,22 @@ +This is the base package which supports only non-GUI and non-interactive +graphics output. For interactive graphics install one of the following +packages: + + - 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) + +To change the backend, you have two ways: + + - /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. + +Matplotlib’s LaTeX support requires a working LaTeX installation and +ghostscript. diff --git a/srcpkgs/python-matplotlib/patches/20_matplotlibrc_path_search_fix.patch b/srcpkgs/python-matplotlib/patches/20_matplotlibrc_path_search_fix.patch new file mode 100644 index 0000000000..ea4e92e024 --- /dev/null +++ b/srcpkgs/python-matplotlib/patches/20_matplotlibrc_path_search_fix.patch @@ -0,0 +1,29 @@ +Description: Fixes the path to search for matplotlibrc file +Forwarded: not-needed +Author: Sandro Tosi + +--- lib/matplotlib/__init__.py ++++ lib/matplotlib/__init__.py +@@ -653,10 +653,12 @@ def _get_data_path(): + raise RuntimeError('Path in environment MATPLOTLIBDATA not a directory') + return path + +- path = os.sep.join([os.path.dirname(__file__), 'mpl-data']) ++ path = '/usr/share/matplotlib/mpl-data' + if os.path.isdir(path): + return path + ++ raise RuntimeError('Could not find the matplotlib data files') ++ + # setuptools' namespace_packages may highjack this init file + # so need to try something known to be in matplotlib, not basemap + import matplotlib.afm +@@ -777,7 +779,7 @@ def matplotlib_fname(): + home, '.matplotlib', 'matplotlibrc') + return fname + +- path = get_data_path() # guaranteed to exist or raise ++ path = '/etc' # guaranteed to exist or raise + fname = os.path.join(path, 'matplotlibrc') + if not os.path.exists(fname): + warnings.warn('Could not find matplotlibrc; using defaults') diff --git a/srcpkgs/python-matplotlib/python3.4-matplotlib.INSTALL.msg b/srcpkgs/python-matplotlib/python3.4-matplotlib.INSTALL.msg new file mode 100644 index 0000000000..faf3b735b3 --- /dev/null +++ b/srcpkgs/python-matplotlib/python3.4-matplotlib.INSTALL.msg @@ -0,0 +1,20 @@ +This is the base package which supports only non-GUI and non-interactive +graphics output. For interactive graphics install one of the following +packages: + + - 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) + +To change the backend, you have two ways: + + - /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. + +Matplotlib’s LaTeX support requires a working LaTeX installation and +ghostscript. diff --git a/srcpkgs/python-matplotlib/template b/srcpkgs/python-matplotlib/template new file mode 100644 index 0000000000..c23bc0ae50 --- /dev/null +++ b/srcpkgs/python-matplotlib/template @@ -0,0 +1,242 @@ +# Template file for 'python-matplotlib' +pkgname=python-matplotlib +version=1.4.2 +revision=1 +wrksrc="matplotlib-${version}" +build_style=python-module +python_versions="2.7 3.4" +hostmakedepends="pkg-config python-setuptools python3.4-setuptools" +# XXX: use internal copy of agg and pycxx, highly patched +makedepends=" + python-devel python3.4-devel python-numpy-devel python3.4-numpy-devel + 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" +depends="python-matplotlib-data>=${version}_${revision} python-numpy python-six + python-dateutil python-parsing python-pytz" +pycompile_module="matplotlib mpl_toolkits pylab.py" +short_desc="Python2 2D/3D plotting library" +_short_desc="${short_desc/Python2/Python3.4}" +maintainer="Alessio Sergi " +homepage="http://matplotlib.org/" +license="matplotlib, BSD, MIT" +distfiles="${PYPI_SITE}/m/matplotlib/matplotlib-${version}.tar.gz" +checksum=17a3c7154f152d8dfed1f37517c0a8c5db6ade4f6334f684989c36dab84ddb54 +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 + cat > setup.cfg <<-EOF + [rc_options] + backend = Agg + EOF + # remove shebangs + find . -type f -name '*.py' -exec sed -i "s,^#!.*python$,," {} + + # adjust path + 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} +} + +python-matplotlib-data_package() { + noarch=yes + conf_files="/etc/matplotlibrc" + short_desc+=" - data files" + pkg_install() { + vmkdir usr/share/matplotlib + vcopy ${wrksrc}/lib/matplotlib/mpl-data usr/share/matplotlib + vcopy ${wrksrc}/lib/matplotlib/backends/Matplotlib.nib usr/share/matplotlib + vsconf ${wrksrc}/matplotlibrc.template + vconf ${PKGDESTDIR}/usr/share/matplotlib/mpl-data/matplotlibrc + 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() { + 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() { + 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}" + 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() { + 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 + } +} diff --git a/srcpkgs/python3.4-matplotlib b/srcpkgs/python3.4-matplotlib new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-cairo b/srcpkgs/python3.4-matplotlib-cairo new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-cairo @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-gtk b/srcpkgs/python3.4-matplotlib-gtk new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-gtk @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-gtk3 b/srcpkgs/python3.4-matplotlib-gtk3 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-gtk3 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-qt4 b/srcpkgs/python3.4-matplotlib-qt4 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-qt4 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-qt5 b/srcpkgs/python3.4-matplotlib-qt5 new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-qt5 @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-qtshared b/srcpkgs/python3.4-matplotlib-qtshared new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-qtshared @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-tk b/srcpkgs/python3.4-matplotlib-tk new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-tk @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file diff --git a/srcpkgs/python3.4-matplotlib-web b/srcpkgs/python3.4-matplotlib-web new file mode 120000 index 0000000000..9552ac1974 --- /dev/null +++ b/srcpkgs/python3.4-matplotlib-web @@ -0,0 +1 @@ +python-matplotlib \ No newline at end of file