diff options
author | Sebastien Fabbro <bicatali@gentoo.org> | 2012-01-17 06:36:09 +0000 |
---|---|---|
committer | Sebastien Fabbro <bicatali@gentoo.org> | 2012-01-17 06:36:09 +0000 |
commit | 458577c21bbdeba673c5f8d3e9046f81e174f4af (patch) | |
tree | 7e4e503e6a36928bec89f68c4e571c2eaece261d /dev-python/matplotlib/matplotlib-1.1.0.ebuild | |
parent | Version bump (diff) | |
download | gentoo-2-458577c21bbdeba673c5f8d3e9046f81e174f4af.tar.gz gentoo-2-458577c21bbdeba673c5f8d3e9046f81e174f4af.tar.bz2 gentoo-2-458577c21bbdeba673c5f8d3e9046f81e174f4af.zip |
Added PySide for optional GUI (bug #393647), removed traits dependency (bug #398919), now download examples from upstream, some cleaning, hopefully fixing doc generation (bug #339775)
(Portage version: 2.1.10.41/cvs/Linux x86_64)
Diffstat (limited to 'dev-python/matplotlib/matplotlib-1.1.0.ebuild')
-rw-r--r-- | dev-python/matplotlib/matplotlib-1.1.0.ebuild | 80 |
1 files changed, 42 insertions, 38 deletions
diff --git a/dev-python/matplotlib/matplotlib-1.1.0.ebuild b/dev-python/matplotlib/matplotlib-1.1.0.ebuild index c0bb501064d6..bb205b1a5e6a 100644 --- a/dev-python/matplotlib/matplotlib-1.1.0.ebuild +++ b/dev-python/matplotlib/matplotlib-1.1.0.ebuild @@ -1,24 +1,25 @@ -# Copyright 1999-2011 Gentoo Foundation +# Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-1.1.0.ebuild,v 1.2 2011/12/03 18:06:01 hwoarang Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-1.1.0.ebuild,v 1.3 2012/01/17 06:36:09 bicatali Exp $ EAPI="3" + PYTHON_DEPEND="2" PYTHON_USE_WITH="tk" PYTHON_USE_WITH_OPT="tk" SUPPORT_PYTHON_ABIS="1" -RESTRICT_PYTHON_ABIS="3.* *-jython" +RESTRICT_PYTHON_ABIS="3.* *-jython *-pypy-*" WX_GTK_VER="2.8" -inherit distutils eutils +inherit distutils 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 - doc? ( mirror://gentoo/${PN}-sampledata.tar.bz2 ) - examples? ( mirror://gentoo/${PN}-sampledata.tar.bz2 )" + doc? ( mirror://sourceforge/${PN}/mpl_sampledata-${PV}.tar.gz ) + examples? ( mirror://sourceforge/${PN}/mpl_sampledata-${PV}.tar.gz )" -IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets" +IUSE="cairo doc excel examples fltk gtk latex qt4 tk wxwidgets" SLOT="0" KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos" # Main license: matplotlib @@ -58,8 +59,7 @@ RDEPEND="${CDEPEND} cairo? ( dev-python/pycairo ) excel? ( dev-python/xlwt ) fltk? ( dev-python/pyfltk ) - qt4? ( dev-python/PyQt4[X] ) - traits? ( dev-python/traits dev-python/configobj ) + qt4? ( || ( dev-python/PyQt4[X] dev-python/pyside ) ) latex? ( virtual/latex-base app-text/ghostscript-gpl @@ -74,8 +74,7 @@ PYTHON_CXXFLAGS=("2.* + -fno-strict-aliasing") PYTHON_MODNAME="matplotlib mpl_toolkits pylab.py" use_setup() { - local uword="${2}" - [[ -z "${2}" ]] && uword="${1}" + local uword="${2:-${1}}" if use ${1}; then echo "${uword} = True" echo "${uword}agg = True" @@ -91,15 +90,13 @@ src_prepare() { [provide_packages] pytz = False dateutil = False - configobj = False - enthought.traits = False [gui_support] + $(use_setup cairo) + $(use_setup fltk) $(use_setup gtk) + $(use_setup qt4) $(use_setup tk) $(use_setup wxwidgets wx) - $(use_setup qt4) - $(use_setup fltk) - $(use_setup cairo) EOF # avoid checks needing a X display @@ -116,18 +113,17 @@ src_prepare() { -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" + setup.py || die "sed setup.py for FHS failed" # remove internal copies of pycxx, pyparsing rm -rf CXX lib/matplotlib/pyparsing.py \ || die "removed internal copies failed" - # bug #334429 - also see https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts + # bug #334429 https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts # which advise against bakoma fonts sed -i \ -e '/fontset/s/cm/stix/' \ - lib/matplotlib/mpl-data/matplotlib.conf || die + lib/matplotlib/mpl-data/matplotlib.conf* || die sed -i \ -e 's/matplotlib.pyparsing/pyparsing/g' \ @@ -135,11 +131,16 @@ src_prepare() { || die "sed pyparsing failed" # some fixes to avoid fetching data while compiling examples in tests - mv "${WORKDIR}"/sample_data examples/ - echo "examples.download : False" >> doc/matplotlibrc - echo "examples.directory : ${S}/examples/sample_data" >> doc/matplotlibrc - echo "examples.download : False" >> matplotlibrc.template - echo "examples.directory : ${EPREFIX}/usr/share/${PF}/examples/sample_data" >> matplotlibrc.template + if use doc || use examples; then + cat <<-EOF >> doc/matplotlibrc + examples.download : False + examples.directory : "${WORKDIR}"/mpl_sampledata-${PV} + EOF + cat <<-EOF >> matplotlibrc.template + examples.download : False + examples.directory : "${EPREFIX}"/usr/share/${PF}/examples + EOF + fi } src_compile() { @@ -151,8 +152,8 @@ src_compile() { if use doc; then cd "${S}/doc" - export VARTEXFONTS="${T}"/fonts MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \ + VARTEXFONTS="${T}"/fonts \ PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \ "$(PYTHON -f)" make.py --small all [[ -e build/latex/Matplotlib.pdf ]] || die "doc generation failed" @@ -165,17 +166,19 @@ src_test() { 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 + 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() { # remove fonts bundles except some computer modern ones - rm lib/matplotlib/mpl-data/fonts/ttf/cm{ex,mi,r,sy}10.ttf - rm lib/matplotlib/mpl-data/fonts/ttf/{Vera*,*.TXT} - rm lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} + rm -f lib/matplotlib/mpl-data/fonts/ttf/cm{ex,mi,r,sy}10.ttf || die + rm -f lib/matplotlib/mpl-data/fonts/ttf/{Vera*,*.TXT} || die + rm -rf lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} || die # sed only after doc building, to allow using default configs sed -i \ @@ -185,22 +188,23 @@ src_install() { || die "sed init for FHS failed" distutils_src_install - # Respect FHS + # 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} + rm -fr "${ED}"usr/lib*/*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib} insinto /etc/matplotlib - doins matplotlibrc matplotlib.conf || die "installing config files failed" + doins matplotlibrc matplotlib.conf # 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 + insinto /usr/share/doc/${PF} + doins -r doc/build/latex/Matplotlib.pdf doc/build/html || die fi if use examples; then - doins -r examples || die + insinto /usr/share/doc/${PF}/examples + doins -r "${WORKDIR}"/mpl_sampledata-${PV}/* || die fi + } |