SUMMARY="Python interface for c-ares" 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="2012 Saúl Ibarra Corretgé" LICENSE="MIT" REVISION="1" SOURCE_URI="https://files.pythonhosted.org/packages/source/p/pycares/pycares-$portVersion.tar.gz" CHECKSUM_SHA256="9df70dce6e05afa5d477f48959170e569485e20dad1a089c4cf3b2d7ffbd8bf9" PATCHES="pycares-$portVersion.patchset" ARCHITECTURES="all !x86_gcc2" SECONDARY_ARCHITECTURES="x86" PROVIDES=" $portName = $portVersion " REQUIRES=" haiku$secondaryArchSuffix lib:libcares$secondaryArchSuffix " BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel devel:libcares$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:gcc$secondaryArchSuffix " PYTHON_VERSIONS=(3.10) for pythonVersion in ${PYTHON_VERSIONS[@]}; do pythonPackage=python${pythonVersion//.} eval "PROVIDES_${pythonPackage}=\" ${portName}_$pythonPackage = $portVersion \"" if [ "$targetArchitecture" = x86_gcc2 ]; then eval "PROVIDES_${pythonPackage}+=\" pycares_$pythonPackage = $portVersion \"" fi eval "REQUIRES_$pythonPackage=\" haiku$secondaryArchSuffix cffi_$pythonPackage cmd:python$pythonVersion \"" BUILD_REQUIRES+=" build_$pythonPackage cffi_$pythonPackage installer_$pythonPackage setuptools_$pythonPackage wheel_$pythonPackage " BUILD_PREREQUIRES+=" cmd:python$pythonVersion " 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 pythonVersion in ${PYTHON_VERSIONS[@]}; do pythonPackage=python${pythonVersion//.} python=python$pythonVersion $python -m installer --p $prefix dist/*-cp${pythonVersion//.}-*.whl packageEntries $pythonPackage \ $prefix/lib/python* done }