tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[PATCH] wireshark: fix detection of libssh >= 0.95
libssh 0.95 moved its version macros from libssh.h to libssh_version.h.
wireshark's FindLIBSSH cmake module tries to parse the version from
libssh.h which now fails, so libssh is not detected.
This causes sshdump and ciscodump to not be built, resulting in
missing files compared to PLIST.
To fix this, apply upstream commit fd7739de6b [0] to search in
libssh_version.h as well.
[0] https://github.com/wireshark/wireshark/commit/fd7739de6bc679036c02c7aabbc3f71783751e3d
---
net/wireshark/distinfo | 1 +
.../patch-cmake_modules_FindLIBSSH.cmake | 31 +++++++++++++++++++
2 files changed, 32 insertions(+)
create mode 100644 net/wireshark/patches/patch-cmake_modules_FindLIBSSH.cmake
diff --git a/net/wireshark/distinfo b/net/wireshark/distinfo
index 09c81db3272..b4b6596ce19 100644
--- a/net/wireshark/distinfo
+++ b/net/wireshark/distinfo
@@ -5,3 +5,4 @@ RMD160 (wireshark-3.2.6.tar.xz) = 09dcd3a088aa339e18871b053c9c8d8414b25a6a
SHA512 (wireshark-3.2.6.tar.xz) = 71905836370b916a92e7a76e4f93cb10a658374c7a95aa47b607b2b142abebdb0d1562f642782a5a946a167dfb28169572330a7603cf0d7ab6016ce7f12fac78
Size (wireshark-3.2.6.tar.xz) = 31635628 bytes
SHA1 (patch-CMakeLists.txt) = 399adad3434a00d6eaf6e36afe8e96ddb0812d68
+SHA1 (patch-cmake_modules_FindLIBSSH.cmake) = fc8d508bd21290b1705a219056f9b2338ec15116
diff --git a/net/wireshark/patches/patch-cmake_modules_FindLIBSSH.cmake b/net/wireshark/patches/patch-cmake_modules_FindLIBSSH.cmake
new file mode 100644
index 00000000000..65add2f76d4
--- /dev/null
+++ b/net/wireshark/patches/patch-cmake_modules_FindLIBSSH.cmake
@@ -0,0 +1,31 @@
+$NetBSD$
+
+Fix detection of libssh >= 0.9.5. Upstream commit fd7739de6b.
+
+--- cmake/modules/FindLIBSSH.cmake.orig Wed Aug 12 17:53:19 2020
++++ cmake/modules/FindLIBSSH.cmake
+@@ -59,15 +59,21 @@ else ()
+ ${LIBSSH_LIBRARY}
+ )
+
+- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MAJOR
++ # libssh >= 0.9.5 has libssh_version.h
++ set(_libssh_version_header "${LIBSSH_INCLUDE_DIR}/libssh/libssh_version.h")
++ if(NOT EXISTS "${_libssh_version_header}")
++ set(_libssh_version_header "${LIBSSH_INCLUDE_DIR}/libssh/libssh.h")
++ endif()
++
++ file(STRINGS "${_libssh_version_header}" LIBSSH_VERSION_MAJOR
+ REGEX "#define[ ]+LIBSSH_VERSION_MAJOR[ ]+[0-9]+")
+ # Older versions of libssh like libssh-0.2 have LIBSSH_VERSION but not LIBSSH_VERSION_MAJOR
+ if(LIBSSH_VERSION_MAJOR)
+ string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MAJOR ${LIBSSH_VERSION_MAJOR})
+- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_MINOR
++ file(STRINGS "${_libssh_version_header}" LIBSSH_VERSION_MINOR
+ REGEX "#define[ ]+LIBSSH_VERSION_MINOR[ ]+[0-9]+")
+ string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_MINOR ${LIBSSH_VERSION_MINOR})
+- file(STRINGS ${LIBSSH_INCLUDE_DIR}/libssh/libssh.h LIBSSH_VERSION_PATCH
++ file(STRINGS "${_libssh_version_header}" LIBSSH_VERSION_PATCH
+ REGEX "#define[ ]+LIBSSH_VERSION_MICRO[ ]+[0-9]+")
+ string(REGEX MATCH "[0-9]+" LIBSSH_VERSION_PATCH ${LIBSSH_VERSION_PATCH})
+ set(LIBSSH_VERSION ${LIBSSH_VERSION_MAJOR}.${LIBSSH_VERSION_MINOR}.${LIBSSH_VERSION_PATCH})
--
2.28.0
Home |
Main Index |
Thread Index |
Old Index