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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (hide annotations) (download)
Mon May 24 14:59:11 2010 UTC (8 years, 2 months ago) by nixnut
Branch: MAIN
Changes since 1.5: +2 -2 lines
ppc stable #320581
(Portage version: 2.1.8.3/cvs/Linux ppc)

1 arfrever 1.1 # Copyright 1999-2010 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3 nixnut 1.6 # $Header: /var/cvsroot/gentoo-x86/dev-python/matplotlib/matplotlib-0.99.1.1-r1.ebuild,v 1.5 2010/03/26 17:19:45 spatz Exp $
4 arfrever 1.1
5     EAPI="2"
6     PYTHON_DEPEND="2"
7     SUPPORT_PYTHON_ABIS="1"
8     WX_GTK_VER="2.8"
9    
10 pva 1.2 inherit eutils distutils wxwidgets
11 arfrever 1.1
12     PDOC="users_guide_${PV}"
13    
14     DESCRIPTION="Pure python plotting library with matlab like syntax"
15     HOMEPAGE="http://matplotlib.sourceforge.net/ http://pypi.python.org/pypi/matplotlib"
16     SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
17    
18     IUSE="cairo doc excel examples fltk gtk latex qt4 traits tk wxwidgets"
19     SLOT="0"
20 nixnut 1.6 KEYWORDS="~amd64 ppc ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
21 arfrever 1.1 LICENSE="PYTHON BSD"
22    
23     CDEPEND=">=dev-python/numpy-1.1
24     dev-python/python-dateutil
25     dev-python/pytz
26     media-libs/freetype:2
27     media-libs/libpng
28     gtk? ( dev-python/pygtk )
29     tk? ( dev-lang/python[tk] )
30     wxwidgets? ( dev-python/wxpython:2.8 )"
31    
32     DEPEND="${CDEPEND}
33     dev-python/pycxx
34     dev-util/pkgconfig
35     doc? (
36     >=dev-python/sphinx-0.5.1
37     || (
38     >=media-gfx/graphviz-2.24.0[cairo]
39     <media-gfx/graphviz-2.24.0[cairo,png]
40     )
41     || ( ( dev-texlive/texlive-latexextra
42     dev-texlive/texlive-latexrecommended )
43     ( app-text/ptex dev-tex/latex-unicode ) )
44     app-text/dvipng
45     dev-python/imaging
46     dev-python/ipython )"
47    
48     RDEPEND="${CDEPEND}
49 spatz 1.5 virtual/ttf-fonts
50 arfrever 1.1 media-fonts/texcm-ttf
51     cairo? ( dev-python/pycairo )
52     excel? ( dev-python/xlwt )
53     fltk? ( dev-python/pyfltk )
54     qt4? ( dev-python/PyQt4[X] )
55     traits? ( dev-python/traits dev-python/configobj )
56     latex? (
57     virtual/latex-base
58     app-text/ghostscript-gpl
59     app-text/dvipng
60 ssuominen 1.3 >=app-text/poppler-0.12.3-r3[utils]
61 arfrever 1.1 || ( dev-texlive/texlive-fontsrecommended
62     app-text/ptex ) )"
63     RESTRICT_PYTHON_ABIS="3.*"
64    
65     DOCS="INTERACTIVE"
66    
67     use_setup() {
68     local uword="${2}"
69     [ -z "${2}" ] && uword="${1}"
70     if use ${1}; then
71     echo "${uword} = True"
72     echo "${uword}agg = True"
73     else
74     echo "${uword} = False"
75     echo "${uword}agg = False"
76     fi
77     }
78    
79     src_prepare() {
80     # avoid to launch xv while building examples docs
81     epatch "${FILESDIR}"/${PN}-0.98.5.2-no-xv.patch
82    
83     # removes hardcoded lib paths, should not break non-Prefix, more
84     # likely to fix it in case of multilib
85     epatch "${FILESDIR}"/${P}-prefix.patch
86     epatch "${FILESDIR}"/${PN}-0.99.0-freebsd7+.patch
87    
88     # create setup.cfg (see setup.cfg.template for any changes)
89     cat > setup.cfg <<-EOF
90     [provide_packages]
91     pytz = False
92     dateutil = False
93     configobj = False
94     enthought.traits = False
95     [gui_support]
96     $(use_setup gtk)
97     $(use_setup tk)
98     $(use_setup wxwidgets wx)
99     $(use_setup qt4)
100     $(use_setup fltk)
101     $(use_setup cairo)
102     EOF
103    
104     # avoid checks needing a X display
105     sed -i \
106     -e "s/check_for_gtk()/$(use gtk && echo True || echo False)/" \
107     -e "s/check_for_tk()/$(use tk && echo True || echo False)/" \
108     setup.py || die "sed setup.py failed"
109    
110     # respect FHS:
111     # - mpl-data in /usr/share/matplotlib
112     # - config files in /etc/matplotlib
113     sed -i \
114     -e "/'mpl-data\/matplotlibrc',/d" \
115     -e "/'mpl-data\/matplotlib.conf',/d" \
116     -e "s:'lib/matplotlib/mpl-data/matplotlibrc':'matplotlibrc':" \
117     -e "s:'lib/matplotlib/mpl-data/matplotlib.conf':'matplotlib.conf':" \
118     setup.py \
119     || die "sed setup.py for FHS failed"
120    
121     sed -i \
122     -e "s:path = get_data_path():path = '${EPREFIX}/etc/matplotlib':" \
123     -e "s:os.path.dirname(__file__):'${EPREFIX}/usr/share/${PN}':g" \
124     lib/matplotlib/{__init__,config/cutils}.py \
125     || die "sed init for FHS failed"
126    
127     # remove internal copies of fonts, pycxx, pyparsing
128     rm -rf \
129     CXX \
130     lib/matplotlib/mpl-data/fonts/{afm,pdfcorefonts} \
131     lib/matplotlib/mpl-data/fonts/ttf/{Vera*,cm*,*.TXT} \
132     || die "removed internal copies failed"
133    
134     # remove pyparsing only when upstream pyparsing included matplotlib
135     # fixes. See bug #260025
136     #rm -f lib/matplotlib/pyparsing.py
137 ssuominen 1.4
138     epatch "${FILESDIR}"/${P}-libpng14.patch
139 arfrever 1.1 }
140    
141     src_compile() {
142     unset DISPLAY # bug #278524
143    
144     distutils_src_compile_pre_hook() {
145     ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" .
146     }
147     distutils_src_compile
148    
149     if use doc; then
150     cd "${S}/doc"
151     export VARTEXFONTS="${T}"/fonts
152     # no die function here: broken compilation at the end, do it twice,
153     # result ok.
154     MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
155     PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
156     "$(PYTHON -f)" make.py html
157     MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
158     PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
159     "$(PYTHON -f)" make.py
160     fi
161     }
162    
163     src_test() {
164     einfo "Tests are quite long, be patient"
165     cd "${S}/examples/tests"
166     testing() {
167     PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1
168     PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean
169     }
170     python_execute_function testing
171     }
172    
173     src_install() {
174     [[ -z ${ED} ]] && local ED=${D}
175     distutils_src_install
176    
177     # Respect FHS
178     dodir /usr/share/${PN}
179     mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} "${ED}usr/share/${PN}" || die "Renaming failed"
180     rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib}
181    
182     insinto /etc/matplotlib
183     doins matplotlibrc matplotlib.conf || die "installing config files failed"
184    
185     # doc and examples
186     insinto /usr/share/doc/${PF}
187     if use doc; then
188     doins doc/build/latex/Matplotlib.pdf || die
189     doins -r doc/build/html || die
190     fi
191     if use examples; then
192     doins -r examples || die
193     fi
194     }

  ViewVC Help
Powered by ViewVC 1.1.20