From f428bf1240c3f00f146d430d73703cb13d95409f Mon Sep 17 00:00:00 2001 From: Biswapriyo Nath Date: Mon, 9 Oct 2023 07:53:56 +0000 Subject: [PATCH] c-ares: Fix pkgconfig file * Add proper path relocation in pkgconfig file. * Fix output of static flags. Previously those flags were only added in pkgconfig file from static build. --- .../0002-Add-static-pkg-config.patch | 51 ------------------- ...-cares-pkgconfig-fix-paths-and-flags.patch | 39 ++++++++++++++ mingw-w64-c-ares/PKGBUILD | 8 +-- 3 files changed, 43 insertions(+), 55 deletions(-) delete mode 100644 mingw-w64-c-ares/0002-Add-static-pkg-config.patch create mode 100644 mingw-w64-c-ares/0002-cares-pkgconfig-fix-paths-and-flags.patch diff --git a/mingw-w64-c-ares/0002-Add-static-pkg-config.patch b/mingw-w64-c-ares/0002-Add-static-pkg-config.patch deleted file mode 100644 index 52353dbdc461d..0000000000000 --- a/mingw-w64-c-ares/0002-Add-static-pkg-config.patch +++ /dev/null @@ -1,51 +0,0 @@ - Makefile.am | 4 ++-- - configure.ac | 2 +- - libcares-static.pc.cmake | 11 +++++++++++ - libcares.pc.cmake | 2 +- - 4 files changed, 15 insertions(+), 4 deletions(-) - -diff --git a/libcares-static.pc.cmake b/libcares-static.pc.cmake -new file mode 100644 -index 0000000..4612712 ---- /dev/null -+++ b/libcares-static.pc.cmake -@@ -0,0 +1,11 @@ -+#*************************************************************************** -+# Project ___ __ _ _ __ ___ ___ -+# / __|____ / _` | '__/ _ \/ __| -+# | (_|_____| (_| | | | __/\__ \ -+# \___| \__,_|_| \___||___/ -+# -+Name: c-ares-static -+URL: http://daniel.haxx.se/projects/c-ares/ -+Description: asynchronous DNS lookup library -+Version: @CARES_VERSION@ -+Cflags: -DCARES_STATICLIB -diff --git a/libcares.pc.cmake b/libcares.pc.cmake -index e757c1b..99fdbba 100644 ---- a/libcares.pc.cmake -+++ b/libcares.pc.cmake -@@ -14,7 +14,7 @@ URL: http://daniel.haxx.se/projects/c-ares/ - Description: asynchronous DNS lookup library - Version: @CARES_VERSION@ - Requires: --Requires.private: --Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ -+Requires.private: libcares-static -+Cflags: -I${includedir} - Libs: -L${libdir} -lcares - Libs.private: @CARES_PRIVATE_LIBS@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e757c1b..99fdbba 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -621,7 +621,9 @@ - ENDFOREACH () - ENDIF () - CONFIGURE_FILE("libcares.pc.cmake" "libcares.pc" @ONLY) -+ CONFIGURE_FILE("libcares-static.pc.cmake" "libcares-static.pc" @ONLY) - INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") -+ INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares-static.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") - ENDIF () - - diff --git a/mingw-w64-c-ares/0002-cares-pkgconfig-fix-paths-and-flags.patch b/mingw-w64-c-ares/0002-cares-pkgconfig-fix-paths-and-flags.patch new file mode 100644 index 0000000000000..50065b5f75ae7 --- /dev/null +++ b/mingw-w64-c-ares/0002-cares-pkgconfig-fix-paths-and-flags.patch @@ -0,0 +1,39 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -655,12 +655,10 @@ + INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" COMPONENT Devel DESTINATION ${CMAKECONFIG_INSTALL_DIR}) + + # pkgconfig support +- IF (NOT CARES_SHARED) + SET (CPPFLAG_CARES_STATICLIB "-DCARES_STATICLIB") + FOREACH (LIB ${CARES_DEPENDENT_LIBS}) + SET (CARES_PRIVATE_LIBS "${CARES_PRIVATE_LIBS} -l${LIB}") + ENDFOREACH () +- ENDIF () + CONFIGURE_FILE("libcares.pc.cmake" "libcares.pc" @ONLY) + INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/libcares.pc" COMPONENT Devel DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + ENDIF () +--- a/libcares.pc.cmake ++++ b/libcares.pc.cmake +@@ -7,9 +7,9 @@ + # Copyright (C) The c-ares project and its contributors + # SPDX-License-Identifier: MIT + prefix=@CMAKE_INSTALL_PREFIX@ +-exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@ +-libdir=@CMAKE_INSTALL_FULL_LIBDIR@ +-includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ ++exec_prefix=${prefix} ++libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@ ++includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@ + + Name: c-ares + URL: https://c-ares.org/ +@@ -17,6 +17,7 @@ + Version: @CARES_VERSION@ + Requires: + Requires.private: +-Cflags: -I${includedir} @CPPFLAG_CARES_STATICLIB@ ++Cflags: -I${includedir} ++Cflags.private: @CPPFLAG_CARES_STATICLIB@ + Libs: -L${libdir} -lcares + Libs.private: @CARES_PRIVATE_LIBS@ diff --git a/mingw-w64-c-ares/PKGBUILD b/mingw-w64-c-ares/PKGBUILD index dfffc9caf4bfc..04ed924b87a04 100644 --- a/mingw-w64-c-ares/PKGBUILD +++ b/mingw-w64-c-ares/PKGBUILD @@ -16,13 +16,13 @@ makedepends=("${MINGW_PACKAGE_PREFIX}-cc" "${MINGW_PACKAGE_PREFIX}-ninja") source=(#"https://c-ares.org/download/${_realname}-${pkgver}.tar.gz"{,.asc} "https://github.com/${_realname}/${_realname}/releases/download/${_realname//-}-${pkgver//./_}/${_realname}-${pkgver}.tar.gz"{,.asc} - 0002-Add-static-pkg-config.patch + 0002-cares-pkgconfig-fix-paths-and-flags.patch 0003-fix-cmake-targets.patch) validpgpkeys=('914C533DF9B2ADA2204F586D78E11C6B279D5C91' '27EDEAF22F3ABCEB50DB9A125CC908FDB71E12C2') sha256sums=('cde8433e9bf6c6a0d9e7e69947745ee649256d76009d6c23b9555f84c5c13988' 'SKIP' - '787ce206f7956ecde7a5b61ae49701d6396d9869e05e5db335801f38b2af2ad9' + '7ae54fbb701885a78bf3cb4a1a81f1a1ff4cf125991e26fd7a85a05a74396fab' 'a263f019a158fad0b36a81481ae1b4f02d686afbf8da09a22522f5cd99162c0f') # Helper macros to help make tasks easier # @@ -46,9 +46,9 @@ del_file_exists() { prepare() { cd "${_realname}-${pkgver}" - del_file_exists libcares-static.pc.cmake + apply_patch_with_msg \ - 0002-Add-static-pkg-config.patch \ + 0002-cares-pkgconfig-fix-paths-and-flags.patch \ 0003-fix-cmake-targets.patch }