]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pycairo/pycairo-1.18.2-r3.ebuild
Work around python-r1 eclass dropping python2.
[gentoo-fixes.git] / dev-python / pycairo / pycairo-1.18.2-r3.ebuild
1 # Copyright © 2020-2021 Nick Bowler
2 #
3 # License GPLv2+: GNU General Public License version 2 or any later version.
4 # This is free software: you are free to change and redistribute it.
5 # There is NO WARRANTY, to the extent permitted by law.
6 #
7 # This is a modified version of the original ebuild from Gentoo GNU/Linux,
8 # covered by the following copyright and permission notice:
9 #
10 #   Copyright 1999-2020 Gentoo Authors
11 #   Distributed under the terms of the GNU General Public License v2
12
13 EAPI=7
14
15 _PYTHON_ALLOW_PY27=1
16 PYTHON_COMPAT=( python2_7 )
17 PYTHON_REQ_USE="threads(+)"
18 DISTUTILS_USE_SETUPTOOLS=no
19
20 inherit distutils-r1
21
22 DESCRIPTION="Python bindings for the cairo library"
23 HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
24 SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
25
26 LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
27 SLOT="2"
28 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
29 IUSE="examples"
30
31 # Strong block on old pycairo w/ python2 support because the merge will
32 # otherwise not work properly due to replacing a directory with a file.
33
34 RDEPEND=">=x11-libs/cairo-1.13.1[svg]
35         !!dev-python/pycairo:0[python_targets_python2_7]"
36 DEPEND=$RDEPEND
37
38 PATCHES=(
39         "$FILESDIR/$P-no-setuptools.patch"
40         "$FILESDIR/$PN-1.19.1-py39.patch"
41 )
42
43 distutils_enable_tests setup.py
44
45 python_test() {
46         einfo "Skipping tests on Python 2 to unblock deps"
47 }
48
49 python_install() {
50         distutils-r1_python_install \
51                 install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
52 }
53
54 python_install_all() {
55         if use examples; then
56                 dodoc -r examples
57         fi
58
59         distutils-r1_python_install_all
60 }