diff options
author | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-10-13 08:28:17 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2024-10-13 08:28:17 +0700 |
commit | a540a67d99e0466e9cda30582300dc642e0b17ba (patch) | |
tree | 85dd088b6d83b389a1d3e6da843e639e68af82e6 /network | |
parent | 4949c8bcc899259c58565c4a88068b14686cb569 (diff) | |
download | slackbuilds-a540a67d99e0466e9cda30582300dc642e0b17ba.tar.gz slackbuilds-a540a67d99e0466e9cda30582300dc642e0b17ba.tar.xz |
network/wireshark: Fix build on current.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to '')
-rw-r--r-- | network/wireshark/0e120834b0883c9940d31f210a51613f723ad422.patch | 50 | ||||
-rw-r--r-- | network/wireshark/wireshark.SlackBuild | 3 |
2 files changed, 53 insertions, 0 deletions
diff --git a/network/wireshark/0e120834b0883c9940d31f210a51613f723ad422.patch b/network/wireshark/0e120834b0883c9940d31f210a51613f723ad422.patch new file mode 100644 index 0000000000..314fc59c4e --- /dev/null +++ b/network/wireshark/0e120834b0883c9940d31f210a51613f723ad422.patch @@ -0,0 +1,50 @@ +From 0e120834b0883c9940d31f210a51613f723ad422 Mon Sep 17 00:00:00 2001 +From: John Thacker <johnthacker@gmail.com> +Date: Thu, 10 Oct 2024 23:15:18 +0000 +Subject: [PATCH] CMake: Fix our c-ares version discovery + +c-ares 1.34.0 and later generate ARES_VERSION_STR using a macro, so +fetch the version from ARES_VERSION_MAJOR, ARES_VERSION_MINOR, and +ARES_VERSION_PATCH. + +Fixes #20125 + + +(cherry picked from commit 7c1418625d2ba5095ef5393abdb2141c990a662c) + +Co-authored-by: Gerald Combs <gerald@wireshark.org> +--- + cmake/modules/FindCARES.cmake | 19 +++++++++++++++---- + 1 file changed, 15 insertions(+), 4 deletions(-) + +diff --git a/cmake/modules/FindCARES.cmake b/cmake/modules/FindCARES.cmake +index f69a2a906bf..5d005b50d4e 100644 +--- a/cmake/modules/FindCARES.cmake ++++ b/cmake/modules/FindCARES.cmake +@@ -36,11 +36,22 @@ find_library( CARES_LIBRARY + ) + + # Try to retrieve version from header if found ++# Adapted from https://stackoverflow.com/a/47084079/82195 + if(CARES_INCLUDE_DIR) +- set(_version_regex "^#define[ \t]+ARES_VERSION_STR[ \t]+\"([^\"]+)\".*") +- file(STRINGS "${CARES_INCLUDE_DIR}/ares_version.h" CARES_VERSION REGEX "${_version_regex}") +- string(REGEX REPLACE "${_version_regex}" "\\1" CARES_VERSION "${CARES_VERSION}") +- unset(_version_regex) ++ file(READ "${CARES_INCLUDE_DIR}/ares_version.h" _ares_version_h) ++ ++ string(REGEX MATCH "#[\t ]*define[ \t]+ARES_VERSION_MAJOR[ \t]+([0-9]+)" _ ${_ares_version_h}) ++ set(_ares_version_major ${CMAKE_MATCH_1}) ++ string(REGEX MATCH "#[\t ]*define[ \t]+ARES_VERSION_MINOR[ \t]+([0-9]+)" _ ${_ares_version_h}) ++ set(_ares_version_minor ${CMAKE_MATCH_1}) ++ string(REGEX MATCH "#[\t ]*define[ \t]+ARES_VERSION_PATCH[ \t]+([0-9]+)" _ ${_ares_version_h}) ++ set(_ares_version_patch ${CMAKE_MATCH_1}) ++ set(CARES_VERSION ${_ares_version_major}.${_ares_version_minor}.${_ares_version_patch}) ++ ++ unset(_ares_version_h) ++ unset(_ares_version_major) ++ unset(_ares_version_minor) ++ unset(_ares_version_patch) + endif() + + # handle the QUIETLY and REQUIRED arguments and set CARES_FOUND to TRUE if diff --git a/network/wireshark/wireshark.SlackBuild b/network/wireshark/wireshark.SlackBuild index 0f7b1d4474..e8d983f8a9 100644 --- a/network/wireshark/wireshark.SlackBuild +++ b/network/wireshark/wireshark.SlackBuild @@ -80,6 +80,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# patch c-ares detection in current +patch -p1 < $CWD/0e120834b0883c9940d31f210a51613f723ad422.patch + mkdir -p build cd build cmake \ |