From 1b99c84297ba8c1079a4805c9a1dd3b41d4f4593 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:02:15 +0300 Subject: [PATCH 01/17] add recipe stub --- recipes/libtins/all/CMakeLists.txt | 7 ++ recipes/libtins/all/conandata.yml | 4 + recipes/libtins/all/conanfile.py | 84 +++++++++++++++++++ .../libtins/all/test_package/CMakeLists.txt | 8 ++ recipes/libtins/all/test_package/conanfile.py | 16 ++++ .../libtins/all/test_package/test_package.cpp | 12 +++ recipes/libtins/config.yml | 3 + 7 files changed, 134 insertions(+) create mode 100644 recipes/libtins/all/CMakeLists.txt create mode 100644 recipes/libtins/all/conandata.yml create mode 100644 recipes/libtins/all/conanfile.py create mode 100644 recipes/libtins/all/test_package/CMakeLists.txt create mode 100644 recipes/libtins/all/test_package/conanfile.py create mode 100644 recipes/libtins/all/test_package/test_package.cpp create mode 100644 recipes/libtins/config.yml diff --git a/recipes/libtins/all/CMakeLists.txt b/recipes/libtins/all/CMakeLists.txt new file mode 100644 index 0000000000000..c986d294c7547 --- /dev/null +++ b/recipes/libtins/all/CMakeLists.txt @@ -0,0 +1,7 @@ +cmake_minimum_required(VERSION 3.1) +project(cmake_wrapper) + +include(conanbuildinfo.cmake) +conan_basic_setup() + +add_subdirectory("source_subfolder") diff --git a/recipes/libtins/all/conandata.yml b/recipes/libtins/all/conandata.yml new file mode 100644 index 0000000000000..68d28f09ec5db --- /dev/null +++ b/recipes/libtins/all/conandata.yml @@ -0,0 +1,4 @@ +sources: + "4.2": + sha256: a9fed73e13f06b06a4857d342bb30815fa8c359d00bd69547e567eecbbb4c3a1 + url: https://github.com/mfontanini/libtins/archive/v4.2.tar.gz diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py new file mode 100644 index 0000000000000..c434206e74ef9 --- /dev/null +++ b/recipes/libtins/all/conanfile.py @@ -0,0 +1,84 @@ +from conans import tools, CMake, ConanFile +import os + + +class LibTinsConan(ConanFile): + name = "libtins" + url = "https://github.com/conan-io/conan-center-index" + homepage = "https://github.com/mfontanini/libtins" + description = "High-level, multiplatform C++ network packet sniffing and crafting library." + license = "BSD-2-Clause" + topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") + exports_sources = ["CMakeLists.txt"] + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + settings = "os", "arch", "compiler", "build_type" + options = { + "shared": [True, False], + "fPIC": [True, False], + "with_cxx11": [True, False], + "with_ack_tracker": [True, False], + } + default_options = { + "shared": False, + "fPIC": True, + "with_cxx11": False, + "with_ack_tracker": True + } + _cmake = None + + @property + def _source_subfolder(self): + return "source_subfolder" + + @property + def _build_subfolder(self): + return "build_subfolder" + + def config_options(self): + if self.settings.os == "Windows": + del self.options.fPIC + + def requirements(self): + self.requires("libpcap/1.10.0") + self.requires("openssl/1.1.1i") + if self.options.with_ack_tracker: + self.requires("boost/1.75.0") + + def configure(self): + if self.options.shared: + del self.options.fPIC + if self.options.with_cxx11: + tools.check_min_cppstd(self, 11) + + def source(self): + tools.get(**self.conan_data["sources"][self.version]) + extracted_dir = self.name + "-" + self.version + os.rename(extracted_dir, self._source_subfolder) + + def _configure_cmake(self): + if self._cmake: + return self._cmake + self._cmake = CMake(self) + self._cmake.definitions["LIBTINS_BUILD_EXAMPLES"] = False + self._cmake.definitions["LIBTINS_BUILD_TESTS"] = False + + self._cmake.definitions["LIBTINS_BUILD_SHARED"] = self.options.shared + self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = self.options.with_cxx11 + self._cmake.definitions["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker + + self._cmake.configure(build_folder=self._build_subfolder) + return self._cmake + + def build(self): + cmake = self._configure_cmake() + cmake.build() + + def package(self): + self.copy(os.path.join(self._source_subfolder, "LICENSE"), dst="licenses") + cmake = self._configure_cmake() + cmake.install() + tools.rmdir(os.path.join(self.package_folder, "lib", "cmake")) + tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) + + def package_info(self): + self.cpp_info.libs = tools.collect_libs(self) diff --git a/recipes/libtins/all/test_package/CMakeLists.txt b/recipes/libtins/all/test_package/CMakeLists.txt new file mode 100644 index 0000000000000..f1b77a1b4487a --- /dev/null +++ b/recipes/libtins/all/test_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.1) +project(test_package) + +include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) +conan_basic_setup() + +add_executable(test_package test_package.cpp) +target_link_libraries(test_package ${CONAN_LIBS}) diff --git a/recipes/libtins/all/test_package/conanfile.py b/recipes/libtins/all/test_package/conanfile.py new file mode 100644 index 0000000000000..b88a6525524a6 --- /dev/null +++ b/recipes/libtins/all/test_package/conanfile.py @@ -0,0 +1,16 @@ +from conans import ConanFile, CMake +import os + + +class TestPackageConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + generators = "cmake" + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() + + def test(self): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) diff --git a/recipes/libtins/all/test_package/test_package.cpp b/recipes/libtins/all/test_package/test_package.cpp new file mode 100644 index 0000000000000..245b423e4c067 --- /dev/null +++ b/recipes/libtins/all/test_package/test_package.cpp @@ -0,0 +1,12 @@ +#include +#include + +using namespace Tins; +using namespace std; + +int main() { + SnifferConfiguration config; + config.set_filter("port 80"); + config.set_promisc_mode(true); + config.set_snap_len(400); +} diff --git a/recipes/libtins/config.yml b/recipes/libtins/config.yml new file mode 100644 index 0000000000000..0c70b3a653399 --- /dev/null +++ b/recipes/libtins/config.yml @@ -0,0 +1,3 @@ +versions: + "4.2": + folder: all From 468c77c5c149381994d69127a8edccc1660b5dc9 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:03:16 +0300 Subject: [PATCH 02/17] add names to generators --- recipes/libtins/all/conanfile.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index c434206e74ef9..1ed4110d3e7ce 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -81,4 +81,7 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): + self.cpp_info.names["cmake_find_package"] = "libtins" + self.cpp_info.names["cmake_find_package_multi"] = "libtins" + self.cpp_info.names["pkg_config"] = "libtins" self.cpp_info.libs = tools.collect_libs(self) From 01bf4c2d4357bf2f403f2f514500b6a2fa796b5f Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:08:53 +0300 Subject: [PATCH 03/17] enable cxx 11 by default --- recipes/libtins/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 1ed4110d3e7ce..bf3421e6c68e7 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -21,7 +21,7 @@ class LibTinsConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_cxx11": False, + "with_cxx11": True, "with_ack_tracker": True } _cmake = None From a506d01c5ad97af9ce2d941435b6a2d44143e79e Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:44:32 +0300 Subject: [PATCH 04/17] Update recipes/libtins/all/CMakeLists.txt Co-authored-by: Ayaz Salikhov --- recipes/libtins/all/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/CMakeLists.txt b/recipes/libtins/all/CMakeLists.txt index c986d294c7547..887cdc7b32cf2 100644 --- a/recipes/libtins/all/CMakeLists.txt +++ b/recipes/libtins/all/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 2.8.1) project(cmake_wrapper) include(conanbuildinfo.cmake) From a2c75988b69b0ddc2c41f066a4045a5a73fd84dc Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:45:33 +0300 Subject: [PATCH 05/17] Update recipes/libtins/all/test_package/test_package.cpp Co-authored-by: Ayaz Salikhov --- recipes/libtins/all/test_package/test_package.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/recipes/libtins/all/test_package/test_package.cpp b/recipes/libtins/all/test_package/test_package.cpp index 245b423e4c067..54d999bafa1ac 100644 --- a/recipes/libtins/all/test_package/test_package.cpp +++ b/recipes/libtins/all/test_package/test_package.cpp @@ -1,8 +1,6 @@ -#include #include using namespace Tins; -using namespace std; int main() { SnifferConfiguration config; From 338e987281a89ad2a46a9927801aaef353ae38cb Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:47:07 +0300 Subject: [PATCH 06/17] add other options from readme and fix suggesstions --- recipes/libtins/all/conanfile.py | 11 +++++++++-- recipes/libtins/all/test_package/conanfile.py | 5 +++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index bf3421e6c68e7..db0099c5b37c6 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -17,12 +17,16 @@ class LibTinsConan(ConanFile): "fPIC": [True, False], "with_cxx11": [True, False], "with_ack_tracker": [True, False], + "with_wpa2": [True, False], + "with_dot11": [True, False], } default_options = { "shared": False, "fPIC": True, "with_cxx11": True, "with_ack_tracker": True + "with_wpa2": True + "with_dot11": True } _cmake = None @@ -40,14 +44,15 @@ def config_options(self): def requirements(self): self.requires("libpcap/1.10.0") - self.requires("openssl/1.1.1i") if self.options.with_ack_tracker: self.requires("boost/1.75.0") + if self.options.with_wpa2: + self.requires("openssl/1.1.1i") def configure(self): if self.options.shared: del self.options.fPIC - if self.options.with_cxx11: + if self.options.with_cxx11 and self.settings.compiler.cppstd: tools.check_min_cppstd(self, 11) def source(self): @@ -65,6 +70,8 @@ def _configure_cmake(self): self._cmake.definitions["LIBTINS_BUILD_SHARED"] = self.options.shared self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = self.options.with_cxx11 self._cmake.definitions["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker + self._cmake.definitions["LIBTINS_ENABLE_WPA2"] = self.options.with_wpa2 + self._cmake.definitions["LIBTINS_ENABLE_DOT11"] = self.options.with_dot11 self._cmake.configure(build_folder=self._build_subfolder) return self._cmake diff --git a/recipes/libtins/all/test_package/conanfile.py b/recipes/libtins/all/test_package/conanfile.py index b88a6525524a6..24ad9b2d2ec5c 100644 --- a/recipes/libtins/all/test_package/conanfile.py +++ b/recipes/libtins/all/test_package/conanfile.py @@ -12,5 +12,6 @@ def build(self): cmake.build() def test(self): - bin_path = os.path.join("bin", "test_package") - self.run(bin_path, run_environment=True) + if not tools.cross_building(self.settings): + bin_path = os.path.join("bin", "test_package") + self.run(bin_path, run_environment=True) From 55cb21255fcb90e91cb07960cd3336d9d7fc2841 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 16:49:41 +0300 Subject: [PATCH 07/17] fix build --- recipes/libtins/all/conanfile.py | 8 ++++---- recipes/libtins/all/test_package/conanfile.py | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index db0099c5b37c6..5c55b346cff4b 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -10,7 +10,7 @@ class LibTinsConan(ConanFile): license = "BSD-2-Clause" topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], @@ -24,9 +24,9 @@ class LibTinsConan(ConanFile): "shared": False, "fPIC": True, "with_cxx11": True, - "with_ack_tracker": True - "with_wpa2": True - "with_dot11": True + "with_ack_tracker": True, + "with_wpa2": True, + "with_dot11": True, } _cmake = None diff --git a/recipes/libtins/all/test_package/conanfile.py b/recipes/libtins/all/test_package/conanfile.py index 24ad9b2d2ec5c..5849d14808adb 100644 --- a/recipes/libtins/all/test_package/conanfile.py +++ b/recipes/libtins/all/test_package/conanfile.py @@ -1,4 +1,4 @@ -from conans import ConanFile, CMake +from conans import tools, ConanFile, CMake import os From 7ea470efc179536bcdc45bd37ce940edcf0c8fa6 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 17:22:42 +0300 Subject: [PATCH 08/17] remove invalid condition --- recipes/libtins/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 5c55b346cff4b..d722a96a36363 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -52,7 +52,7 @@ def requirements(self): def configure(self): if self.options.shared: del self.options.fPIC - if self.options.with_cxx11 and self.settings.compiler.cppstd: + if self.options.with_cxx11: tools.check_min_cppstd(self, 11) def source(self): From cf15052617e96afa84839912096babf12a5072a5 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 17:34:17 +0300 Subject: [PATCH 09/17] remove with_cxx11 option --- recipes/libtins/all/conanfile.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index d722a96a36363..fbc05c1c9a7a1 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -15,7 +15,6 @@ class LibTinsConan(ConanFile): options = { "shared": [True, False], "fPIC": [True, False], - "with_cxx11": [True, False], "with_ack_tracker": [True, False], "with_wpa2": [True, False], "with_dot11": [True, False], @@ -23,7 +22,6 @@ class LibTinsConan(ConanFile): default_options = { "shared": False, "fPIC": True, - "with_cxx11": True, "with_ack_tracker": True, "with_wpa2": True, "with_dot11": True, @@ -52,14 +50,13 @@ def requirements(self): def configure(self): if self.options.shared: del self.options.fPIC - if self.options.with_cxx11: - tools.check_min_cppstd(self, 11) def source(self): tools.get(**self.conan_data["sources"][self.version]) extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) + def _configure_cmake(self): if self._cmake: return self._cmake @@ -68,7 +65,7 @@ def _configure_cmake(self): self._cmake.definitions["LIBTINS_BUILD_TESTS"] = False self._cmake.definitions["LIBTINS_BUILD_SHARED"] = self.options.shared - self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = self.options.with_cxx11 + self._cmake.definitions["LIBTINS_ENABLE_CXX11"] = tools.valid_min_cppstd(self, 11) self._cmake.definitions["LIBTINS_ENABLE_ACK_TRACKER"] = self.options.with_ack_tracker self._cmake.definitions["LIBTINS_ENABLE_WPA2"] = self.options.with_wpa2 self._cmake.definitions["LIBTINS_ENABLE_DOT11"] = self.options.with_dot11 From 259be40e1295a1dc0f216a8969e87d6e64a41606 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 19:14:13 +0300 Subject: [PATCH 10/17] Use multi generator to avoid link errors --- recipes/libtins/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index fbc05c1c9a7a1..da802868edc4a 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -10,7 +10,7 @@ class LibTinsConan(ConanFile): license = "BSD-2-Clause" topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package" + generators = "cmake", "cmake_find_package_multi" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], From f855cb0063c2b6266727ea6e0313c1d71056304b Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Tue, 16 Feb 2021 19:52:59 +0300 Subject: [PATCH 11/17] restore cmake_find_package generator --- recipes/libtins/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index da802868edc4a..b2340c7b919f0 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -10,7 +10,7 @@ class LibTinsConan(ConanFile): license = "BSD-2-Clause" topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package_multi" + generators = "cmake", "cmake_find_package", "cmake_find_package_multi" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False], From de5ca7fe0e7aef40627377d0eca3b29d34a86041 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 12:50:58 +0300 Subject: [PATCH 12/17] Update recipes/libtins/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libtins/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index b2340c7b919f0..5e5e7d07c0c7b 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -85,6 +85,7 @@ def package(self): tools.rmdir(os.path.join(self.package_folder, "lib", "pkgconfig")) def package_info(self): + # FIXME: official CMake imported target is not namespaced self.cpp_info.names["cmake_find_package"] = "libtins" self.cpp_info.names["cmake_find_package_multi"] = "libtins" self.cpp_info.names["pkg_config"] = "libtins" From f821eb65594cf48a571130af99d875cf9f413524 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 13:48:52 +0300 Subject: [PATCH 13/17] Replace OPENSSL with OpenSSL to fix linking issues --- recipes/libtins/all/conanfile.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 5e5e7d07c0c7b..fa3d84dce0d33 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -55,7 +55,16 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) - + tools.replace_in_file( + os.path.join(self._source_subfolder, "CMakeLists.txt"), + "OPENSSL", + "OpenSSL" + ) + tools.replace_in_file( + os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), + "OPENSSL", + "OpenSSL" + ) def _configure_cmake(self): if self._cmake: From 57ed679ddaf3b1abcdc8002ee76cbc098988cc77 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 16:00:18 +0300 Subject: [PATCH 14/17] Update recipes/libtins/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libtins/all/conanfile.py | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index fa3d84dce0d33..24a8fd817564c 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -55,16 +55,14 @@ def source(self): tools.get(**self.conan_data["sources"][self.version]) extracted_dir = self.name + "-" + self.version os.rename(extracted_dir, self._source_subfolder) - tools.replace_in_file( - os.path.join(self._source_subfolder, "CMakeLists.txt"), - "OPENSSL", - "OpenSSL" - ) - tools.replace_in_file( - os.path.join(self._source_subfolder, "src", "CMakeLists.txt"), - "OPENSSL", - "OpenSSL" - ) + + def _patch_sources(self): + # Workaround for casing issues in cmake_find_package generator of openssl recipe + top_cmakelists = os.path.join(self._source_subfolder, "CMakeLists.txt") + src_cmakelists = os.path.join(self._source_subfolder, "src", "CMakeLists.txt") + tools.replace_in_file(top_cmakelists, "OPENSSL_FOUND", "OpenSSL_FOUND") + tools.replace_in_file(src_cmakelists, "OPENSSL_INCLUDE_DIR", "OpenSSL_INCLUDE_DIR") + tools.replace_in_file(src_cmakelists, "OPENSSL_LIBRARIES", "OpenSSL_LIBRARIES") def _configure_cmake(self): if self._cmake: From a51f6877f1d64b80e8b470c864e991e4917c8c2e Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 16:00:24 +0300 Subject: [PATCH 15/17] Update recipes/libtins/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libtins/all/conanfile.py | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 24a8fd817564c..7ab61b5c5fccc 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -81,6 +81,7 @@ def _configure_cmake(self): return self._cmake def build(self): + self._patch_sources() cmake = self._configure_cmake() cmake.build() From 52623a9464babf922f728c1a891f78d7b7dd6323 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 16:49:29 +0300 Subject: [PATCH 16/17] Update recipes/libtins/all/conanfile.py Co-authored-by: SpaceIm <30052553+SpaceIm@users.noreply.github.com> --- recipes/libtins/all/conanfile.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 7ab61b5c5fccc..991ff3477d337 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -98,3 +98,5 @@ def package_info(self): self.cpp_info.names["cmake_find_package_multi"] = "libtins" self.cpp_info.names["pkg_config"] = "libtins" self.cpp_info.libs = tools.collect_libs(self) + if self.settings.os == "Windows" and not self.options.shared: + self.cpp_info.defines.append("TINS_STATIC") From 8a57b756ed1d60dc6d8b6ffd5f4f2afca1bdd4b4 Mon Sep 17 00:00:00 2001 From: Ivan Fefer Date: Wed, 17 Feb 2021 18:35:26 +0300 Subject: [PATCH 17/17] remove needless generator --- recipes/libtins/all/conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/libtins/all/conanfile.py b/recipes/libtins/all/conanfile.py index 991ff3477d337..524f3593bd673 100644 --- a/recipes/libtins/all/conanfile.py +++ b/recipes/libtins/all/conanfile.py @@ -10,7 +10,7 @@ class LibTinsConan(ConanFile): license = "BSD-2-Clause" topics = ("pcap", "packets", "network", "packet-analyser", "packet-parsing", "libpcap", "sniffing") exports_sources = ["CMakeLists.txt"] - generators = "cmake", "cmake_find_package", "cmake_find_package_multi" + generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" options = { "shared": [True, False],