]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pycairo/pycairo-1.18.2.ebuild
Resurrect dev-python/pygtk.
[gentoo-fixes.git] / dev-python / pycairo / pycairo-1.18.2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 PYTHON_COMPAT=( python2_7 python3_{6..9} )
7 PYTHON_REQ_USE="threads(+)"
8
9 inherit distutils-r1
10
11 DESCRIPTION="Python bindings for the cairo library"
12 HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
13 SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
14
15 LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
16 SLOT="0"
17 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
18 IUSE="examples"
19
20 BDEPEND="
21         test? (
22                 $(python_gen_cond_dep '
23                         dev-python/hypothesis[${PYTHON_USEDEP}]
24                         dev-python/pytest[${PYTHON_USEDEP}]
25                 ' -3)
26         )
27 "
28 RDEPEND="
29         >=x11-libs/cairo-1.13.1[svg]
30 "
31 DEPEND="${RDEPEND}"
32
33 PATCHES=( "${FILESDIR}/${PN}-1.19.1-py39.patch" )
34
35 distutils_enable_sphinx docs \
36         dev-python/sphinx_rtd_theme
37 distutils_enable_tests setup.py
38
39 python_test() {
40         if ! python_is_python3; then
41                 einfo "Skipping tests on Python 2 to unblock deps"
42                 return
43         fi
44
45         esetup.py test
46 }
47
48 python_install() {
49         distutils-r1_python_install \
50                 install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
51 }
52
53 python_install_all() {
54         if use examples; then
55                 dodoc -r examples
56         fi
57
58         distutils-r1_python_install_all
59 }