summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2022-06-22 06:56:40 +0200
committerMichał Górny <mgorny@gentoo.org>2022-06-22 07:48:03 +0200
commitd1b89e421a9672754cd0e702442b4be419715e2b (patch)
treea0c28f7b5e632c1cff77285d0eea552e7ea7eb39
parentdev-python/cryptography: Bump to 37.0.3 (diff)
downloadgentoo-d1b89e421a9672754cd0e702442b4be419715e2b.tar.gz
gentoo-d1b89e421a9672754cd0e702442b4be419715e2b.tar.bz2
gentoo-d1b89e421a9672754cd0e702442b4be419715e2b.zip
dev-python/pycares: Bump to 4.2.0
Signed-off-by: Michał Górny <mgorny@gentoo.org>
-rw-r--r--dev-python/pycares/Manifest1
-rw-r--r--dev-python/pycares/files/pycares-4.2.0-c-ares-1.18.patch37
-rw-r--r--dev-python/pycares/pycares-4.2.0.ebuild54
3 files changed, 92 insertions, 0 deletions
diff --git a/dev-python/pycares/Manifest b/dev-python/pycares/Manifest
index d672ee1b4d11..0f234db35a7c 100644
--- a/dev-python/pycares/Manifest
+++ b/dev-python/pycares/Manifest
@@ -1 +1,2 @@
DIST pycares-4.1.2.tar.gz 43668 BLAKE2B 4b26f8643ff5ce297981b0b60b3afb34b249138e8f702dd4aa0a38935e9e5338d048f3be1b4fb64d6d8b2259a279a8881dbd44b412c10427dbd7eee664e70495 SHA512 6fb2d24fb5f2638c55424608b02ebe9f630866d644decfb663ab9d8e2bb7a42629748fa220054747f9c36ce3dcb42f3b8e457c5c39009f94b564ff07efde0c84
+DIST pycares-4.2.0.gh.tar.gz 43939 BLAKE2B 6cac12ff2b3c44cf7d04b4ce3067d5435d416788e89251d87825e5ea265ecb178948e0187c47e8dfe40ec0480a66b8b2f6cc2c45e74473e9d66f5cc74269f50f SHA512 14c813242ff6cdc5249ae52c2b9ff1870d7b74c7c6083868b2b4bbe0ce2af3f15e9b2775f67940ffbfc4ce84a6a9232ba4fab5a17ef389f7a197a15318280e43
diff --git a/dev-python/pycares/files/pycares-4.2.0-c-ares-1.18.patch b/dev-python/pycares/files/pycares-4.2.0-c-ares-1.18.patch
new file mode 100644
index 000000000000..2e094a2b2f1c
--- /dev/null
+++ b/dev-python/pycares/files/pycares-4.2.0-c-ares-1.18.patch
@@ -0,0 +1,37 @@
+From 72202e0bc135e360102371708e83334856d485cc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Wed, 22 Jun 2022 07:38:33 +0200
+Subject: [PATCH] core: add flexible member to ares_addrinfo to fix c-ares 1.18
+
+Add a flexible member to account for c-ares 1.18 adding an additional
+`name` member to `struct ares_addrinfo`. This fixes the following
+exception from cffi, and the resulting test_getaddrinfo* failures:
+
+```
+Exception ignored from cffi callback <function _addrinfo_cb at 0x7f5fa890d040>:
+Traceback (most recent call last):
+ File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 162, in _addrinfo_cb
+ result = ares_addrinfo_result(res)
+ File "/tmp/pycares/.tox/py39/lib/python3.9/site-packages/pycares/__init__.py", line 841, in __init__
+ cname_ptr = ares_addrinfo.cnames
+ffi.error: struct ares_addrinfo: wrong total size (cdef says 16, but C compiler says 24). fix it or use "...;" as the last field in the cdef for struct ares_addrinfo to make it flexible
+```
+---
+ src/_cffi_src/build_cares.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/src/_cffi_src/build_cares.py b/src/_cffi_src/build_cares.py
+index 77f03aa..dec42c9 100644
+--- a/src/_cffi_src/build_cares.py
++++ b/src/_cffi_src/build_cares.py
+@@ -337,6 +337,7 @@ struct ares_addrinfo_cname {
+ struct ares_addrinfo {
+ struct ares_addrinfo_cname *cnames;
+ struct ares_addrinfo_node *nodes;
++ ...;
+ };
+
+ struct ares_addrinfo_hints {
+--
+2.35.1
+
diff --git a/dev-python/pycares/pycares-4.2.0.ebuild b/dev-python/pycares/pycares-4.2.0.ebuild
new file mode 100644
index 000000000000..e3380b899f52
--- /dev/null
+++ b/dev-python/pycares/pycares-4.2.0.ebuild
@@ -0,0 +1,54 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{8..11} )
+
+inherit distutils-r1
+
+DESCRIPTION="Python interface for c-ares"
+HOMEPAGE="
+ https://github.com/saghul/pycares/
+ https://pypi.org/project/pycares/
+"
+SRC_URI="
+ https://github.com/saghul/pycares/archive/${P}.tar.gz
+ -> ${P}.gh.tar.gz
+"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~riscv ~x86"
+IUSE="test"
+# Tests fail with network-sandbox, since they try to resolve google.com
+PROPERTIES="test_network"
+RESTRICT="test"
+
+DEPEND="
+ net-dns/c-ares:=
+"
+BDEPEND="
+ virtual/python-cffi[${PYTHON_USEDEP}]
+"
+RDEPEND="
+ dev-python/idna[${PYTHON_USEDEP}]
+ ${DEPEND}
+ ${BDEPEND}
+"
+BDEPEND+="
+ test? (
+ dev-python/idna[${PYTHON_USEDEP}]
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-c-ares-1.18.patch
+)
+
+export PYCARES_USE_SYSTEM_LIB=1
+
+python_test() {
+ "${EPYTHON}" tests/tests.py -v || die
+}