net-dns/c-ares: Sync with Gentoo

It's from Gentoo commit 33e2e04cdb2faac45b5bbc99015f8d608404f16c.
This commit is contained in:
Flatcar Buildbot 2024-10-21 07:07:41 +00:00
parent 04fa20ab07
commit 8006d8434c
4 changed files with 223 additions and 1 deletions

View File

@ -14,3 +14,7 @@ DIST c-ares-1.33.0.tar.gz 1040626 BLAKE2B 730ca3ca9ebb03228fc17d87f1a659f77f91d2
DIST c-ares-1.33.0.tar.gz.asc 228 BLAKE2B 945ebedb47c998aa917aebc6180cc9f601bc4f10c648955cc9af84e09d5832e06cf7c7afa7ddc1591474f23758c7d269c722d4dce34e4680edc69ce93be483ad SHA512 bd6386a917d072ac41adb604affa314b8e05e8cfeff5ade7e9d6f520baf4d73d7adf68cff35f4748aeee45d4d646ca6d6cf438e75e1c7125f1ababd561809e8c
DIST c-ares-1.33.1.tar.gz 1044943 BLAKE2B d8084db84da252ced8cc91b4ed523a5309dbc788bf25f1ab46f3e4817b4c12a3d3d4565179287b7542ac8a7b4f812c20dcc44d9f7284153a9e43765ca7aaf996 SHA512 b5ec4f08539be552f01d49f03327e3999754b940d83c63fbd934c2ed34cf7f05c3f90c9eb64a78a3d7862280bf75765296576a70a6029257daaf90e3e35ab3e4
DIST c-ares-1.33.1.tar.gz.asc 228 BLAKE2B 4908cc70133d75f926387873b0bf7b274c8ab162391b73da2a9f25658bda52763f41ffb1aa4236cdc14efa7bcbbba32d3b0be8bd95161654901c304a4f14f6f8 SHA512 f9c8c8965046176104487939b04a38f3f6e68693ff1ef239ce988cf4c56dfacf2766482857d480a4022d6101c2591c013d8687d4bbf009e40863c1d7a95c2fad
DIST c-ares-1.34.1.tar.gz 1008224 BLAKE2B 7094cf3a3fba4df6367d56c1d251d1f682b37b1f094c66286951c8e2b2d519935b58a039aa926869de90bf0674fec2c6e127327820ae3f50b4d27fdf0c560947 SHA512 193a4b304dd81dcaf9854ae26662868187521eddd3514a7ba32b2f4f45dc158081bf5829b07e36436e2f16344120e83fe1b9369a11d701ad053824d0b03371bb
DIST c-ares-1.34.1.tar.gz.asc 228 BLAKE2B 9d5dd6858e5686420c73ed269d6c5d3376f6fefe09122f993800c93682633995eb90e30a244e435f209a8014c32279949cfd044aa755852408ffa1b869431df8 SHA512 a198cae7cd010f31034835ae0b35d828aeccd443e56d3d04d18eb0fd2bcfa71847d3c3da66d8d15700400bd9576a2ee73aee08f3af2ee77f6d2219b2ff45e565
DIST c-ares-1.34.2.tar.gz 1008432 BLAKE2B 4879de256a35e33bbe37cfc3e7af14a6998821a36efbac6b26f265b6f8d782ee22016b92e9285efc745f6a667336c8c1c0b51b380fe9fbee295f73f62331e579 SHA512 ddcda2f4c82ece7d670d0beb11485253a0f0db1f01131164e7253a20405c081844d2c69e366300c76ca0419a025e0fed516ee54314443afc39d55ce292354ad9
DIST c-ares-1.34.2.tar.gz.asc 228 BLAKE2B 6338c1726907e893ae63927eb2ba31211f31857640d4c9659bc9b8ef84278bc873f0b744f1c449452bd6283ebd945eafc87135830f3b603363a63274c8e3f11c SHA512 f37cca24c2fcb3310ebfa4996a86a59a5b714005e42bb0019f590c70f60f0e0ececab0bbbb0826b5bed7423b8c18c23fa6efc16ab03420b154163917bf4e43c4

View File

@ -18,7 +18,7 @@ SRC_URI="
LICENSE="MIT ISC"
# Subslot = SONAME of libcares.so.2
SLOT="0/2"
KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="static-libs test"
RESTRICT="!test? ( test )"

View File

