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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Thu Apr 25 16:27:34 2013 UTC (16 months, 3 weeks ago) by bicatali
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +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.2.0-r1.ebuild,v 1.5 2013/02/02 01:17:03 mr_bones_ Exp $
4
5 EAPI="3"
6
7 PYTHON_DEPEND="*:2.6"
8 PYTHON_USE_WITH="tk"
9 PYTHON_USE_WITH_OPT="tk"
10 SUPPORT_PYTHON_ABIS="1"
11 RESTRICT_PYTHON_ABIS="3.3 *-jython 2.7-pypy-*"
12 PYTHON_TESTS_RESTRICTED_ABIS="2.[56] 3.1"
13 DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1"
14 PYTHON_CFLAGS=("2.* + -fno-strict-aliasing" "3.* + -fno-strict-aliasing")
15 PYTHON_CXXFLAGS=("2.* + -fno-strict-aliasing" "3.* + -fno-strict-aliasing")
16 PYTHON_MODNAME="matplotlib mpl_toolkits pylab.py"
17
18 WX_GTK_VER="2.8"
19
20 inherit distutils eutils
21
22 DESCRIPTION="Pure python plotting library with matlab like syntax"
23 HOMEPAGE="http://matplotlib.org/ http://pypi.python.org/pypi/matplotlib"
24 SRC_URI="mirror://github/${PN}/${PN}/${P}.tar.gz"
25
26 IUSE="cairo doc excel examples fltk gtk gtk3 latex qt4 test tk wxwidgets"
27 SLOT="0"
28 KEYWORDS="~amd64 ~ppc ~ppc64 ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
29
30 # Main license: matplotlib
31 # Some modules: BSD
32 # matplotlib/backends/qt4_editor: MIT
33 # Fonts: BitstreamVera, OFL-1.1
34 LICENSE="BitstreamVera BSD matplotlib MIT OFL-1.1"
35
36 CDEPEND="dev-python/numpy
37 dev-python/python-dateutil
38 dev-python/pytz
39 dev-python/six
40 media-fonts/stix-fonts
41 media-libs/freetype:2
42 media-libs/libpng
43 gtk? ( dev-python/pygtk )
44 gtk3? ( dev-python/pygobject:3
45 x11-libs/gtk+:3[introspection] )
46 wxwidgets? ( dev-python/wxpython:2.8 )"
47
48 # internal copy of pycxx highly patched
49 # dev-python/pycxx
50
51 DEPEND="${CDEPEND}
52 virtual/pkgconfig
53 doc? (
54 app-text/dvipng
55 dev-python/imaging
56 dev-python/ipython
57 dev-python/xlwt
58 dev-python/sphinx
59 dev-texlive/texlive-latexextra
60 dev-texlive/texlive-fontsrecommended
61 dev-texlive/texlive-latexrecommended
62 media-gfx/graphviz[cairo]
63 )
64 test? ( dev-python/nose )"
65
66 RDEPEND="${CDEPEND}
67 virtual/pyparsing
68 cairo? ( dev-python/pycairo )
69 excel? ( dev-python/xlwt )
70 fltk? ( dev-python/pyfltk )
71 latex? (
72 virtual/latex-base
73 app-text/ghostscript-gpl
74 app-text/dvipng
75 app-text/poppler[utils]
76 dev-texlive/texlive-fontsrecommended
77 )
78 qt4? ( || ( dev-python/PyQt4[X] dev-python/pyside[X] ) )"
79
80 RESTRICT="mirror"
81
82 use_setup() {
83 local uword="${2:-${1}}"
84 if use ${1}; then
85 echo "${uword} = True"
86 echo "${uword}agg = True"
87 else
88 echo "${uword} = False"
89 echo "${uword}agg = False"
90 fi
91 }
92
93 src_prepare() {
94 # create setup.cfg (see setup.cfg.template for any changes), default to py2.
95 cat > setup.cfg <<-EOF
96 [provide_packages]
97 pytz = False
98 dateutil = False
99 [gui_support]
100 six = False
101 $(use_setup cairo)
102 $(use_setup fltk)
103 $(use_setup gtk)
104 $(use_setup qt4)
105 $(use_setup tk)
106 $(use_setup wxwidgets wx)
107 EOF
108 distutils_src_prepare
109 SetSetup() {
110 if [[ "$(python_get_version --major)" == '3' ]]; then
111 sed -e 's:^gtk = True:gtk = False:' \
112 -e 's:^gtkagg = True:gtkagg = False:' \
113 -e 's:^wx = True:wx = False:' \
114 -e 's:^wxagg = True:wxagg = False:' \
115 -e 's:^six = False:six = True:' \
116 -i setup.cfg || die
117 fi
118
119 # avoid checks needing a X display
120 epatch "${FILESDIR}"/${P}-setup.patch
121
122 # Fix test, issue no. 1532
123 epatch "${FILESDIR}"/${P}-ft-refcount.patch
124
125 # remove internal copies of pyparsing
126 rm lib/matplotlib/pyparsing{_py2,_py3}.py || die
127 sed -i -e 's/matplotlib.pyparsing_py[23]/pyparsing/g' \
128 lib/matplotlib/{mathtext,fontconfig_pattern}.py \
129 || die "sed pyparsing failed"
130
131 }
132 python_execute_function -q -s SetSetup
133 }
134
135 src_compile() {
136 unset DISPLAY # bug #278524
137 distutils_src_compile
138 buildDocs() {
139 if [[ "$(python_get_version --major)" == '2' ]]; then
140 pushd doc > /dev/null
141 VARTEXFONTS="${T}"/fonts \
142 PYTHONPATH=$(ls -d "${WORKDIR}"/${P}-${PYTHON_ABI}/build/lib.linux*-${PYTHON_ABI}/) \
143 $(PYTHON) ./make.py --small all
144 [[ -e build/latex/Matplotlib.pdf ]] || die "doc generation failed"
145 popd > /dev/null
146 fi
147 }
148 use doc && python_execute_function buildDocs
149 }
150
151 src_test() {
152 # if doc was enabled, all examples were built and tested
153 use doc && return
154 testing() {
155 mkdir test-${PYTHON_ABI}
156 "$(PYTHON)" setup.py build -b "build-${PYTHON_ABI}" install \
157 --home="./test-${PYTHON_ABI}" --no-compile \
158 || die "install test failed"
159 pushd test-${PYTHON_ABI}/lib/ > /dev/null
160 PYTHONPATH=python \
161 "$(PYTHON)" -c "import matplotlib as m; m.test(verbosity=2)" \
162 2>&1 | tee test.log
163 grep -Eq "^(ERROR|FAIL):" test.log && return 1
164 popd > /dev/null
165 rm -r test-${PYTHON_ABI}
166 }
167 python_execute_function -s testing
168 }
169
170 src_install() {
171 distutils_src_install
172 if use doc; then
173 insinto /usr/share/doc/${PF}
174 doins -r doc/build/latex/Matplotlib.pdf doc/build/html || die
175 fi
176 if use examples; then
177 insinto /usr/share/doc/${PF}
178 doins -r examples || die
179 fi
180 }

  ViewVC Help
Powered by ViewVC 1.1.20