/[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.1 - (hide annotations) (download)
Sat Feb 6 14:13:41 2010 UTC (8 years, 8 months ago) by arfrever
Branch: MAIN
Set SUPPORT_PYTHON_ABIS.
(Portage version: 15324-svn/cvs/Linux x86_64)

1 arfrever 1.1 # Copyright 1999-2010 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: $
4    
5     EAPI="2"
6     PYTHON_DEPEND="2"
7     SUPPORT_PYTHON_ABIS="1"
8     WX_GTK_VER="2.8"
9    
10     inherit distutils wxwidgets
11    
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     KEYWORDS="~amd64 ~ppc ~x86 ~x86-freebsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
21     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     || ( media-fonts/dejavu media-fonts/ttf-bitstream-vera )
50     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     virtual/poppler-utils
61     || ( 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     }
138    
139     src_compile() {
140     unset DISPLAY # bug #278524
141    
142     distutils_src_compile_pre_hook() {
143     ln -fs "${EPREFIX}/usr/share/python$(python_get_version)/CXX" .
144     }
145     distutils_src_compile
146    
147     if use doc; then
148     cd "${S}/doc"
149     export VARTEXFONTS="${T}"/fonts
150     # no die function here: broken compilation at the end, do it twice,
151     # result ok.
152     MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
153     PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
154     "$(PYTHON -f)" make.py html
155     MATPLOTLIBDATA="${S}/lib/matplotlib/mpl-data" \
156     PYTHONPATH=$(ls -d "${S}"/build-$(PYTHON -f --ABI)/lib*) \
157     "$(PYTHON -f)" make.py
158     fi
159     }
160    
161     src_test() {
162     einfo "Tests are quite long, be patient"
163     cd "${S}/examples/tests"
164     testing() {
165     PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py agg || return 1
166     PYTHONPATH=$(ls -d "${S}"/build-${PYTHON_ABI}/lib*) "$(PYTHON)" backend_driver.py --clean
167     }
168     python_execute_function testing
169     }
170    
171     src_install() {
172     [[ -z ${ED} ]] && local ED=${D}
173     distutils_src_install
174    
175     # Respect FHS
176     dodir /usr/share/${PN}
177     mv "${ED}$(python_get_sitedir -f)/${PN}/"{mpl-data,backends/Matplotlib.nib} "${ED}usr/share/${PN}" || die "Renaming failed"
178     rm -fr "${ED}"usr/lib*/python*/site-packages/${PN}/{mpl-data,backends/Matplotlib.nib}
179    
180     insinto /etc/matplotlib
181     doins matplotlibrc matplotlib.conf || die "installing config files failed"
182    
183     # doc and examples
184     insinto /usr/share/doc/${PF}
185     if use doc; then
186     doins doc/build/latex/Matplotlib.pdf || die
187     doins -r doc/build/html || die
188     fi
189     if use examples; then
190     doins -r examples || die
191     fi
192     }

  ViewVC Help
Powered by ViewVC 1.1.20