@ -0,0 +1,109 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Both Daniel and Brad are listed as possible signers on the homepage
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradhouse.asc
inherit edo multilib-minimal verify-sig
DESCRIPTION="C library that resolves names asynchronously"
HOMEPAGE="https://c-ares.org/"
SRC_URI="
https://github.com/c-ares/c-ares/releases/download/v${PV}/${P}.tar.gz
verify-sig? ( https://github.com/c-ares/c-ares/releases/download/v${PV}/${P}.tar.gz.asc )
"
# ISC for lib/{bitncmp.c,inet_ntop.c,inet_net_pton.c} (bug #912405)
LICENSE="MIT ISC"
# Subslot = SONAME of libcares.so.2
SLOT="0/2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
BDEPEND="
test? ( dev-cpp/gtest )
verify-sig? ( sec-keys/openpgp-keys-bradhouse )
"
DOCS=( AUTHORS README.md RELEASE-NOTES.md )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/ares_build.h
)
A__QA_CONFIG_IMPL_DECL_SKIP=(
# Checking for obsolete headers
malloc
calloc
free
# Non-existent on Linux
closesocket
CloseSocket
ioctlsocket
bitncmp
ConvertInterfaceIndexToLuid
ConvertInterfaceLuidToNameA
)
src_prepare() {
default
if [[ ${CHOST} == *-darwin* ]] ; then
# warnings are default, but enable -std=c90 which doesn't define
# 'bool' which is a type used/assumed in macOS system headers
sed -i -e 's/-std=c90/& -Dbool=int/' configure{.ac,} || die
# sysconfig integration requires deep framework compatibility
# and is not really desired in Prefix
sed -i -e 's/__APPLE__/__DISABLED__/' \
src/lib/ares_sysconfig_mac.c || die
sed -i -e '/elif defined(__APPLE__)/s/__APPLE__/__DISABLED__/' \
src/lib/ares_sysconfig.c || die
fi
}
multilib_src_configure() {
local myeconfargs=(
--enable-symbol-hiding
$(use_enable static-libs static)
$(use_enable test tests)
)
# Needed for running unit tests only
# Violates sandbox and tests pass fine without
export ax_cv_uts_namespace=no
export ax_cv_user_namespace=no
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_test() {
cd "${BUILD_DIR}"/test || die
# We're skipping the "real" network tests with the filter
# see https://github.com/c-ares/c-ares/tree/main/test
local network_tests=(
# Most live tests have Live in the name
*Live*
# These don't but are still in ares-test-live.cc => live
*GetTCPSock*
*TimeoutValue*
*GetSock*
*GetSock_virtualized*
*VerifySocketFunctionCallback*
# Seems flaky, even run manually
# https://github.com/c-ares/c-ares/commit/9e542a8839f81c990bb0dff14beeaf9aa6bcc18d
*MockUDPMaxQueriesTest.GetHostByNameParallelLookups*
)
# The format for disabling test1, test2, and test3 looks like:
# -test1:test2:test3
edo ./arestest --gtest_filter=-$(echo $(IFS=:; echo "${network_tests[*]}"))
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name "*.la" -delete || die
}

View File

@ -0,0 +1,109 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
# Both Daniel and Brad are listed as possible signers on the homepage
VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/bradhouse.asc
inherit edo multilib-minimal verify-sig
DESCRIPTION="C library that resolves names asynchronously"
HOMEPAGE="https://c-ares.org/"
SRC_URI="
https://github.com/c-ares/c-ares/releases/download/v${PV}/${P}.tar.gz
verify-sig? ( https://github.com/c-ares/c-ares/releases/download/v${PV}/${P}.tar.gz.asc )
"
# ISC for lib/{bitncmp.c,inet_ntop.c,inet_net_pton.c} (bug #912405)
LICENSE="MIT ISC"
# Subslot = SONAME of libcares.so.2
SLOT="0/2"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="static-libs test"
RESTRICT="!test? ( test )"
BDEPEND="
test? ( dev-cpp/gtest )
verify-sig? ( sec-keys/openpgp-keys-bradhouse )
"
DOCS=( AUTHORS README.md RELEASE-NOTES.md )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/ares_build.h
)
A__QA_CONFIG_IMPL_DECL_SKIP=(
# Checking for obsolete headers
malloc
calloc
free
# Non-existent on Linux
closesocket
CloseSocket
ioctlsocket
bitncmp
ConvertInterfaceIndexToLuid
ConvertInterfaceLuidToNameA
)
src_prepare() {
default
if [[ ${CHOST} == *-darwin* ]] ; then
# warnings are default, but enable -std=c90 which doesn't define
# 'bool' which is a type used/assumed in macOS system headers
sed -i -e 's/-std=c90/& -Dbool=int/' configure{.ac,} || die
# sysconfig integration requires deep framework compatibility
# and is not really desired in Prefix
sed -i -e 's/__APPLE__/__DISABLED__/' \
src/lib/ares_sysconfig_mac.c || die
sed -i -e '/elif defined(__APPLE__)/s/__APPLE__/__DISABLED__/' \
src/lib/ares_sysconfig.c || die
fi
}
multilib_src_configure() {
local myeconfargs=(
--enable-symbol-hiding
$(use_enable static-libs static)
$(use_enable test tests)
)
# Needed for running unit tests only
# Violates sandbox and tests pass fine without
export ax_cv_uts_namespace=no
export ax_cv_user_namespace=no
ECONF_SOURCE="${S}" econf "${myeconfargs[@]}"
}
multilib_src_test() {
cd "${BUILD_DIR}"/test || die
# We're skipping the "real" network tests with the filter
# see https://github.com/c-ares/c-ares/tree/main/test
local network_tests=(
# Most live tests have Live in the name
*Live*
# These don't but are still in ares-test-live.cc => live
*GetTCPSock*
*TimeoutValue*
*GetSock*
*GetSock_virtualized*
*VerifySocketFunctionCallback*
# Seems flaky, even run manually
# https://github.com/c-ares/c-ares/commit/9e542a8839f81c990bb0dff14beeaf9aa6bcc18d
*MockUDPMaxQueriesTest.GetHostByNameParallelLookups*
)
# The format for disabling test1, test2, and test3 looks like:
# -test1:test2:test3
edo ./arestest --gtest_filter=-$(echo $(IFS=:; echo "${network_tests[*]}"))
}
multilib_src_install_all() {
einstalldocs
find "${ED}" -name "*.la" -delete || die
}