summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <bicatali@gentoo.org>2010-05-31 20:23:16 +0000
committerSebastien Fabbro <bicatali@gentoo.org>2010-05-31 20:23:16 +0000
commitff11e301e722c348797ede28634e1e14afaba70d (patch)
treea1c67bc4d4f47f8d3657057634c296e6fe76288d /dev-python/matplotlib
parentold (diff)
downloadhistorical-ff11e301e722c348797ede28634e1e14afaba70d.tar.gz
historical-ff11e301e722c348797ede28634e1e14afaba70d.tar.bz2
historical-ff11e301e722c348797ede28634e1e14afaba70d.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
Package-Manager: portage-2.2_rc67/cvs/Linux x86_64
Diffstat (limited to 'dev-python/matplotlib')
-rw-r--r--dev-python/matplotlib/ChangeLog13
-rw-r--r--dev-python/matplotlib/Manifest18
-rw-r--r--dev-python/matplotlib/files/matplotlib-0.99.1.1-docs.patch16
-rw-r--r--dev-python/matplotlib/files/matplotlib-0.99.1.1-eintr.patch46
-rw-r--r--dev-python/matplotlib/files/matplotlib-0.99.1.1-gtk-tooltip.patch81
-rw-r--r--dev-python/matplotlib/files/matplotlib-0.99.1.1-libpng14.patch4
-rw-r--r--dev-python/matplotlib/matplotlib-0.99.1.1-r2.ebuild204
7 files changed, 378 insertions, 4 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/Manifest b/dev-python/matplotlib/Manifest
index 8b783961dda9..e6d3974aaa0d 100644
--- a/dev-python/matplotlib/Manifest
+++ b/dev-python/matplotlib/Manifest
@@ -1,8 +1,22 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX matplotlib-0.98.5.2-no-xv.patch 368 RMD160 e0d3cf32f2e74f2f6b9dbcb1de603e5588d9be92 SHA1 a4671aac2912d32646d14245d2d25b3a088887b9 SHA256 c03edfaca5b01335b126b88de423923229ec9418d0f81093ff109004c155931d
AUX matplotlib-0.99.0-freebsd7+.patch 311 RMD160 3c39e6c196b2195691dafcb718fdb2c5d1456121 SHA1 7928d232b5228a22f8cd6897f4eadf75c30aefb0 SHA256 a86e74c7048474768eb1aaa23076454d132ccaf630119dbf3546532f4b96fe85
-AUX matplotlib-0.99.1.1-libpng14.patch 404 RMD160 c259f9acb51b9981da68f14268d0c446184f1501 SHA1 eab90ab67ab4a7757f85e35f14b85c6dc363cc20 SHA256 7d1676f1b508ef27dabccd4efe52d5a47ca23c55735fd9777ae303a612cd1749
+AUX matplotlib-0.99.1.1-docs.patch 680 RMD160 624d870e97e52c260995909a74f5444eecc6a8d0 SHA1 feaf603104f41ea33a9ad6d9c65e565a0c552c55 SHA256 ed654680d099c69f0f496b301053571e1ea8a60071c9af355294571a75d919aa
+AUX matplotlib-0.99.1.1-eintr.patch 1576 RMD160 57f233cf11552581e6105245222689e19ba4f064 SHA1 1267ee76e048743f2ad219fad30e7b6a93b18a62 SHA256 4d9545d7c4221908f064688fa13d0cb994655befaafe13a8b83f7361b5d85a75
+AUX matplotlib-0.99.1.1-gtk-tooltip.patch 3234 RMD160 94e84e0ddfa45bf137b29dc9c2262c9a77c61156 SHA1 b67a2b7371db4647edd6a88f1f5ee796e6031e2d SHA256 7faa48903942e56aa8c5827c76d3512f321a5f94823abb11b3b7ae4869187747
+AUX matplotlib-0.99.1.1-libpng14.patch 437 RMD160 098d46ef5f4dc1ed4807de7d0f13a15cf732d755 SHA1 e0f1b4e6b2c1da3a2bb24f90ca6c6f6010cf63d1 SHA256 bfdae68031a48bc822bde538c29e32877411cf1889539ed3b44ec048493b3279
AUX matplotlib-0.99.1.1-prefix.patch 1374 RMD160 f30e66336d6e51414babc63f0cc1e79319f27a3a SHA1 8201f7f5f4ce788aac91acc8cdd1d0ff43ae6a93 SHA256 0cf04d6d5124793af0e89bbf7aa20d821dccb5b7b95eb04aeeaa2723a48345ff
DIST matplotlib-0.99.1.1.tar.gz 11905737 RMD160 2bd025944eab18d41ddf9f521c00a1f065346738 SHA1 57b5f1e3f0c8866af99f72fca06b4e529acba31d SHA256 1b94b4632ee4dcd41862f2a2e90fdca8f2e6fb108700c06a16e764782da49041
EBUILD matplotlib-0.99.1.1-r1.ebuild 5485 RMD160 9e7db22133575c4d8ee6a3f017efab263c8cc2fb SHA1 f0b72e875dca012d6e79fdea8ac15a6642913689 SHA256 218a3bc10766a9190b9cb044863a2028f32b6099db6b4eded1997abe794d93d2
-MISC ChangeLog 16567 RMD160 fa9ee7c6c31dce4df710ca2b6d930d46c3c57086 SHA1 3881b106f15da299456c13b799f88c2c67460775 SHA256 c332bd9fb809ca109c6106c0407b721ad15f49f67f78311391ef46e7985bbca5
+EBUILD matplotlib-0.99.1.1-r2.ebuild 5987 RMD160 032ce91b765ae85ac5485d9ebb793b35a5b9f1d8 SHA1 55d7da2241a027a3824aaa2ca24c1b2463efb07d SHA256 6c4a518b63af870891286b4d810c84de911fc5c7ad6f9ebed87f0b4194ef9846
+MISC ChangeLog 17076 RMD160 36fddbd67dd73481fe811c936f04b3ed796c9887 SHA1 742fa318975189c51dccd233708fba19d90d9147 SHA256 ba2f64ba98e7f9400ed4a3b83b4f92730227cea65fdd43dc3cfee7349154f578
MISC metadata.xml 640 RMD160 5a3412572c06b5f54b7570a6d42e503b5711b8b9 SHA1 dbdefc26499cd67470a363f54fcb928f2f510fcf SHA256 6643fb3ec5019f58c1a7af76a25d791f1109c37929b3332ddbe1a2911f5de3b4
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.15 (GNU/Linux)
+
+iEYEARECAAYFAkwEI3EACgkQ1ycZbhPLE2AiPACgkkOcGsWg6QbcVlRNPXStUWtS
+th8An3kakWh/FQAuMYkgIVIJzAjmpNM+
+=3kzl
+-----END PGP SIGNATURE-----
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
+}