From b7a59a9b14e585bf7d1b15f6e1276b6f47fcb05f Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Tue, 5 Jan 2021 13:16:42 -0700 Subject: [PATCH 1/7] Update to paho-mqtt-c 1.3.8 and paho-mqtt-cpp 1.2.0 --- recipes/paho-mqtt-cpp/all/conandata.yml | 5 +++++ recipes/paho-mqtt-cpp/all/conanfile.py | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/recipes/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index d957900ce0bc5..58b844b31a8e6 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -1,4 +1,7 @@ sources: + "1.2.0": + sha256: 435e97e4d5b1da13daa26cadd3e83fe9d154930abaa78b8ff1b8c854b5345d8b + url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz "1.1": sha256: cb0343349ed91ef51d0e76ae860d19435a730d3d355e57886bb090014cb70bbe url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.1.tar.gz @@ -7,6 +10,8 @@ sources: url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.0.1.tar.gz patches: + "1.2.0": + - base_path: "source_subfolder" "1.1": - patch_file: "patches/1.1/0001-deadlock_and_remlog-for-1-1.patch" base_path: "source_subfolder" diff --git a/recipes/paho-mqtt-cpp/all/conanfile.py b/recipes/paho-mqtt-cpp/all/conanfile.py index f684b55171443..7fe996cbd92de 100644 --- a/recipes/paho-mqtt-cpp/all/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/conanfile.py @@ -9,7 +9,7 @@ class PahoMqttCppConan(ConanFile): homepage = "https://github.com/eclipse/paho.mqtt.cpp" topics = ("MQTT", "IoT", "eclipse", "SSL", "paho", "Cpp") license = "EPL-1.0" - description = """The open-source client implementations of MQTT and MQTT-SN""" + description = "The open-source client implementations of MQTT and MQTT-SN" exports_sources = ["CMakeLists.txt", "patches/*"] generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" @@ -46,7 +46,7 @@ def configure(self): def requirements(self): - self.requires("paho-mqtt-c/1.3.5") + self.requires("paho-mqtt-c/1.3.8") def source(self): tools.get(**self.conan_data["sources"][self.version]) From 083a154be7404b39720e7630b16af4a325c390b9 Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Tue, 5 Jan 2021 16:46:37 -0700 Subject: [PATCH 2/7] Fix config.yml add version 1.2.0 --- recipes/paho-mqtt-cpp/config.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/paho-mqtt-cpp/config.yml b/recipes/paho-mqtt-cpp/config.yml index 59f223359dda8..1970391ed5cca 100644 --- a/recipes/paho-mqtt-cpp/config.yml +++ b/recipes/paho-mqtt-cpp/config.yml @@ -3,3 +3,5 @@ versions: folder: "all" "1.1": folder: "all" + "1.2.0": + folder: "all" From bd2076c60a306504bc945a7bd6424bbba73fc1a9 Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Tue, 5 Jan 2021 18:32:45 -0700 Subject: [PATCH 3/7] Fix FindPahMqttC.cmake for static on WIN32 --- recipes/paho-mqtt-cpp/all/conandata.yml | 5 ++++- .../0004-fix-win32-static-config-cmake.patch | 17 +++++++++++++++++ .../0003-fix-win32-static-config-cmake.patch | 17 +++++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch create mode 100644 recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch diff --git a/recipes/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index 58b844b31a8e6..c96f02d2c80d9 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -17,7 +17,8 @@ patches: base_path: "source_subfolder" - patch_file: "patches/1.1/0002-ios_fix.patch" base_path: "source_subfolder" - + - patch_file: "patches/1.1/0003-fix-win32-static-config-cmake.patch" + base_path: "source_subfolder" "1.0.1": - patch_file: "patches/1.0.1/0001-fix-cmake-module-path.patch" base_path: "source_subfolder" @@ -25,4 +26,6 @@ patches: base_path: "source_subfolder" - patch_file: "patches/1.0.1/0003-fix-paho-mqtt-cpp-config-cmake.patch" base_path: "source_subfolder" + - patch_file: "patches/1.0.1/0004-fix-win32-static-config-cmake.patch" + base_path: "source_subfolder" diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch new file mode 100644 index 0000000000000..9ceae8d7ae328 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake +index 53f15a3..7e2d756 100644 +--- a/cmake/FindPahoMqttC.cmake ++++ b/cmake/FindPahoMqttC.cmake +@@ -6,8 +6,10 @@ else() + set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) + endif() + # add suffix when using static Paho MQTT C library variant +-if(PAHO_BUILD_STATIC) +- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) ++if(WIN32) ++ if(PAHO_BUILD_STATIC) ++ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) ++ endif() + endif() + + find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) \ No newline at end of file diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch new file mode 100644 index 0000000000000..d71d05aa53382 --- /dev/null +++ b/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch @@ -0,0 +1,17 @@ +diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake +index 53f15a3..7e2d756 100644 +--- a/cmake/FindPahoMqttC.cmake ++++ b/cmake/FindPahoMqttC.cmake +@@ -6,8 +6,10 @@ else() + set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) + endif() + # add suffix when using static Paho MQTT C library variant +-if(PAHO_BUILD_STATIC) +- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) ++if(WIN32) ++ if(PAHO_BUILD_STATIC) ++ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) ++ endif() + endif() + + find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) From 3c5b6896a1e75b3d5f449b2f86a32c0471d69b21 Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Wed, 6 Jan 2021 10:16:06 -0700 Subject: [PATCH 4/7] Fix patch. --- .../all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch index 9ceae8d7ae328..5440aa27af747 100644 --- a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch +++ b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch @@ -14,4 +14,5 @@ index 53f15a3..7e2d756 100644 + endif() endif() - find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) \ No newline at end of file + find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) + \ No newline at end of file From 97518af5e84de81f764f6f24899e916c03be3579 Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Wed, 6 Jan 2021 10:31:45 -0700 Subject: [PATCH 5/7] Add final newline to patch. --- .../all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch | 1 - 1 file changed, 1 deletion(-) diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch index 5440aa27af747..d71d05aa53382 100644 --- a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch +++ b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch @@ -15,4 +15,3 @@ index 53f15a3..7e2d756 100644 endif() find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) - \ No newline at end of file From 58739e044c9e34d6baae695d6d9019fecec19d4a Mon Sep 17 00:00:00 2001 From: bowb <6180319+bowb@users.noreply.github.com> Date: Mon, 11 Jan 2021 15:35:49 -0700 Subject: [PATCH 6/7] some newlines. --- recipes/paho-mqtt-cpp/all/conandata.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/recipes/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index c96f02d2c80d9..dcd990f52af1c 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -12,13 +12,15 @@ sources: patches: "1.2.0": - base_path: "source_subfolder" + "1.1": - patch_file: "patches/1.1/0001-deadlock_and_remlog-for-1-1.patch" base_path: "source_subfolder" - patch_file: "patches/1.1/0002-ios_fix.patch" base_path: "source_subfolder" - patch_file: "patches/1.1/0003-fix-win32-static-config-cmake.patch" - base_path: "source_subfolder" + base_path: "source_subfolder" + "1.0.1": - patch_file: "patches/1.0.1/0001-fix-cmake-module-path.patch" base_path: "source_subfolder" From a62891c667c67d31f7e0227404d531b9e33252a3 Mon Sep 17 00:00:00 2001 From: Chris McArthur Date: Sun, 17 Jan 2021 12:17:36 -0500 Subject: [PATCH 7/7] bind upstream version requirements on deps --- recipes/paho-mqtt-cpp/all/conandata.yml | 14 ++-------- recipes/paho-mqtt-cpp/all/conanfile.py | 26 ++++++++++++++----- .../0004-fix-win32-static-config-cmake.patch | 17 ------------ .../0003-fix-win32-static-config-cmake.patch | 17 ------------ 4 files changed, 22 insertions(+), 52 deletions(-) delete mode 100644 recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch delete mode 100644 recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch diff --git a/recipes/paho-mqtt-cpp/all/conandata.yml b/recipes/paho-mqtt-cpp/all/conandata.yml index dcd990f52af1c..9f0236641e7c1 100644 --- a/recipes/paho-mqtt-cpp/all/conandata.yml +++ b/recipes/paho-mqtt-cpp/all/conandata.yml @@ -4,23 +4,16 @@ sources: url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.2.0.tar.gz "1.1": sha256: cb0343349ed91ef51d0e76ae860d19435a730d3d355e57886bb090014cb70bbe - url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.1.tar.gz + url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.1.tar.gz "1.0.1": sha256: e97386d159b811e534b98d21e3f6881ab2b43678ec026da7525d5c21ebc292ff url: https://github.com/eclipse/paho.mqtt.cpp/archive/v1.0.1.tar.gz - patches: - "1.2.0": - - base_path: "source_subfolder" - "1.1": - patch_file: "patches/1.1/0001-deadlock_and_remlog-for-1-1.patch" base_path: "source_subfolder" - patch_file: "patches/1.1/0002-ios_fix.patch" - base_path: "source_subfolder" - - patch_file: "patches/1.1/0003-fix-win32-static-config-cmake.patch" - base_path: "source_subfolder" - + base_path: "source_subfolder" "1.0.1": - patch_file: "patches/1.0.1/0001-fix-cmake-module-path.patch" base_path: "source_subfolder" @@ -28,6 +21,3 @@ patches: base_path: "source_subfolder" - patch_file: "patches/1.0.1/0003-fix-paho-mqtt-cpp-config-cmake.patch" base_path: "source_subfolder" - - patch_file: "patches/1.0.1/0004-fix-win32-static-config-cmake.patch" - base_path: "source_subfolder" - diff --git a/recipes/paho-mqtt-cpp/all/conanfile.py b/recipes/paho-mqtt-cpp/all/conanfile.py index 7fe996cbd92de..c8668dd8a0232 100644 --- a/recipes/paho-mqtt-cpp/all/conanfile.py +++ b/recipes/paho-mqtt-cpp/all/conanfile.py @@ -7,10 +7,10 @@ class PahoMqttCppConan(ConanFile): name = "paho-mqtt-cpp" url = "https://github.com/conan-io/conan-center-index" homepage = "https://github.com/eclipse/paho.mqtt.cpp" - topics = ("MQTT", "IoT", "eclipse", "SSL", "paho", "Cpp") + topics = ("mqtt", "iot", "eclipse", "ssl", "paho", "cpp") license = "EPL-1.0" description = "The open-source client implementations of MQTT and MQTT-SN" - exports_sources = ["CMakeLists.txt", "patches/*"] + exports_sources = ["CMakeLists.txt", "patches/**"] generators = "cmake", "cmake_find_package" settings = "os", "arch", "compiler", "build_type" options = {"shared": [True, False], @@ -38,15 +38,22 @@ def configure(self): tools.check_min_cppstd(self, minimal_cpp_standard) if self.settings.os == "Windows" and self.options.shared: - raise ConanInvalidConfiguration( - "Paho cpp can not be built as shared on Windows.") + raise ConanInvalidConfiguration("{} can not be built as shared on Windows.".format(self.name)) self.options["paho-mqtt-c"].shared = self.options.shared self.options["paho-mqtt-c"].ssl = self.options.ssl + def validate(self): + if self.options["paho-mqtt-c"].shared != self.options.shared: + raise ConanInvalidConfiguration("{} requires paho-mqtt-c to have a matching 'shared' option.".format(self.name)) + if self.options["paho-mqtt-c"].ssl != self.options.ssl: + raise ConanInvalidConfiguration("{} requires paho-mqtt-c to have a matching 'ssl' option.".format(self.name)) def requirements(self): - self.requires("paho-mqtt-c/1.3.8") + if tools.Version(self.version) >= "1.2.0": + self.requires("paho-mqtt-c/1.3.8") + else: + self.requires("paho-mqtt-c/1.3.1") # https://github.com/eclipse/paho.mqtt.cpp/releases/tag/v1.1 def source(self): tools.get(**self.conan_data["sources"][self.version]) @@ -66,7 +73,14 @@ def _configure_cmake(self): return self._cmake def build(self): - for patch in self.conan_data["patches"][self.version]: + # See this conversation https://github.com/conan-io/conan-center-index/pull/4096#discussion_r556119143 + # Changed by https://github.com/eclipse/paho.mqtt.c/commit/f875768984574fede6065c8ede0a7eac890a6e09 + # and https://github.com/eclipse/paho.mqtt.c/commit/c116b725fff631180414a6e99701977715a4a690 + # FIXME: after https://github.com/conan-io/conan/pull/8053#pullrequestreview-541120387 + if tools.Version(self.version) < "1.2.0" and tools.Version(self.deps_cpp_info["paho-mqtt-c"].version) >= "1.3.2": + raise ConanInvalidConfiguration("{}/{} requires paho-mqtt-c =< 1.3.1".format(self.name, self.version)) + + for patch in self.conan_data.get("patches", {}).get(self.version, []): tools.patch(**patch) cmake = self._configure_cmake() cmake.build() diff --git a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch deleted file mode 100644 index d71d05aa53382..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.0.1/0004-fix-win32-static-config-cmake.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake -index 53f15a3..7e2d756 100644 ---- a/cmake/FindPahoMqttC.cmake -+++ b/cmake/FindPahoMqttC.cmake -@@ -6,8 +6,10 @@ else() - set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) - endif() - # add suffix when using static Paho MQTT C library variant --if(PAHO_BUILD_STATIC) -- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) -+if(WIN32) -+ if(PAHO_BUILD_STATIC) -+ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) -+ endif() - endif() - - find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME}) diff --git a/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch b/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch deleted file mode 100644 index d71d05aa53382..0000000000000 --- a/recipes/paho-mqtt-cpp/all/patches/1.1/0003-fix-win32-static-config-cmake.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/cmake/FindPahoMqttC.cmake b/cmake/FindPahoMqttC.cmake -index 53f15a3..7e2d756 100644 ---- a/cmake/FindPahoMqttC.cmake -+++ b/cmake/FindPahoMqttC.cmake -@@ -6,8 +6,10 @@ else() - set(_PAHO_MQTT_C_LIB_NAME paho-mqtt3a) - endif() - # add suffix when using static Paho MQTT C library variant --if(PAHO_BUILD_STATIC) -- set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) -+if(WIN32) -+ if(PAHO_BUILD_STATIC) -+ set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static) -+ endif() - endif() - - find_library(PAHO_MQTT_C_LIBRARIES NAMES ${_PAHO_MQTT_C_LIB_NAME})