diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2010-05-31 20:23:16 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2010-05-31 20:23:16 +0000 |
commit | 9e26faeeb23fe1a0dd817944e3c5b73f2d8b0e13 (patch) | |
tree | ea59170ea0d5bc6419d251a2049aed9d3dc6ae9b /dev-python/matplotlib | |
parent | old (diff) | |
download | gentoo-2-9e26faeeb23fe1a0dd817944e3c5b73f2d8b0e13.tar.gz gentoo-2-9e26faeeb23fe1a0dd817944e3c5b73f2d8b0e13.tar.bz2 gentoo-2-9e26faeeb23fe1a0dd817944e3c5b73f2d8b0e13.zip |
Added a few useful patches from upstream. Now use default config before documentation generation (fix bug #307881). Cleaning some dependencies, and allow png-1.4 patch to work with previous versions too
(Portage version: 2.2_rc67/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/matplotlib')
6 files changed, 362 insertions, 2 deletions
diff --git a/dev-python/matplotlib/ChangeLog b/dev-python/matplotlib/ChangeLog index f869283ca6f5..f7987299f8d2 100644 --- a/dev-python/matplotlib/ChangeLog +++ b/dev-python/matplotlib/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for dev-python/matplotlib # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/ChangeLog,v 1.86 2010/05/30 16:32:31 phajdan.jr Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/ChangeLog,v 1.87 2010/05/31 20:23:16 bicatali Exp $ + +*matplotlib-0.99.1.1-r2 (31 May 2010) + + 31 May 2010; Sébastien Fabbro <bicatali@gentoo.org> + +matplotlib-0.99.1.1-r2.ebuild, +files/matplotlib-0.99.1.1-docs.patch, + +files/matplotlib-0.99.1.1-eintr.patch, + +files/matplotlib-0.99.1.1-gtk-tooltip.patch, + files/matplotlib-0.99.1.1-libpng14.patch: + Added a few useful patches from upstream. Now use default config before + documentation generation (fix bug #307881). Cleaning some dependencies, + and allow png-1.4 patch to work with previous versions too 30 May 2010; Pawel Hajdan jr <phajdan.jr@gentoo.org> matplotlib-0.99.1.1-r1.ebuild: diff --git a/dev-python/matplotlib/files/matplotlib-0.99.1.1-docs.patch b/dev-python/matplotlib/files/matplotlib-0.99.1.1-docs.patch new file mode 100644 index 000000000000..c734953342b6 --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-0.99.1.1-docs.patch @@ -0,0 +1,16 @@ +Description: Pass DPI, along with format, in plot format configuration +Forwarded: yes +Author: Sandro Tosi <morph@debian.org> + +diff -urNad matplotlib~/doc/make.py matplotlib/doc/make.py +--- matplotlib~/doc/make.py 2009-08-01 21:14:12.000000000 +0200 ++++ matplotlib/doc/make.py 2009-10-09 08:56:04.000000000 +0200 +@@ -30,7 +30,7 @@ + check_build() + shutil.copy('../lib/matplotlib/mpl-data/matplotlibrc', '_static/matplotlibrc') + if small_docs: +- options = "-D plot_formats=\"['png']\"" ++ options = "-D plot_formats=\"[('png', 80)]\"" + else: + options = '' + if os.system('sphinx-build %s -P -b html -d build/doctrees . build/html' % options): diff --git a/dev-python/matplotlib/files/matplotlib-0.99.1.1-eintr.patch b/dev-python/matplotlib/files/matplotlib-0.99.1.1-eintr.patch new file mode 100644 index 000000000000..3af61d34e33a --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-0.99.1.1-eintr.patch @@ -0,0 +1,46 @@ +--- lib/matplotlib/font_manager.py 2009/11/12 17:27:34 7952 ++++ lib/matplotlib/font_manager.py 2009/11/12 17:28:22 7953 +@@ -42,7 +42,7 @@ + see license/LICENSE_TTFQUERY. + """ + +-import os, sys, glob ++import os, sys, glob, subprocess + try: + set + except NameError: +@@ -292,16 +292,12 @@ + grab all of the fonts the user wants to be made available to + applications, without needing knowing where all of them reside. + """ +- try: +- import commands +- except ImportError: +- return {} +- + fontext = get_fontext_synonyms(fontext) + + fontfiles = {} +- status, output = commands.getstatusoutput("fc-list file") +- if status == 0: ++ pipe = subprocess.Popen(['fc-list', '', 'file'], stdout=subprocess.PIPE) ++ output = pipe.communicate()[0] ++ if pipe.returncode == 0: + for line in output.split('\n'): + fname = line.split(':')[0] + if (os.path.splitext(fname)[1][1:] in fontext and +@@ -1244,11 +1240,11 @@ + import re + + def fc_match(pattern, fontext): +- import commands + fontexts = get_fontext_synonyms(fontext) + ext = "." + fontext +- status, output = commands.getstatusoutput('fc-match -sv "%s"' % pattern) +- if status == 0: ++ pipe = subprocess.Popen(['fc-match', '-sv', pattern], stdout=subprocess.PIPE) ++ output = pipe.communicate()[0] ++ if pipe.returncode == 0: + for match in _fc_match_regex.finditer(output): + file = match.group(1) + if os.path.splitext(file)[1][1:] in fontexts: diff --git a/dev-python/matplotlib/files/matplotlib-0.99.1.1-gtk-tooltip.patch b/dev-python/matplotlib/files/matplotlib-0.99.1.1-gtk-tooltip.patch new file mode 100644 index 000000000000..e4c6091a4c9f --- /dev/null +++ b/dev-python/matplotlib/files/matplotlib-0.99.1.1-gtk-tooltip.patch @@ -0,0 +1,81 @@ +--- lib/matplotlib/backends/backend_gtk.py 2010/02/18 14:54:30 8141 ++++ lib/matplotlib/backends/backend_gtk.py 2010/03/20 22:49:25 8203 +@@ -17,6 +17,8 @@ + % (gtk.pygtk_version + pygtk_version_required)) + del pygtk_version_required + ++_new_tooltip_api = (gtk.pygtk_version[1] >= 12) ++ + import matplotlib + from matplotlib import verbose + from matplotlib._pylab_helpers import Gcf +@@ -448,7 +450,7 @@ + # diong a blanket catch here, but an not sure what a + # better way is - JDH + verbose.report('Could not load matplotlib icon: %s' % sys.exc_info()[1]) +- ++ + self.vbox = gtk.VBox() + self.window.add(self.vbox) + self.vbox.show() +@@ -618,7 +620,8 @@ + + def _init_toolbar2_4(self): + basedir = os.path.join(matplotlib.rcParams['datapath'],'images') +- self.tooltips = gtk.Tooltips() ++ if not _new_tooltip_api: ++ self.tooltips = gtk.Tooltips() + + for text, tooltip_text, image_file, callback in self.toolitems: + if text is None: +@@ -630,7 +633,10 @@ + tbutton = gtk.ToolButton(image, text) + self.insert(tbutton, -1) + tbutton.connect('clicked', getattr(self, callback)) +- tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private') ++ if _new_tooltip_api: ++ tbutton.set_tooltip_text(tooltip_text) ++ else: ++ tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private') + + toolitem = gtk.SeparatorToolItem() + self.insert(toolitem, -1) +@@ -760,7 +766,8 @@ + def _create_toolitems_2_4(self): + # use the GTK+ 2.4 GtkToolbar API + iconSize = gtk.ICON_SIZE_SMALL_TOOLBAR +- self.tooltips = gtk.Tooltips() ++ if not _new_tooltip_api: ++ self.tooltips = gtk.Tooltips() + + for text, tooltip_text, image_num, callback, callback_arg, scroll \ + in self.toolitems: +@@ -778,15 +785,22 @@ + tbutton.connect('clicked', getattr(self, callback)) + if scroll: + tbutton.connect('scroll_event', getattr(self, callback)) +- tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private') ++ if _new_tooltip_api: ++ tbutton.set_tooltip_text(tooltip_text) ++ else: ++ tbutton.set_tooltip(self.tooltips, tooltip_text, 'Private') + + # Axes toolitem, is empty at start, update() adds a menu if >=2 axes + self.axes_toolitem = gtk.ToolItem() + self.insert(self.axes_toolitem, 0) +- self.axes_toolitem.set_tooltip ( +- self.tooltips, +- tip_text='Select axes that controls affect', +- tip_private = 'Private') ++ if _new_tooltip_api: ++ self.axes_toolitem.set_tooltip_text( ++ 'Select axes that controls affect') ++ else: ++ self.axes_toolitem.set_tooltip ( ++ self.tooltips, ++ tip_text='Select axes that controls affect', ++ tip_private = 'Private') + + align = gtk.Alignment (xalign=0.5, yalign=0.5, xscale=0.0, yscale=0.0) + self.axes_toolitem.add(align) + diff --git a/dev-python/matplotlib/files/matplotlib-0.99.1.1-libpng14.patch b/dev-python/matplotlib/files/matplotlib-0.99.1.1-libpng14.patch index bcdcb14e0673..853248ecc3ba 100644 --- a/dev-python/matplotlib/files/matplotlib-0.99.1.1-libpng14.patch +++ b/dev-python/matplotlib/files/matplotlib-0.99.1.1-libpng14.patch @@ -2,12 +2,14 @@ http://www.mail-archive.com/pld-cvs-commit@lists.pld-linux.org/msg209718.html --- src/_png.cpp +++ src/_png.cpp -@@ -290,7 +290,7 @@ +@@ -290,7 +290,9 @@ //free the png memory png_read_end(png_ptr, info_ptr); - png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL); ++#ifndef png_infopp_NULL + png_destroy_read_struct(&png_ptr, &info_ptr, NULL); ++#endif fclose(fp); for (row = 0; row < height; row++) delete [] row_pointers[row]; diff --git a/dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild b/dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild new file mode 100644 index 000000000000..0b3d5331e3c9 --- /dev/null +++ b/dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild @@ -0,0 +1,204 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild,v 1.1 2010/05/31 20:23:16 bicatali Exp $ + +EAPI="2" +PYTHON_DEPEND="2" +SUPPORT_PYTHON_ABIS="1" +WX_GTK_VER="2.8" + +inherit eutils distutils wxwidgets + +PDOC="users_guide_${PV}" + +DESCRIPTION="Pure python plotting library with matlab like syntax" +HOMEPAGE="http://matplotlib.sourceforge.net/ http://pypi.python.org/pypi/matplotlib" +SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" + +IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets" +SLOT="0" +KEYWORDS="~amd64 ~ppc ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" +LICENSE="PYTHON BSD" + +CDEPEND="dev-python/numpy + dev-python/python-dateutil + dev-python/pytz + media-libs/freetype:2 + media-libs/libpng + gtk? ( dev-python/pygtk ) + tk? ( dev-lang/python[tk] ) + wxwidgets? ( dev-python/wxpython:2.8 )" + +DEPEND="${CDEPEND} + dev-python/pycxx + dev-util/pkgconfig + doc? ( + dev-python/sphinx + media-gfx/graphviz[cairo] + || ( ( dev-texlive/texlive-latexextra + dev-texlive/texlive-fontsrecommended + dev-texlive/texlive-latexrecommended ) + ( app-text/ptex dev-tex/latex-unicode ) ) + app-text/dvipng + dev-python/imaging + dev-python/ipython + excel? ( dev-python/xlwt ) )" + +RDEPEND="${CDEPEND} + virtual/ttf-fonts + media-fonts/texcm-ttf + dev-python/pyparsing + cairo? ( dev-python/pycairo ) + excel? ( dev-python/xlwt ) + fltk? ( dev-python/pyfltk ) + qt4? ( dev-python/PyQt4[X] ) + traits? ( dev-python/traits dev-python/configobj ) + latex? ( + virtual/latex-base + app-text/ghostscript-gpl + app-text/dvipng + app-text/poppler[utils] + || ( dev-texlive/texlive-fontsrecommended + app-text/ptex ) )" +RESTRICT_PYTHON_ABIS="3.*" + +DOCS="INTERACTIVE" + +use_setup() { + local uword="${2}" + [ -z "${2}" ] && uword="${1}" + if use ${1}; then + echo "${uword} = True" + echo "${uword}agg = True" + else + echo "${uword} = False" + echo "${uword}agg = False" + fi +} + +src_prepare() { + # avoid to launch xv while building examples docs + epatch "${FILESDIR}"/${PN}-0.98.5.2-no-xv.patch + + # removes hardcoded lib paths, should not break non-Prefix, more + # likely to fix it in case of multilib + epatch "${FILESDIR}"/${P}-prefix.patch + epatch "${FILESDIR}"/${PN}-0.99.0-freebsd7+.patch + + # support libpng-1.4 (from upstream svn) + epatch "${FILESDIR}"/${P}-libpng14.patch + # allow better small docs (from upstream svn) + epatch "${FILESDIR}"/${P}-docs.patch + # allow compatibility with pygtk-2.12 tooltop (from upstream svn) + epatch "${FILESDIR}"/${P}-gtk-tooltip.patch + # some font stuff (from upstream svn) + epatch "${FILESDIR}"/${P}-eintr.patch + + # create setup.cfg (see setup.cfg.template for any changes) + cat > setup.cfg <<-EOF + [provide_packages] + pytz = False + dateutil = False + configobj = False + enthought.traits = False + [gui_support] + $(use_setup gtk) + $(use_setup tk) + $(use_setup wxwidgets wx) + $(use_setup qt4) + $(use_setup fltk) + $(use_setup cairo) + EOF + + # avoid checks needing a X display + sed -i \ + -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \ + -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \ + setup.py || die "sed setup.py failed" + + # respect FHS: + # - mpl-data in /usr/share/matplotlib + # - config files in /etc/matplotlib + sed -i \ + -e "/'mpl-data\/matplotlibrc',/d" \ + -e "/'mpl-data\/matplotlib.conf',/d" \ + -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \ + -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \ + setup.py \ + || die "sed setup.py for FHS failed" + + # remove internal copies of fonts, pycxx, pyparsing + rm -rf \ + CXX \ + lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \ + lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \ + lib/matplotlib/pyparsing.py \ + || die "removed internal copies failed" + + sed -i \ + -e 's/matplotlib.pyparsing/pyparsing/g' \ + lib/matplotlib/{mathtext,fontconfig_pattern}.py \ + || die "sed pyparsing failed" +} + +src_compile() { + unset DISPLAY # bug #278524 + + distutils_src_compile_pre_hook() { + ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" . + } + distutils_src_compile + + if use doc; then + cd "${S}/doc" + export VARTEXFONTS="${T}"/fonts + MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \ + PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \ + "$(PYTHON -f)" make.py --small all + MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \ + PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \ + "$(PYTHON -f)" make.py --small all + [[ -e build/latex/Matplotlib.pdf ]] && die "doc generation failed" + fi +} + +src_test() { + # if doc were enabled, all examples were built and tested + use doc && return + einfo "Tests are quite long, be patient" + cd "${S}/examples/tests" + testing() { + PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1 + PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean + } + python_execute_function testing +} + +src_install() { + # sed only after doc building, to allow using default configs + sed -i \ + -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \ + -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \ + build-*/lib*/matplotlib/__init__.py \ + || die "sed init for FHS failed" + [[ -z ${ED} ]] && local ED="${D}" + distutils_src_install + + # Respect FHS + dodir /usr/share/${PN} + mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} "${ED}usr/share/${PN}" || die "Renaming failed" + rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} + + insinto /etc/matplotlib + doins matplotlibrc matplotlib.conf || die "installing config files failed" + + # doc and examples + insinto /usr/share/doc/${PF} + if use doc; then + doins doc/build/latex/Matplotlib.pdf || die + doins -r doc/build/html || die + fi + if use examples; then + doins -r examples || die + fi +} |