/[gentoo-x86]/dev-python/matplotlib/matplotlib-1.1.1.ebuild
Gentoo

Contents of /dev-python/matplotlib/matplotlib-1.1.1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Thu Sep 12 22:29:33 2013 UTC (15 months, 1 week ago) by mgorny
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +2 -2 lines
Replace virtual/pyparsing dep with dev-python/pyparsing. The split versions were removed and all in-tree versions support all impls now.

(Portage version: 2.2.3/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-1.1.1.ebuild,v 1.9 2013/06/09 17:21:43 floppym Exp $
4
5 EAPI="3"
6
7 PYTHON_DEPEND="2"
8 PYTHON_USE_WITH="tk"
9 PYTHON_USE_WITH_OPT="tk"
10 SUPPORT_PYTHON_ABIS="1"
11 RESTRICT_PYTHON_ABIS="3* *-jython 2.7-pypy-*"
12 PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
13 PYTHON_CXXFLAGS=("2.* + -fno-strict-aliasing")
14 PYTHON_MODNAME="matplotlib mpl_toolkits pylab.py"
15
16 WX_GTK_VER="2.8"
17
18 inherit distutils eutils
19
20 DESCRIPTION="Pure python plotting library with matlab like syntax"
21 HOMEPAGE="http://matplotlib.sourceforge.net/ http://pypi.python.org/pypi/matplotlib"
22 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
23
24 IUSE="cairo doc excel examples fltk gtk latex qt4 test tk wxwidgets"
25 SLOT="0"
26 KEYWORDS="amd64 ppc ~ppc64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
27
28 # Main license: matplotlib
29 # Some modules: BSD
30 # matplotlib/backends/qt4_editor: MIT
31 # Fonts: BitstreamVera, OFL-1.1
32 LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
33
34 CDEPEND="dev-python/numpy
35 dev-python/python-dateutil
36 dev-python/pytz
37 media-libs/freetype:2
38 media-libs/libpng
39 gtk? ( dev-python/pygtk )
40 wxwidgets? ( dev-python/wxpython:2.8 )"
41
42 # internal copy of pycxx highly patched
43 # dev-python/pycxx
44
45 DEPEND="${CDEPEND}
46 virtual/pkgconfig
47 doc? (
48 app-text/dvipng
49 virtual/python-imaging
50 dev-python/ipython
51 dev-python/xlwt
52 dev-python/sphinx
53 dev-texlive/texlive-latexextra
54 dev-texlive/texlive-fontsrecommended
55 dev-texlive/texlive-latexrecommended
56 media-gfx/graphviz[cairo]
57 )
58 test? ( dev-python/nose )"
59
60 RDEPEND="${CDEPEND}
61 dev-python/pyparsing
62 cairo? ( dev-python/pycairo )
63 excel? ( dev-python/xlwt )
64 fltk? ( dev-python/pyfltk )
65 latex? (
66 virtual/latex-base
67 app-text/ghostscript-gpl
68 app-text/dvipng
69 app-text/poppler[utils]
70 dev-texlive/texlive-fontsrecommended
71 )
72 qt4? ( || ( dev-python/PyQt4[X] dev-python/pyside[X] ) )"
73
74 use_setup() {
75 local uword="${2:-${1}}"
76 if use ${1}; then
77 echo "${uword} = True"
78 echo "${uword}agg = True"
79 else
80 echo "${uword} = False"
81 echo "${uword}agg = False"
82 fi
83 }
84
85 src_prepare() {
86 # from upstream commit ca678a49f37411b1b0e72d7d0dfa88c124b0e34b
87 epatch "${FILESDIR}"/${P}-ft-refcount.patch
88
89 # create setup.cfg (see setup.cfg.template for any changes)
90 cat > setup.cfg <<-EOF
91 [provide_packages]
92 pytz = False
93 dateutil = False
94 [gui_support]
95 $(use_setup cairo)
96 $(use_setup fltk)
97 $(use_setup gtk)
98 $(use_setup qt4)
99 $(use_setup tk)
100 $(use_setup wxwidgets wx)
101 EOF
102
103 # avoid checks needing a X display
104 sed -i \
105 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
106 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
107 setup.py || die "sed setup.py failed"
108
109 # remove internal copies of pyparsing
110 rm lib/matplotlib/pyparsing.py || die
111 sed -i \
112 -e 's/matplotlib.pyparsing/pyparsing/g' \
113 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
114 || die "sed pyparsing failed"
115 distutils_src_prepare
116 }
117
118 src_compile() {
119 unset DISPLAY # bug #278524
120 distutils_src_compile
121 makedocs() {
122 if use doc; then
123 cd "${S}/doc"
124 VARTEXFONTS="${T}"/fonts \
125 PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
126 ./make.py --small all
127 [[ -e build/latex/Matplotlib.pdf ]] || die "doc generation failed"
128 fi
129 }
130 python_execute_function -f makedocs
131 }
132
133 src_test() {
134 # if doc was enabled, all examples were built and tested
135 use doc && return
136 testing() {
137 "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install \
138 --home="${S}/test-${PYTHON_ABI}" --no-compile \
139 || die "install test failed"
140 pushd "${S}/test-${PYTHON_ABI}/"lib* > /dev/null
141 PYTHONPATH=python \
142 "$(PYTHON)" -c "import matplotlib as m; m.test(verbosity=2)" \
143 2>&1 | tee test.log
144 grep -Eq "^(ERROR|FAIL):" test.log && return 1
145 popd > /dev/null
146 rm -r test-${PYTHON_ABI}
147 }
148 python_execute_function testing
149 }
150
151 src_install() {
152 distutils_src_install
153 if use doc; then
154 insinto /usr/share/doc/${PF}
155 doins -r doc/build/latex/Matplotlib.pdf doc/build/html || die
156 fi
157 if use examples; then
158 insinto /usr/share/doc/${PF}
159 doins -r examples || die
160 fi
161 }

  ViewVC Help
Powered by ViewVC 1.1.20