pycares: update to version 4.10.0.

This commit is contained in:
Oscar Lesta
2025-08-27 01:30:47 -03:00
committed by OscarL
parent a25764e54f
commit a63a406970
3 changed files with 85 additions and 33 deletions

View File

@@ -1,23 +0,0 @@
From 453186ac548dd30c1749e26093c61246617d5e8c Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 11 Jul 2018 14:02:51 +0200
Subject: Add Haiku support.
Just pretend we are NetBSD.
diff --git a/setup_cares.py b/setup_cares.py
index 97c4cc6..5044766 100644
--- a/setup_cares.py
+++ b/setup_cares.py
@@ -78,6 +78,8 @@ class cares_build_ext(build_ext):
elif sys.platform.startswith('freebsd'):
self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_freebsd'))
self.compiler.add_library('kvm')
+ elif sys.platform.startswith('haiku'):
+ self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_netbsd'))
elif sys.platform.startswith('dragonfly'):
self.compiler.add_include_dir(os.path.join(self.cares_dir, 'src/config_freebsd'))
elif sys.platform.startswith('netbsd'):
--
2.16.4

View File

@@ -0,0 +1,61 @@
From e80b5c81b7464dacd9c584bfcd9039640955b4d0 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 11 Jul 2018 14:02:51 +0200
Subject: Add Haiku support.
Just pretend we are NetBSD.
diff --git a/setup_cares.py b/setup_cares.py
index 640c863..ea51b65 100644
--- a/setup_cares.py
+++ b/setup_cares.py
@@ -139,6 +139,8 @@ class cares_build_ext(build_ext):
self.add_include_dir(os.path.join(self.build_config_dir, 'config_freebsd'))
elif sys.platform.startswith('netbsd'):
self.add_include_dir(os.path.join(self.build_config_dir, 'config_netbsd'))
+ elif sys.platform.startswith('haiku'):
+ self.add_include_dir(os.path.join(self.build_config_dir, 'config_netbsd'))
elif sys.platform.startswith('openbsd'):
self.add_include_dir(os.path.join(self.build_config_dir, 'config_openbsd'))
elif sys.platform.startswith('sunos'):
--
2.50.1
From c2d3b9c4bae2fbdad3b01291482d5c97ae069565 Mon Sep 17 00:00:00 2001
From: Oscar Lesta <oscar.lesta@gmail.com>
Date: Wed, 27 Aug 2025 01:41:47 -0300
Subject: Haiku doesn't defines EV_ENABLE.
diff --git a/deps/c-ares/src/lib/event/ares_event_kqueue.c b/deps/c-ares/src/lib/event/ares_event_kqueue.c
index 00cdcbe..84af05b 100644
--- a/deps/c-ares/src/lib/event/ares_event_kqueue.c
+++ b/deps/c-ares/src/lib/event/ares_event_kqueue.c
@@ -148,7 +148,11 @@ static void ares_evsys_kqueue_event_process(ares_event_t *event,
}
if (new_flags & ARES_EVENT_FLAG_READ && !(old_flags & ARES_EVENT_FLAG_READ)) {
+#ifdef EV_ENABLE
ares_evsys_kqueue_enqueue(kq, event->fd, EVFILT_READ, EV_ADD | EV_ENABLE);
+#else
+ ares_evsys_kqueue_enqueue(kq, event->fd, EVFILT_READ, EV_ADD);
+#endif
}
if (!(new_flags & ARES_EVENT_FLAG_READ) && old_flags & ARES_EVENT_FLAG_READ) {
@@ -157,7 +161,11 @@ static void ares_evsys_kqueue_event_process(ares_event_t *event,
if (new_flags & ARES_EVENT_FLAG_WRITE &&
!(old_flags & ARES_EVENT_FLAG_WRITE)) {
+#ifdef EV_ENABLE
ares_evsys_kqueue_enqueue(kq, event->fd, EVFILT_WRITE, EV_ADD | EV_ENABLE);
+#else
+ ares_evsys_kqueue_enqueue(kq, event->fd, EVFILT_WRITE, EV_ADD);
+#endif
}
if (!(new_flags & ARES_EVENT_FLAG_WRITE) &&
--
2.50.1

View File

@@ -3,11 +3,11 @@ DESCRIPTION="pycares is a Python module which provides an interface to c-ares. \
c-ares is a C library that performs DNS requests and name resolutions \
asynchronously."
HOMEPAGE="https://pypi.python.org/pypi/pycares"
COPYRIGHT="2017 Saúl Ibarra Corretgé"
COPYRIGHT="2012 Saúl Ibarra Corretgé"
LICENSE="MIT"
REVISION="4"
SOURCE_URI="https://pypi.io/packages/source/p/pycares/pycares-$portVersion.tar.gz"
CHECKSUM_SHA256="18dfd4fd300f570d6c4536c1d987b7b7673b2a9d14346592c5d6ed716df0d104"
REVISION="1"
SOURCE_URI="https://files.pythonhosted.org/packages/source/${portName:0:1}/$portName/$portName-$portVersion.tar.gz"
CHECKSUM_SHA256="9df70dce6e05afa5d477f48959170e569485e20dad1a089c4cf3b2d7ffbd8bf9"
PATCHES="pycares-$portVersion.patchset"
ARCHITECTURES="all !x86_gcc2"
@@ -32,8 +32,7 @@ BUILD_PREREQUIRES="
PYTHON_VERSIONS=(3.10)
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
eval "PROVIDES_${pythonPackage}=\"
@@ -63,16 +62,31 @@ for i in "${!PYTHON_VERSIONS[@]}"; do
"
done
PATCH()
{
# the .patchset makes Haiku use the same config as NetBSD, but we don't have
# getservbyport_r(), this gets rid of that warning.
sed -i -e "s,#define HAVE_GETSERVBYPORT_R 1,/* #undef HAVE_GETSERVBYPORT_R */," \
deps/build-config/config_netbsd/ares_config.h
}
BUILD()
{
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
python=python$pythonVersion
$python -m build --wheel --skip-dependency-check --no-isolation
done
}
INSTALL()
{
for i in "${!PYTHON_VERSIONS[@]}"; do
pythonVersion=${PYTHON_VERSIONS[$i]}
for pythonVersion in ${PYTHON_VERSIONS[@]}; do
pythonPackage=python${pythonVersion//.}
python=python$pythonVersion
$python -m build --wheel --skip-dependency-check --no-isolation
$python -m installer --p $prefix dist/*-$portVersion-cp${pythonVersion//.}-*.whl
$python -m installer --p $prefix dist/*-cp${pythonVersion//.}-*.whl
packageEntries $pythonPackage \
$prefix/lib/python*