*/*: Clean PYTHON_COMPAT of obsolete impls
[gentoo.git] / dev-python / pycurl / pycurl-7.43.0.3.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 # The selftests fail with pypy, and urlgrabber segfaults for me.
7 PYTHON_COMPAT=( python2_7 python3_{6,7} )
8
9 inherit distutils-r1
10
11 DESCRIPTION="python binding for curl/libcurl"
12 HOMEPAGE="
13         https://github.com/pycurl/pycurl
14         https://pypi.org/project/pycurl/
15         http://pycurl.io/"
16 SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
17
18 LICENSE="LGPL-2.1"
19 SLOT="0"
20 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos"
21 IUSE="curl_ssl_gnutls curl_ssl_libressl curl_ssl_nss +curl_ssl_openssl examples ssl test"
22 RESTRICT="!test? ( test )"
23
24 # Depend on a curl with curl_ssl_* USE flags.
25 # libcurl must not be using an ssl backend we do not support.
26 # If the libcurl ssl backend changes pycurl should be recompiled.
27 # If curl uses gnutls, depend on at least gnutls 2.11.0 so that pycurl
28 # does not need to initialize gcrypt threading and we do not need to
29 # explicitly link to libgcrypt.
30 RDEPEND="
31         >=net-misc/curl-7.25.0-r1:=[ssl=]
32         ssl? (
33                 net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_libressl(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-)]
34                 curl_ssl_gnutls? ( >=net-libs/gnutls-2.11.0:= )
35                 curl_ssl_libressl? ( dev-libs/libressl:= )
36                 curl_ssl_openssl? ( dev-libs/openssl:= )
37         )"
38
39 # bottle-0.12.7: https://github.com/pycurl/pycurl/issues/180
40 # bottle-0.12.7: https://github.com/defnull/bottle/commit/f35197e2a18de1672831a70a163fcfd38327a802
41 DEPEND="${RDEPEND}
42         test? (
43                 dev-python/bottle[${PYTHON_USEDEP}]
44                 dev-python/flaky[${PYTHON_USEDEP}]
45                 dev-python/nose[${PYTHON_USEDEP}]
46                 net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_libressl(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-),http2]
47                 >=dev-python/bottle-0.12.7[${PYTHON_USEDEP}]
48         )"
49 # Needed for individual runs of testsuite by python impls.
50 DISTUTILS_IN_SOURCE_BUILD=1
51
52 python_prepare_all() {
53         sed -e "/setup_args\['data_files'\] = /d" -i setup.py || die
54         distutils-r1_python_prepare_all
55 }
56
57 python_configure_all() {
58         # Override faulty detection in setup.py, bug 510974.
59         export PYCURL_SSL_LIBRARY=${CURL_SSL/libressl/openssl}
60 }
61
62 python_compile() {
63         python_is_python3 || local -x CFLAGS="${CFLAGS} -fno-strict-aliasing"
64         distutils-r1_python_compile
65 }
66
67 python_test() {
68         nosetests -a '!standalone,!gssapi' -v --with-flaky || die "Tests fail with ${EPYTHON}"
69         nosetests -a 'standalone' -v --with-flaky || die "Tests fail with ${EPYTHON}"
70 }
71
72 python_install_all() {
73         local HTML_DOCS=( doc/. )
74         use examples && dodoc -r examples
75         distutils-r1_python_install_all
76 }