package/wireshark: fix static build with libxml2 and lzma
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Wed, 24 Apr 2019 19:47:41 +0000 (21:47 +0200)
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Sun, 26 May 2019 18:51:10 +0000 (20:51 +0200)
Fixes:
 - http://autobuild.buildroot.org/results/533c75836ba6281000b89a648fc653b9ff4685ee

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
package/wireshark/0004-FindXml2-use-pkg-config-to-find-libxml2-dependencies.patch [new file with mode: 0644]

diff --git a/package/wireshark/0004-FindXml2-use-pkg-config-to-find-libxml2-dependencies.patch b/package/wireshark/0004-FindXml2-use-pkg-config-to-find-libxml2-dependencies.patch
new file mode 100644 (file)
index 0000000..ab54902
--- /dev/null
@@ -0,0 +1,33 @@
+From e6a2e71831f0699e9759e0579a00eea5fcb93696 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 24 Apr 2019 20:23:00 +0200
+Subject: [PATCH] FindXml2: use pkg-config to find libxml2 dependencies
+
+On UNIX, when statically built, libxml2 can depends on other libraries such
+as lzma. These dependencies are already retrieved through pkg-config so
+append them to LIBXML2_LIBRARIES otherwise static build will fail
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not sent yet]
+---
+ cmake/modules/FindLibXml2.cmake | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/cmake/modules/FindLibXml2.cmake b/cmake/modules/FindLibXml2.cmake
+index 99d70af57d..2a4b1f470f 100644
+--- a/cmake/modules/FindLibXml2.cmake
++++ b/cmake/modules/FindLibXml2.cmake
+@@ -98,6 +98,10 @@ endif()
+ set(LIBXML2_INCLUDE_DIRS ${LIBXML2_INCLUDE_DIR} ${PC_LIBXML_INCLUDE_DIRS})
+ set(LIBXML2_LIBRARIES ${LIBXML2_LIBRARY})
++# Include transitive dependencies for static linking.
++if(UNIX)
++    list(APPEND LIBXML2_LIBRARIES ${PC_LIBXML_LIBRARIES})
++endif()
+ include(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXml2
+-- 
+2.20.1
+