]> git.draconx.ca Git - gentoo-fixes.git/blob - dev-python/pycairo/pycairo-1.18.2-r4.ebuild
dev-python/pycairo: Adapt to more python2 disabling.
[gentoo-fixes.git] / dev-python / pycairo / pycairo-1.18.2-r4.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 DISTUTILS_OPTIONAL=yes
20
21 inherit distutils-r1
22
23 DESCRIPTION="Python bindings for the cairo library"
24 HOMEPAGE="https://www.cairographics.org/pycairo/ https://github.com/pygobject/pycairo"
25 SRC_URI="https://github.com/pygobject/${PN}/releases/download/v${PV}/${P}.tar.gz"
26
27 LICENSE="|| ( LGPL-2.1 MPL-1.1 )"
28 SLOT="2"
29 KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~mips ppc ppc64 s390 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
30 IUSE="examples +python_targets_python2_7"
31
32 # Strong block on old pycairo w/ python2 support because the merge will
33 # otherwise not work properly due to replacing a directory with a file.
34
35 DEPEND=">=x11-libs/cairo-1.13.1[svg]
36         !!dev-python/pycairo:0[python_targets_python2_7]"
37 RDEPEND="$DEPEND
38         dev-lang/python:2.7"
39 BDEPEND="dev-lang/python:2.7"
40
41 REQUIRED_USE=$PYTHON_REQUIRED_USE
42
43 PATCHES=(
44         "$FILESDIR/$P-no-setuptools.patch"
45         "$FILESDIR/$PN-1.19.1-py39.patch"
46 )
47
48 distutils_enable_tests setup.py
49
50 src_prepare () { default; distutils-r1_src_prepare; }
51
52 python_compile () {
53         _distutils-r1_copy_egg_info
54         esetup.py build "$@"
55 }
56
57 src_configure () { distutils-r1_src_configure; }
58 src_compile ()   { distutils-r1_src_compile; }
59 src_test ()      { distutils-r1_src_test; }
60 src_install ()   { distutils-r1_src_install; }
61
62 python_test() {
63         einfo "Skipping tests on Python 2 to unblock deps"
64 }
65
66 python_install() {
67         distutils-r1_python_install \
68                 install_pkgconfig --pkgconfigdir="${EPREFIX}/usr/$(get_libdir)/pkgconfig"
69 }
70
71 python_install_all() {
72         if use examples; then
73                 dodoc -r examples
74         fi
75
76         distutils-r1_python_install_all
77 }