1 |
commit: 3c2b03d2213e595856fff4337025c135c4f41966 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri May 13 07:23:46 2022 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri May 13 09:08:01 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c2b03d2 |
7 |
|
8 |
dev-python/pycurl: Use PEP517 build |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
dev-python/pycurl/pycurl-7.44.1-r1.ebuild | 94 +++++++++++++++++++++++++++++++ |
13 |
1 file changed, 94 insertions(+) |
14 |
|
15 |
diff --git a/dev-python/pycurl/pycurl-7.44.1-r1.ebuild b/dev-python/pycurl/pycurl-7.44.1-r1.ebuild |
16 |
new file mode 100644 |
17 |
index 000000000000..f518e4d959f4 |
18 |
--- /dev/null |
19 |
+++ b/dev-python/pycurl/pycurl-7.44.1-r1.ebuild |
20 |
@@ -0,0 +1,94 @@ |
21 |
+# Copyright 1999-2022 Gentoo Authors |
22 |
+# Distributed under the terms of the GNU General Public License v2 |
23 |
+ |
24 |
+EAPI=8 |
25 |
+ |
26 |
+DISTUTILS_USE_PEP517=setuptools |
27 |
+PYTHON_COMPAT=( python3_{8..10} ) |
28 |
+ |
29 |
+inherit distutils-r1 toolchain-funcs |
30 |
+ |
31 |
+DESCRIPTION="python binding for curl/libcurl" |
32 |
+HOMEPAGE=" |
33 |
+ http://pycurl.io/ |
34 |
+ https://github.com/pycurl/pycurl/ |
35 |
+ https://pypi.org/project/pycurl/ |
36 |
+" |
37 |
+SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz" |
38 |
+ |
39 |
+LICENSE="LGPL-2.1" |
40 |
+SLOT="0" |
41 |
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos" |
42 |
+IUSE="curl_ssl_gnutls curl_ssl_nss +curl_ssl_openssl examples ssl test" |
43 |
+RESTRICT="!test? ( test )" |
44 |
+ |
45 |
+# Depend on a curl with curl_ssl_* USE flags. |
46 |
+# libcurl must not be using an ssl backend we do not support. |
47 |
+# If the libcurl ssl backend changes pycurl should be recompiled. |
48 |
+# If curl uses gnutls, depend on at least gnutls 2.11.0 so that pycurl |
49 |
+# does not need to initialize gcrypt threading and we do not need to |
50 |
+# explicitly link to libgcrypt. |
51 |
+DEPEND=" |
52 |
+ >=net-misc/curl-7.25.0-r1:=[ssl=] |
53 |
+ ssl? ( |
54 |
+ net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-)] |
55 |
+ curl_ssl_gnutls? ( >=net-libs/gnutls-2.11.0:= ) |
56 |
+ curl_ssl_openssl? ( dev-libs/openssl:= ) |
57 |
+ ) |
58 |
+" |
59 |
+ |
60 |
+RDEPEND=" |
61 |
+ ${DEPEND} |
62 |
+" |
63 |
+BDEPEND=" |
64 |
+ test? ( |
65 |
+ >=dev-python/bottle-0.12.7[${PYTHON_USEDEP}] |
66 |
+ dev-python/flaky[${PYTHON_USEDEP}] |
67 |
+ net-misc/curl[curl_ssl_gnutls(-)=,curl_ssl_nss(-)=,curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-),http2] |
68 |
+ ) |
69 |
+" |
70 |
+ |
71 |
+PATCHES=( |
72 |
+ "${FILESDIR}/7.44-fix-tests.patch" |
73 |
+) |
74 |
+ |
75 |
+distutils_enable_tests pytest |
76 |
+ |
77 |
+python_prepare_all() { |
78 |
+ # docs installed into the wrong directory |
79 |
+ sed -e "/setup_args\['data_files'\] = /d" -i setup.py || die |
80 |
+ # TODO |
81 |
+ sed -e 's:test_socks5_gssapi_nec_setopt:_&:' \ |
82 |
+ -i tests/option_constants_test.py || die |
83 |
+ |
84 |
+ distutils-r1_python_prepare_all |
85 |
+} |
86 |
+ |
87 |
+python_configure_all() { |
88 |
+ # Override faulty detection in setup.py, bug 510974. |
89 |
+ export PYCURL_SSL_LIBRARY=${CURL_SSL} |
90 |
+} |
91 |
+ |
92 |
+src_test() { |
93 |
+ emake -C tests/fake-curl/libcurl CC="$(tc-getCC)" |
94 |
+ |
95 |
+ distutils-r1_src_test |
96 |
+} |
97 |
+ |
98 |
+python_test() { |
99 |
+ local -x PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 |
100 |
+ local EPYTEST_DESELECT=( |
101 |
+ # refcounting tests are unreliable |
102 |
+ tests/memory_mgmt_test.py::MemoryMgmtTest::test_readdata_refcounting |
103 |
+ tests/memory_mgmt_test.py::MemoryMgmtTest::test_writedata_refcounting |
104 |
+ tests/memory_mgmt_test.py::MemoryMgmtTest::test_writeheader_refcounting |
105 |
+ ) |
106 |
+ |
107 |
+ epytest -p flaky tests |
108 |
+} |
109 |
+ |
110 |
+python_install_all() { |
111 |
+ local HTML_DOCS=( doc/. ) |
112 |
+ use examples && dodoc -r examples |
113 |
+ distutils-r1_python_install_all |
114 |
+} |