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

Contents of /dev-python/matplotlib/matplotlib-1.0.1-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.15 - (show annotations) (download)
Thu Apr 25 16:27:34 2013 UTC (19 months ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.14: +1 -1 lines
FILE REMOVED
Version bump

(Portage version: 2.2.01.21890-prefix/cvs/Linux x86_64, signed Manifest commit with key 0x13CB1360)

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.0.1-r1.ebuild,v 1.14 2013/01/06 19:20:12 idella4 Exp $
4
5 EAPI="3"
6 PYTHON_DEPEND="2"
7 PYTHON_USE_WITH="tk"
8 PYTHON_USE_WITH_OPT="tk"
9 SUPPORT_PYTHON_ABIS="1"
10 RESTRICT_PYTHON_ABIS="3.* *-jython"
11 WX_GTK_VER="2.8"
12
13 inherit distutils eutils
14
15 DESCRIPTION="Pure python plotting library with matlab like syntax"
16 HOMEPAGE="http://matplotlib.sourceforge.net/ http://pypi.python.org/pypi/matplotlib"
17 SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
18 doc? ( mirror://gentoo/${PN}-sampledata.tar.bz2 )
19 examples? ( mirror://gentoo/${PN}-sampledata.tar.bz2 )"
20
21 IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets"
22 SLOT="0"
23 KEYWORDS="amd64 ppc ~ppc64 x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
24 # Main license: matplotlib
25 # Some modules: BSD
26 # matplotlib/backends/qt4_editor: MIT
27 # Fonts: BitstreamVera, OFL-1.1
28 LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
29
30 CDEPEND="dev-python/numpy
31 dev-python/python-dateutil
32 dev-python/pytz
33 media-libs/freetype:2
34 media-libs/libpng
35 gtk? ( dev-python/pygtk )
36 wxwidgets? ( dev-python/wxpython:2.8 )"
37
38 DEPEND="${CDEPEND}
39 dev-python/pycxx
40 virtual/pkgconfig
41 doc? (
42 app-text/dvipng
43 dev-python/imaging
44 dev-python/ipython
45 dev-python/xlwt
46 dev-python/sphinx
47 media-gfx/graphviz[cairo]
48 dev-texlive/texlive-latexextra
49 dev-texlive/texlive-fontsrecommended
50 dev-texlive/texlive-latexrecommended
51 )"
52
53 RDEPEND="${CDEPEND}
54 virtual/ttf-fonts
55 media-fonts/stix-fonts
56 media-fonts/texcm-ttf
57 virtual/pyparsing
58 cairo? ( dev-python/pycairo )
59 excel? ( dev-python/xlwt )
60 fltk? ( dev-python/pyfltk )
61 qt4? ( dev-python/PyQt4[X] )
62 traits? ( dev-python/traits dev-python/configobj )
63 latex? (
64 virtual/latex-base
65 app-text/ghostscript-gpl
66 app-text/dvipng
67 app-text/poppler[utils]
68 dev-texlive/texlive-fontsrecommended
69 )"
70
71 PYTHON_CFLAGS=("2.* + -fno-strict-aliasing")
72 PYTHON_CXXFLAGS=("2.* + -fno-strict-aliasing")
73
74 DOCS="INTERACTIVE"
75 PYTHON_MODNAME="matplotlib mpl_toolkits pylab.py"
76
77 use_setup() {
78 local uword="${2}"
79 [[ -z "${2}" ]] && uword="${1}"
80 if use ${1}; then
81 echo "${uword} = True"
82 echo "${uword}agg = True"
83 else
84 echo "${uword} = False"
85 echo "${uword}agg = False"
86 fi
87 }
88
89 src_prepare() {
90 # create setup.cfg (see setup.cfg.template for any changes)
91 cat > setup.cfg <<-EOF
92 [provide_packages]
93 pytz = False
94 dateutil = False
95 configobj = False
96 enthought.traits = False
97 [gui_support]
98 $(use_setup gtk)
99 $(use_setup tk)
100 $(use_setup wxwidgets wx)
101 $(use_setup qt4)
102 $(use_setup fltk)
103 $(use_setup cairo)
104 EOF
105
106 # avoid checks needing a X display
107 sed -i \
108 -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
109 -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
110 setup.py || die "sed setup.py failed"
111
112 # respect FHS:
113 # - mpl-data in /usr/share/matplotlib
114 # - config files in /etc/matplotlib
115 sed -i \
116 -e "/'mpl-data\/matplotlibrc',/d" \
117 -e "/'mpl-data\/matplotlib.conf',/d" \
118 -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
119 -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
120 setup.py \
121 || die "sed setup.py for FHS failed"
122
123 # remove internal copies of pycxx, pyparsing
124 rm -rf CXX lib/matplotlib/pyparsing.py \
125 || die "removed internal copies failed"
126
127 # bug #334429 - also see https://developer.mozilla.org/en/Mozilla_MathML_Project/Fonts
128 # which advise against bakoma fonts
129 sed -i \
130 -e '/fontset/s/cm/stix/' \
131 lib/matplotlib/mpl-data/matplotlib.conf || die
132
133 sed -i \
134 -e 's/matplotlib.pyparsing/pyparsing/g' \
135 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
136 || die "sed pyparsing failed"
137
138 # some fixes to avoid fetching data while compiling examples in tests
139 mv "${WORKDIR}"/sample_data examples/
140 echo "examples.download : False" >> doc/matplotlibrc
141 echo "examples.directory : ${S}/examples/sample_data" >> doc/matplotlibrc
142 echo "examples.download : False" >> matplotlibrc.template
143 echo "examples.directory : ${EPREFIX}/usr/share/${PF}/examples/sample_data" >> matplotlibrc.template
144
145 epatch "${FILESDIR}"/${P}-libpng15.patch
146 epatch "${FILESDIR}"/${P}-sphinx.patch
147 epatch "${FILESDIR}"/${P}-linux3.patch
148 }
149
150 src_compile() {
151 unset DISPLAY # bug #278524
152 distutils_src_compile_pre_hook() {
153 ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" .
154 }
155 distutils_src_compile
156
157 if use doc; then
158 cd "${S}/doc"
159 export VARTEXFONTS="${T}"/fonts
160 MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
161 PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
162 "$(PYTHON -f)" make.py --small all
163 [[ -e build/latex/Matplotlib.pdf ]] || die "doc generation failed"
164 fi
165 }
166
167 src_test() {
168 # if doc were enabled, all examples were built and tested
169 use doc && return
170 einfo "Tests are quite long, be patient"
171 cd "${S}/examples/tests"
172 testing() {
173 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1
174 PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean
175 }
176 python_execute_function testing
177 }
178
179 src_install() {
180 # remove fonts bundles except some computer modern ones
181 rm lib/matplotlib/mpl-data/fonts/ttf/cm{ex,mi,r,sy}10.ttf
182 rm lib/matplotlib/mpl-data/fonts/ttf/{Vera*,*.TXT}
183 rm lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts}
184
185 # sed only after doc building, to allow using default configs
186 sed -i \
187 -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \
188 -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \
189 build-*/lib*/matplotlib/__init__.py \
190 || die "sed init for FHS failed"
191 distutils_src_install
192
193 # Respect FHS
194 dodir /usr/share/${PN}
195 mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} \
196 "${ED}usr/share/${PN}" || die "Renaming failed"
197 rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib}
198
199 insinto /etc/matplotlib
200 doins matplotlibrc matplotlib.conf || die "installing config files failed"
201
202 # doc and examples
203 insinto /usr/share/doc/${PF}
204 if use doc; then
205 doins doc/build/latex/Matplotlib.pdf || die
206 doins -r doc/build/html || die
207 fi
208 if use examples; then
209 doins -r examples || die
210 fi
211 }

  ViewVC Help
Powered by ViewVC 1.1.20