From nobody Sun Jan 29 18:50:30 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P4gP24jMLz3bmZk; Sun, 29 Jan 2023 18:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P4gP23wykz4dBV; Sun, 29 Jan 2023 18:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675018230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=okdgw/eRtp8PXzTw7xS2qwek6n9+yo6B5ue3mtJQZcY=; b=xbYz8sBRMh0sHQBEiGPw8zEWx0fB98GG+WjWM7F7im3wDTrMq5vFSZ2TZ+Gra6Ocjw14IE cFFHpzB/MYElFco+meB7aSjVFqRO23zDtKxBKsBWZbk/xN+JYlyVA3Aw72+05P6uXIZCjc O155sH3+8qbg4eN1Qua6ULQfa81dCNRC79MTFXftVvF7rhqhIvutWywuIFYK8PqcT8gyaA vYvuMd1fJZM7iR30amgmEkCv8Xti9/hF7++roW+wuyxPEtHjJ2oir+8mgodOAgOLhwV4YD KaUgfZ9I7MvNcKSzIOsnyqOD25ncy3xJgEQFcOfJls9eZJ6mrs9lCYQ13N6Cag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675018230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=okdgw/eRtp8PXzTw7xS2qwek6n9+yo6B5ue3mtJQZcY=; b=qG1ZSS6g/XqzcHW1d12QnHiY648AhkufLF/PSP4Y768vzbMVe9oU4JrcWIA1gz9KAMMm0p v1++Y4pZRDvUHJ1DkftK6TwNyCzh3ZWaqiS7CeYA/qIIqWuunWYO3CxMBE3UHmGxKHg+p3 XNavMTlXH9j9ctdBLlMwpOhgpB6J3D7bv6O0uBOFYWMDbge0VqJb1Gupi36ZD/xk5Zl6rr BFq7gFOJbcF9ZtStavRgAuQTjgOcwXuSRuVrsqnd4P26zYbrs8Ak8eEz2LhclNF1mn4jkv sSeRa7HX1l7DrF8wJzSDLg5a/J01llVRdAWzBLPrNbU4k9QpgUsFjGYcFDXaiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675018230; a=rsa-sha256; cv=none; b=CRVY/gWUY7AcDO5JNlUAlPV/moOKunkoGUdAJDugvRggM5xQMJa8yqKe/QdKYiL6mNuI61 FLykNnCH00Bhc+mQ96XrANhoFfYP8hA23AFdkDmo9b4JHW1+kKDH5CmEMT62KxV5PVRnfw VsKTom3nj+Or/yCfadvKZhC6ASL2hyatEDiSNaWIK4H3aJzznRhix/KkK0eIVr4/WjsCRG o64bCK5AcH+aUuJdHPQYIGXSMRdkCiplmXOAhJ4aQ87rrVKDIzbQNzBaj76xjbfg1g71hR eYEaI9YehZ2hziEmEA0PXt/bhzAattzaZEUXNEi3vD/IUCEHbX+QWuu/c7nupg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P4gP22xchzfXC; Sun, 29 Jan 2023 18:50:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30TIoUKf087702; Sun, 29 Jan 2023 18:50:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30TIoUXW087701; Sun, 29 Jan 2023 18:50:30 GMT (envelope-from git) Date: Sun, 29 Jan 2023 18:50:30 GMT Message-Id: <202301291850.30TIoUXW087701@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Daniel Engberg Subject: git: 4357da1d4e4d - main - dns/c-ares: Update to 1.19.0 and switch to CMake List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: diizzy X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4357da1d4e4deb422e7744e1dfd6927a196195c1 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by diizzy: URL: https://cgit.FreeBSD.org/ports/commit/?id=4357da1d4e4deb422e7744e1dfd6927a196195c1 commit 4357da1d4e4deb422e7744e1dfd6927a196195c1 Author: Daniel Engberg AuthorDate: 2023-01-29 18:47:33 +0000 Commit: Daniel Engberg CommitDate: 2023-01-29 18:49:36 +0000 dns/c-ares: Update to 1.19.0 and switch to CMake - Use GitHub as primary mirror for better connectivity and use main site as fallback - Switch to CMake to provide .cmake files, improve compilation performance and adhere framework options Additionally also aligns port with other distributions such as Alpine, Arch, Fedora, MacPorts and openSUSE - Drop CONFIG_INFO patch, this is no longer needed by UnrealIRCd - Enable "make test", only build test suite when requested, disable online tests and use Googletest from tree instead of bundled version Changelog: https://c-ares.org/changelog.html#1_19_0 PR: 268538 Reviewed by: zi (maintainer) --- dns/c-ares/Makefile | 37 ++++++--------- dns/c-ares/distinfo | 6 +-- dns/c-ares/files/ares-config-info.patch | 73 ------------------------------ dns/c-ares/files/patch-test_CMakeLists.txt | 34 ++++++++++++++ dns/c-ares/pkg-plist | 10 +++- 5 files changed, 59 insertions(+), 101 deletions(-) diff --git a/dns/c-ares/Makefile b/dns/c-ares/Makefile index a74b169139f0..179979ba5251 100644 --- a/dns/c-ares/Makefile +++ b/dns/c-ares/Makefile @@ -1,10 +1,8 @@ PORTNAME= c-ares -PORTVERSION= 1.18.1 -PORTREVISION= 1 +DISTVERSION= 1.19.0 CATEGORIES= dns -MASTER_SITES= https://c-ares.org/download/ \ - https://c-ares.haxx.se/download/ \ - ZI +MASTER_SITES= https://github.com/${PORTNAME}/${PORTNAME}/releases/download/cares-${DISTVERSION:S/./_/g}/ \ + https://c-ares.org/download/ MAINTAINER= zi@FreeBSD.org COMMENT= Asynchronous DNS resolver library @@ -13,29 +11,22 @@ WWW= https://c-ares.haxx.se/ LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE.md -GNU_CONFIGURE= yes -CONFIGURE_ARGS= --disable-werror -INSTALL_TARGET= install-strip -USES= libtool pathfix compiler:c++11-lang gmake +USES= cmake compiler:c++11-lang pathfix USE_LDCONFIG= yes -PROGRAMS= acountry adig ahost +CONFLICTS= py*-ripe.atlas.tools -OPTIONS_DEFINE= CONFIG_INFO DEBUG HIDE_SYMBOLS OPTIMIZED_CFLAGS -OPTIONS_DEFAULT= CONFIG_INFO HIDE_SYMBOLS +CMAKE_ARGS= -DCMAKE_INSTALL_MANDIR:PATH=${MANPREFIX}/man -CONFIG_INFO_DESC= Add the ares_config_info patch -HIDE_SYMBOLS_DESC= Hide internal library symbols -OPTIMIZED_CFLAGS_DESC= Build with compiler optimizations +OPTIONS_DEFINE= TEST -CONFLICTS= py*-ripe.atlas.tools +TEST_USES= localbase:ldflags +TEST_BUILD_DEPENDS= googletest>0:devel/googletest +TEST_TEST_TARGET= test +TEST_CMAKE_BOOL= CARES_BUILD_TESTS -CONFIG_INFO_EXTRA_PATCHES= ${FILESDIR}/ares-config-info.patch -DEBUG_CONFIGURE_ENABLE= debug -HIDE_SYMBOLS_CONFIGURE_ENABLE= symbol-hiding -OPTIMIZED_CFLAGS_CONFIGURE_ENABLE= optimize - -post-install: - ${INSTALL_PROGRAM} ${PROGRAMS:S@^@${WRKSRC}/src/tools/.libs/@} ${STAGEDIR}${PREFIX}/bin/ +post-patch: + @${REINPLACE_CMD} -e 's|ares-test-live.cc||g' \ + ${PATCH_WRKSRC}/test/Makefile.inc .include diff --git a/dns/c-ares/distinfo b/dns/c-ares/distinfo index 8032329c6126..44f7c46673ea 100644 --- a/dns/c-ares/distinfo +++ b/dns/c-ares/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1649437591 -SHA256 (c-ares-1.18.1.tar.gz) = 1a7d52a8a84a9fbffb1be9133c0f6e17217d91ea5a6fa61f6b4729cda78ebbcf -SIZE (c-ares-1.18.1.tar.gz) = 1560165 +TIMESTAMP = 1674949471 +SHA256 (c-ares-1.19.0.tar.gz) = bfceba37e23fd531293829002cac0401ef49a6dc55923f7f92236585b7ad1dd3 +SIZE (c-ares-1.19.0.tar.gz) = 1572210 diff --git a/dns/c-ares/files/ares-config-info.patch b/dns/c-ares/files/ares-config-info.patch deleted file mode 100644 index 9f0c3e4bca78..000000000000 --- a/dns/c-ares/files/ares-config-info.patch +++ /dev/null @@ -1,73 +0,0 @@ -Description: Add the ares_get_config() routine used by Unreal IRCd. - Originally taken from the Unreal IRCd distribution, later modified - by me to properly support IPv6 nameserver addresses since c-ares-1.7.1. -Origin: the Unreal IRCd distribution -Author: Peter Pentchev -Forwarded: no -Last-Update: 2010-12-19 - ---- include/ares.h.orig -+++ include/ares.h -@@ -260,6 +260,14 @@ - int nsort; - }; - -+/** Public available config (readonly) interface for ares_get_config(). */ -+struct ares_config_info { -+ int timeout; -+ int tries; -+ int numservers; -+ char **servers; -+}; -+ - struct hostent; - struct timeval; - struct sockaddr; -@@ -530,6 +538,8 @@ - CARES_EXTERN int ares_get_servers(ares_channel channel, - struct ares_addr_node **servers); - -+CARES_EXTERN int ares_get_config(struct ares_config_info *d, ares_channel c); -+ - #ifdef __cplusplus - } - #endif ---- src/lib/ares_init.c.orig 2013-02-17 11:44:02.000000000 -0500 -+++ src/lib/ares_init.c 2013-05-15 13:43:31.000000000 -0400 -@@ -1875,6 +1875,36 @@ - } - #endif /* !WIN32 & !WATT32 & !ANDROID & !__ANDROID__ */ - -+int ares_get_config(struct ares_config_info *d, ares_channel c) -+{ -+ int i; -+ const char *p; -+ char tmp[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; -+ -+ memset(d, 0, sizeof(struct ares_config_info)); -+ -+ d->timeout = c->timeout; -+ d->tries = c->tries; -+ d->numservers = c->nservers; -+ d->servers = calloc(sizeof(char *), c->nservers); -+ for (i = 0; i < c->nservers; i++) -+ { -+ if (c->servers[i].addr.family == AF_INET) -+ p = ares_inet_ntop(c->servers[i].addr.family, -+ (const char *)&c->servers[i].addr.addrV4, -+ tmp, sizeof(tmp)); -+ else if (c->servers[i].addr.family == AF_INET6) -+ p = ares_inet_ntop(c->servers[i].addr.family, -+ (const char *)&c->servers[i].addr.addrV6, -+ tmp, sizeof(tmp)); -+ else -+ p = NULL; -+ d->servers[i] = p ? strdup(p) : NULL; -+ } -+ -+ return ARES_SUCCESS; -+} -+ - /* initialize an rc4 key. If possible a cryptographically secure random key - is generated using a suitable function (for example win32's RtlGenRandom as - described in diff --git a/dns/c-ares/files/patch-test_CMakeLists.txt b/dns/c-ares/files/patch-test_CMakeLists.txt new file mode 100644 index 000000000000..cf03e2fdb77b --- /dev/null +++ b/dns/c-ares/files/patch-test_CMakeLists.txt @@ -0,0 +1,34 @@ +--- test/CMakeLists.txt.orig 2022-11-08 12:40:00 UTC ++++ test/CMakeLists.txt +@@ -25,14 +25,14 @@ ELSE () + ENDIF () + + # Google Test and Mock +-set(GMOCK_DIR gmock-1.11.0) +-add_library(gmock STATIC +- ${GMOCK_DIR}/gmock-gtest-all.cc +- ${GMOCK_DIR}/gmock/gmock.h +- ${GMOCK_DIR}/gtest/gtest.h +-) +-target_include_directories(gmock PUBLIC SYSTEM ${GMOCK_DIR}) +-target_link_libraries(gmock PRIVATE ${CMAKE_THREAD_LIBS_INIT}) ++# set(GMOCK_DIR gmock-1.11.0) ++# add_library(gmock STATIC ++# ${GMOCK_DIR}/gmock-gtest-all.cc ++# ${GMOCK_DIR}/gmock/gmock.h ++# ${GMOCK_DIR}/gtest/gtest.h ++# ) ++# target_include_directories(gmock PUBLIC SYSTEM ${GMOCK_DIR}) ++# target_link_libraries(gmock PRIVATE ${CMAKE_THREAD_LIBS_INIT}) + + # test targets + +@@ -43,7 +43,7 @@ configure_file(${CARES_TOPLEVEL_DIR}/src/lib/ares_conf + + add_executable(arestest ${TESTSOURCES} ${TESTHEADERS}) + target_include_directories(arestest PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) +-target_link_libraries(arestest PRIVATE caresinternal gmock) ++target_link_libraries(arestest PRIVATE caresinternal gtest gmock) + + IF (CARES_BUILD_CONTAINER_TESTS) + target_compile_definitions(arestest PRIVATE HAVE_USER_NAMESPACE HAVE_UTS_NAMESPACE) diff --git a/dns/c-ares/pkg-plist b/dns/c-ares/pkg-plist index 045da584c65c..830db5d990f3 100644 --- a/dns/c-ares/pkg-plist +++ b/dns/c-ares/pkg-plist @@ -7,11 +7,17 @@ include/ares_dns.h include/ares_nameser.h include/ares_rules.h include/ares_version.h -lib/libcares.a +lib/cmake/c-ares/c-ares-config-version.cmake +lib/cmake/c-ares/c-ares-config.cmake +lib/cmake/c-ares/c-ares-targets-%%CMAKE_BUILD_TYPE%%.cmake +lib/cmake/c-ares/c-ares-targets.cmake lib/libcares.so lib/libcares.so.2 -lib/libcares.so.2.5.1 +lib/libcares.so.2.6.0 libdata/pkgconfig/libcares.pc +man/man1/acountry.1.gz +man/man1/adig.1.gz +man/man1/ahost.1.gz man/man3/ares_cancel.3.gz man/man3/ares_create_query.3.gz man/man3/ares_destroy.3.gz