[packages/osquery] cpp-netlib shared patch hack

glen glen at pld-linux.org
Mon Aug 3 12:39:04 CEST 2015


commit 97c1a13eeab92c42bf753d8ea38c2fdc93648b89
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Aug 3 13:38:47 2015 +0300

    cpp-netlib shared patch hack

 cpp-netlib-shared.patch | 32 ++++++++++++++++++++++++++++++++
 osquery.spec            |  5 +++++
 2 files changed, 37 insertions(+)
---
diff --git a/osquery.spec b/osquery.spec
index f0c573a..75f5fe5 100644
--- a/osquery.spec
+++ b/osquery.spec
@@ -1,6 +1,8 @@
 # NOTE:
 # - cpp-netlib is patched with cihper/options: https://github.com/osquery/third-party/commit/8b39e224380a2f9492f00727268bff8e9cda3106
 #   upstreamed, but not yet released: https://github.com/cpp-netlib/cpp-netlib/pull/530
+# TODO:
+# - massive linking failure
 #
 # Conditional build:
 %bcond_with	system_cppnetlib		# use system cpp-netlib
@@ -18,6 +20,7 @@ Source1:	https://github.com/osquery/third-party/archive/%{version}/%{name}-third
 Patch1:		gcc-flags.patch
 Patch2:		system-glog.patch
 Patch3:		system-cpp-netlib.patch
+Patch4:		cpp-netlib-shared.patch
 URL:		https://osquery.io/
 BuildRequires:	bison
 BuildRequires:	boost-devel >= 1.55.0
@@ -72,6 +75,7 @@ network connections, browser plugins, hardware events or file hashes.
 %patch1 -p1
 %patch2 -p1
 %{?with_system_cppnetlib:%patch3 -p1}
+%patch4 -p1
 
 mv third-party-*/* third-party
 
@@ -85,6 +89,7 @@ BUILD_LINK_SHARED=True \
 SDK_VERSION=%{version} \
 SKIP_TESTS=True \
 %cmake \
+	-DBUILD_LINK_SHARED=ON \
 	..
 %{__make} \
 	CTEST_OUTPUT_ON_FAILURE=1
diff --git a/cpp-netlib-shared.patch b/cpp-netlib-shared.patch
new file mode 100644
index 0000000..9bd364e
--- /dev/null
+++ b/cpp-netlib-shared.patch
@@ -0,0 +1,32 @@
+respect ENV{BUILD_LINK_SHARED}
+
+as if osquery is built with BUILD_LINK_SHARED enabled, cpp-netlib is also built with shared libs
+
+actually, on my systems, i have aways libcppnetlib-uri.so, not libcppnetlib-uri.a
+
+--- osquery-1.5.1/CMake/FindCppNetlib.cmake~	2015-08-01 23:21:57.000000000 +0300
++++ osquery-1.5.1/CMake/FindCppNetlib.cmake	2015-08-01 23:34:16.380500052 +0300
+@@ -10,10 +10,17 @@
+ add_subdirectory("${CPP-NETLIB_SOURCE_DIR}")
+ 
+ set(CPP-NETLIB_LINK_DIR "${CPP-NETLIB_BUILD_DIR}/libs/network/src")
+-set(CPP-NETLIB_LIBRARY
+-  "${CPP-NETLIB_LINK_DIR}/libcppnetlib-uri.a"
+-  "${CPP-NETLIB_LINK_DIR}/libcppnetlib-client-connections.a"
+-)
+ 
+-LOG_LIBRARY(cpp-netlib "${CPP-NETLIB_LINK_DIR}/libcppnetlib-uri.a")
+-LOG_LIBRARY(cpp-netlib "${CPP-NETLIB_LINK_DIR}/libcppnetlib-client-connections.a")
++if (FALSE) # if(NOT DEFINED ENV{BUILD_LINK_SHARED})
++  set(CPP-NETLIB_LIBRARY
++    "${CPP-NETLIB_LINK_DIR}/libcppnetlib-uri.a"
++    "${CPP-NETLIB_LINK_DIR}/libcppnetlib-client-connections.a"
++  )
++else()
++  set(CPP-NETLIB_LIBRARY
++    "${CPP-NETLIB_LINK_DIR}/libcppnetlib-uri.so"
++    "${CPP-NETLIB_LINK_DIR}/libcppnetlib-client-connections.so"
++  )
++endif()
++
++LOG_LIBRARY(cpp-netlib "${CPP-NETLIB_LIBRARY}")
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/osquery.git/commitdiff/97c1a13eeab92c42bf753d8ea38c2fdc93648b89



More information about the pld-cvs-commit mailing list