dev-perl/Class-Inspector: amd64 stable
[gentoo.git] / dev-python / cairocffi / cairocffi-0.8.0.ebuild
1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="6"
5
6 PYTHON_COMPAT=( python2_7 python3_{4,5,6} pypy )
7
8 inherit distutils-r1 virtualx
9
10 MY_PN="${PN}"
11 MY_P="${MY_PN}-${PV}"
12
13 DESCRIPTION="CFFI-based drop-in replacement for Pycairo"
14 HOMEPAGE="https://github.com/Kozea/cairocffi"
15 SRC_URI="mirror://pypi/${MY_P:0:1}/${MY_PN}/${MY_P}.tar.gz"
16
17 LICENSE="BSD"
18 SLOT="0"
19 KEYWORDS="amd64 ~arm ~arm64 ~ppc ppc64 x86"
20 IUSE="doc test"
21
22 RDEPEND="
23         $(python_gen_cond_dep '>=dev-python/cffi-1.1.0:=[${PYTHON_USEDEP}]' 'python*')
24         >=dev-python/xcffib-0.3.2[${PYTHON_USEDEP}]
25         x11-libs/cairo:0=[xcb]
26         x11-libs/gdk-pixbuf[jpeg]
27         $(python_gen_cond_dep '>=virtual/pypy-2.6.0' pypy )"
28
29 DEPEND="
30         dev-python/setuptools[${PYTHON_USEDEP}]
31         doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
32         test? (
33                 ${RDEPEND}
34                 dev-python/pytest[${PYTHON_USEDEP}]
35         )
36         $(python_gen_cond_dep '>=virtual/pypy-2.6.0' pypy )"
37
38 PATCHES=( "${FILESDIR}"/${P}-tests.patch )
39
40 S="${WORKDIR}/${MY_P}"
41
42 python_compile_all() {
43         use doc && esetup.py build_sphinx
44 }
45
46 python_test() {
47         virtx py.test -v --pyargs cairocffi || die "testsuite failed under ${EPYTHON}"
48 }
49
50 python_install_all() {
51         use doc && HTML_DOCS=( docs/_build/html/. )
52         distutils-r1_python_install_all
53 }