Skip to content

Commit

Permalink
c-ares: Fix pkgconfig file
Browse files Browse the repository at this point in the history
* Add proper path relocation in pkgconfig file.
* Fix output of static flags. Previously those flags were only added in
  pkgconfig file from static build.
  • Loading branch information
Biswa96 committed Oct 9, 2023
1 parent 76cdb3c commit f428bf1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 55 deletions.
51 changes: 0 additions & 51 deletions mingw-w64-c-ares/0002-Add-static-pkg-config.patch

This file was deleted.

39 changes: 39 additions & 0 deletions mingw-w64-c-ares/0002-cares-pkgconfig-fix-paths-and-flags.patch
Original file line number Diff line number Diff line change
@@ -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@
8 changes: 4 additions & 4 deletions mingw-w64-c-ares/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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 #
Expand All @@ -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
}

Expand Down

0 comments on commit f428bf1

Please sign in to comment.