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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20