From cc31f9456f6a22c7babad9a76690fd2de106cf7c Mon Sep 17 00:00:00 2001 From: wangli28 Date: Wed, 23 Sep 2020 08:10:05 +0000 Subject: [PATCH 1/8] [paho-mqtt] Update to version 1.3.5 --- ports/paho-mqtt/CONTROL | 2 +- ports/paho-mqtt/export-cmake-targets.patch | 101 ---------------- ports/paho-mqtt/fix-install-path.patch | 111 +++++++++--------- ports/paho-mqtt/fix-static-build.patch | 97 --------------- .../paho-mqtt/fix-unresolvedsymbol-arm.patch | 24 ++-- ports/paho-mqtt/fix-win-macro.patch | 79 ------------- ports/paho-mqtt/portfile.cmake | 9 +- ports/paho-mqtt/remove_compiler_options.patch | 6 +- 8 files changed, 74 insertions(+), 355 deletions(-) delete mode 100644 ports/paho-mqtt/export-cmake-targets.patch delete mode 100644 ports/paho-mqtt/fix-static-build.patch delete mode 100644 ports/paho-mqtt/fix-win-macro.patch diff --git a/ports/paho-mqtt/CONTROL b/ports/paho-mqtt/CONTROL index 67f584e3937a05..a737277cd0de56 100644 --- a/ports/paho-mqtt/CONTROL +++ b/ports/paho-mqtt/CONTROL @@ -1,5 +1,5 @@ Source: paho-mqtt -Version: 1.3.1 +Version: 1.3.5 Homepage: https://github.com/eclipse/paho.mqtt.c Description: Paho project provides open-source client implementations of MQTT and MQTT-SN messaging protocols aimed at new, existing, and emerging applications for the Internet of Things Build-Depends: openssl diff --git a/ports/paho-mqtt/export-cmake-targets.patch b/ports/paho-mqtt/export-cmake-targets.patch deleted file mode 100644 index d328a99c669009..00000000000000 --- a/ports/paho-mqtt/export-cmake-targets.patch +++ /dev/null @@ -1,101 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4fdafef..dc8fd8a 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -19,10 +19,6 @@ - # Note: on OS X you should install XCode and the associated command-line tools - - ## compilation/linkage settings --INCLUDE_DIRECTORIES( -- . -- ${CMAKE_BINARY_DIR} -- ) - - CONFIGURE_FILE(VersionInfo.h.in - ${CMAKE_BINARY_DIR}/VersionInfo.h -@@ -84,8 +80,17 @@ IF (NOT PAHO_BUILD_STATIC) - paho-mqtt3c paho-mqtt3a PROPERTIES - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR}) -+ FOREACH(TARGET paho-mqtt3c paho-mqtt3a) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() - - INSTALL(TARGETS paho-mqtt3c paho-mqtt3a -+ EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -@@ -98,7 +103,14 @@ ELSE() - - TARGET_LINK_LIBRARIES(paho-mqtt3c-static ${LIBS_SYSTEM}) - TARGET_LINK_LIBRARIES(paho-mqtt3a-static ${LIBS_SYSTEM}) -- -+ FOREACH(TARGET paho-mqtt3c-static paho-mqtt3a-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() - INSTALL(TARGETS paho-mqtt3c-static paho-mqtt3a-static - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF() -@@ -159,7 +171,16 @@ IF (PAHO_WITH_SSL) - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "OPENSSL=1") -+ FOREACH(TARGET paho-mqtt3cs paho-mqtt3as) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() - INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as -+ EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -@@ -175,12 +196,33 @@ IF (PAHO_WITH_SSL) - VERSION ${CLIENT_VERSION} - SOVERSION ${PAHO_VERSION_MAJOR} - COMPILE_DEFINITIONS "OPENSSL=1") -- -+ FOREACH(TARGET paho-mqtt3cs-static paho-mqtt3as-static) -+ TARGET_INCLUDE_DIRECTORIES(${TARGET} -+ PUBLIC -+ $ -+ $ -+ PRIVATE -+ ${CMAKE_BINARY_DIR}) -+ ENDFOREACH() - INSTALL(TARGETS paho-mqtt3cs-static paho-mqtt3as-static -+ EXPORT eclipse-paho-mqtt-cTargets - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF() - ENDIF() - -+INSTALL(EXPORT eclipse-paho-mqtt-cTargets -+ FILE eclipse-paho-mqtt-cConfig.cmake -+ NAMESPACE eclipse-paho-mqtt-c:: -+ DESTINATION share/eclipse-paho-mqtt-c) -+ -+INCLUDE(CMakePackageConfigHelpers) -+WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" -+ VERSION ${CLIENT_VERSION} -+ COMPATIBILITY SameMajorVersion) -+INSTALL(FILES -+ "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" -+ DESTINATION share/eclipse-paho-mqtt-c) -+ - # Base64 test - ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) - TARGET_COMPILE_DEFINITIONS( Base64Test PUBLIC "-DBASE64_TEST" ) diff --git a/ports/paho-mqtt/fix-install-path.patch b/ports/paho-mqtt/fix-install-path.patch index 4781419315f5f1..749d280aacef8a 100644 --- a/ports/paho-mqtt/fix-install-path.patch +++ b/ports/paho-mqtt/fix-install-path.patch @@ -1,56 +1,55 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 64ae92c..6d552d1 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -64,11 +64,11 @@ ENDIF() - IF (PAHO_ENABLE_CPACK) - ### packaging settings - FILE(GLOB samples "src/samples/*.c") -- INSTALL(FILES ${samples} DESTINATION samples) -+ INSTALL(FILES ${samples} DESTINATION share/paho-mqtt/samples) - - SET(CPACK_PACKAGE_VENDOR "Eclipse Paho") - SET(CPACK_PACKAGE_NAME "Eclipse-Paho-MQTT-C") -- INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION .) -+ INSTALL(FILES CONTRIBUTING.md epl-v10 edl-v10 README.md notice.html DESTINATION share/paho-mqtt) - - IF (WIN32) - SET(CPACK_GENERATOR "ZIP") -diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt -index f15f314..54deec5 100644 ---- a/doc/CMakeLists.txt -+++ b/doc/CMakeLists.txt -@@ -39,7 +39,7 @@ ENDFOREACH(DOXYFILE_SRC) - - ADD_CUSTOM_TARGET(doc ALL DEPENDS ${DOXYTARGETS}) - IF (PAHO_ENABLE_CPACK) -- INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share) -+ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION share/paho-mqtt) - ELSE() - INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc DESTINATION ${CMAKE_INSTALL_DOCDIR}) - ENDIF() -\ No newline at end of file -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index b46eaca..a132062 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -89,7 +89,7 @@ INSTALL(TARGETS paho-mqtt3c paho-mqtt3a - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - INSTALL(TARGETS MQTTVersion -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ RUNTIME DESTINATION tools/paho-mqtt) - - IF (PAHO_BUILD_STATIC) - ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) -@@ -102,8 +102,8 @@ IF (PAHO_BUILD_STATIC) - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - ENDIF() - --INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h -- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) -+INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h -+ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/paho-mqtt) - - IF (PAHO_WITH_SSL) - SET(OPENSSL_SEARCH_PATH "" CACHE PATH "Directory containing OpenSSL libraries and includes") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3df385a..1ee7be0 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -60,8 +60,8 @@ IF (NOT PAHO_BUILD_SHARED AND NOT PAHO_BUILD_STATIC) + MESSAGE(FATAL_ERROR "You must set either PAHO_BUILD_SHARED, PAHO_BUILD_STATIC, or both") + ENDIF() + +-IF(PAHO_BUILD_DEB_PACKAGE) +- set(CMAKE_INSTALL_DOCDIR share/doc/libpaho-mqtt) ++IF(1) ++ set(CMAKE_INSTALL_DOCDIR share/paho-mqtt) + ENDIF() + + ADD_SUBDIRECTORY(src) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 20b578a..75dc833 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -142,7 +142,7 @@ IF (PAHO_BUILD_SHARED) + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + INSTALL(TARGETS MQTTVersion +- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) ++ RUNTIME DESTINATION tools/paho-mqtt) + ENDIF() + + IF (PAHO_BUILD_STATIC) +@@ -183,7 +183,7 @@ IF (PAHO_BUILD_STATIC) + ENDIF() + + INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h MQTTProperties.h MQTTReasonCodes.h MQTTSubscribeOpts.h MQTTExportDeclarations.h +- DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) ++ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/paho-mqtt) + + IF (PAHO_WITH_SSL) + SET(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes") +@@ -306,7 +306,7 @@ ENDIF() + INSTALL(EXPORT eclipse-paho-mqtt-cTargets + FILE eclipse-paho-mqtt-cConfig.cmake + NAMESPACE eclipse-paho-mqtt-c:: +- DESTINATION lib/cmake/eclipse-paho-mqtt-c) ++ DESTINATION share/eclipse-paho-mqtt-c) + + INCLUDE(CMakePackageConfigHelpers) + WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" +@@ -314,7 +314,7 @@ WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" + COMPATIBILITY SameMajorVersion) + INSTALL(FILES + "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" +- DESTINATION lib/cmake/eclipse-paho-mqtt-c) ++ DESTINATION share/eclipse-paho-mqtt-c) + + # Base64 test + ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) diff --git a/ports/paho-mqtt/fix-static-build.patch b/ports/paho-mqtt/fix-static-build.patch deleted file mode 100644 index 5e6aab04716812..00000000000000 --- a/ports/paho-mqtt/fix-static-build.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 14b94b1..508c5b1 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -65,28 +65,29 @@ ENDIF() - ADD_LIBRARY(common_obj OBJECT ${common_src}) - SET_PROPERTY(TARGET common_obj PROPERTY POSITION_INDEPENDENT_CODE ON) - --ADD_EXECUTABLE(MQTTVersion MQTTVersion.c) -- --ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) --ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c) -- --TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) --TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) -- --TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM}) --SET_TARGET_PROPERTIES( -- paho-mqtt3c paho-mqtt3a PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR}) -- --INSTALL(TARGETS paho-mqtt3c paho-mqtt3a -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) --INSTALL(TARGETS MQTTVersion -- RUNTIME DESTINATION tools/paho-mqtt) -- --IF (PAHO_BUILD_STATIC) -+IF (NOT PAHO_BUILD_STATIC) -+ ADD_EXECUTABLE(MQTTVersion MQTTVersion.c) -+ -+ ADD_LIBRARY(paho-mqtt3c SHARED $ MQTTClient.c) -+ ADD_LIBRARY(paho-mqtt3a SHARED $ MQTTAsync.c) -+ -+ TARGET_LINK_LIBRARIES(paho-mqtt3c ${LIBS_SYSTEM}) -+ TARGET_LINK_LIBRARIES(paho-mqtt3a ${LIBS_SYSTEM}) -+ -+ TARGET_LINK_LIBRARIES(MQTTVersion paho-mqtt3a paho-mqtt3c ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3c paho-mqtt3a PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR}) -+ -+ INSTALL(TARGETS paho-mqtt3c paho-mqtt3a -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ INSTALL(TARGETS MQTTVersion -+ RUNTIME DESTINATION tools/paho-mqtt) -+ELSE() -+ message("Build as static library") - ADD_LIBRARY(paho-mqtt3c-static STATIC $ MQTTClient.c) - ADD_LIBRARY(paho-mqtt3a-static STATIC $ MQTTAsync.c) - -@@ -132,22 +133,24 @@ IF (PAHO_WITH_SSL) - ADD_LIBRARY(common_ssl_obj OBJECT ${common_src}) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY POSITION_INDEPENDENT_CODE ON) - SET_PROPERTY(TARGET common_ssl_obj PROPERTY COMPILE_DEFINITIONS "OPENSSL=1") -- ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -- ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c SSLSocket.c) -- -- TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -- TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -- SET_TARGET_PROPERTIES( -- paho-mqtt3cs paho-mqtt3as PROPERTIES -- VERSION ${CLIENT_VERSION} -- SOVERSION ${PAHO_VERSION_MAJOR} -- COMPILE_DEFINITIONS "OPENSSL=1") -- INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as -- ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -- LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -- -- IF (PAHO_BUILD_STATIC) -+ -+ IF (NOT PAHO_BUILD_STATIC) -+ ADD_LIBRARY(paho-mqtt3cs SHARED $ MQTTClient.c SSLSocket.c) -+ ADD_LIBRARY(paho-mqtt3as SHARED $ MQTTAsync.c SSLSocket.c) -+ -+ TARGET_LINK_LIBRARIES(paho-mqtt3cs ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -+ TARGET_LINK_LIBRARIES(paho-mqtt3as ${OPENSSL_LIB} ${OPENSSLCRYPTO_LIB} ${LIBS_SYSTEM}) -+ SET_TARGET_PROPERTIES( -+ paho-mqtt3cs paho-mqtt3as PROPERTIES -+ VERSION ${CLIENT_VERSION} -+ SOVERSION ${PAHO_VERSION_MAJOR} -+ COMPILE_DEFINITIONS "OPENSSL=1") -+ INSTALL(TARGETS paho-mqtt3cs paho-mqtt3as -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ ELSE() -+ message("Build as static library") - ADD_LIBRARY(paho-mqtt3cs-static STATIC $ MQTTClient.c SSLSocket.c) - ADD_LIBRARY(paho-mqtt3as-static STATIC $ MQTTAsync.c SSLSocket.c) - diff --git a/ports/paho-mqtt/fix-unresolvedsymbol-arm.patch b/ports/paho-mqtt/fix-unresolvedsymbol-arm.patch index 16590188780c65..7726368326ef3d 100644 --- a/ports/paho-mqtt/fix-unresolvedsymbol-arm.patch +++ b/ports/paho-mqtt/fix-unresolvedsymbol-arm.patch @@ -1,12 +1,12 @@ -diff --git a/src/SHA1.c b/src/SHA1.c -index 9bb1175..b2ef930 100644 ---- a/src/SHA1.c -+++ b/src/SHA1.c -@@ -19,6 +19,7 @@ - #if !defined(OPENSSL) - #if defined(WIN32) || defined(WIN64) - #pragma comment(lib, "crypt32.lib") -+#pragma comment(lib, "Advapi32.lib") - - int SHA1_Init(SHA_CTX *c) - { +diff --git a/src/SHA1.c b/src/SHA1.c +index 3ef07d9..f0e82ce 100644 +--- a/src/SHA1.c ++++ b/src/SHA1.c +@@ -19,6 +19,7 @@ + #if !defined(OPENSSL) + #if defined(_WIN32) || defined(_WIN64) + #pragma comment(lib, "crypt32.lib") ++#pragma comment(lib, "Advapi32.lib") + + int SHA1_Init(SHA_CTX *c) + { diff --git a/ports/paho-mqtt/fix-win-macro.patch b/ports/paho-mqtt/fix-win-macro.patch deleted file mode 100644 index 469db3436d4071..00000000000000 --- a/ports/paho-mqtt/fix-win-macro.patch +++ /dev/null @@ -1,79 +0,0 @@ -diff --git a/src/MQTTProperties.h b/src/MQTTProperties.h -index deec124..872032c 100644 ---- a/src/MQTTProperties.h -+++ b/src/MQTTProperties.h -@@ -50,7 +50,7 @@ enum MQTTPropertyCodes { - MQTTPROPERTY_CODE_SHARED_SUBSCRIPTION_AVAILABLE = 42/**< The value is 241 */ - }; - --#if defined(WIN32) || defined(WIN64) -+#if defined(_WIN32) || defined(_WIN64) - #define DLLImport __declspec(dllimport) - #define DLLExport __declspec(dllexport) - #else -diff --git a/src/MQTTAsync.h b/src/MQTTAsync.h -index 1b3593d..04718f8 100644 ---- a/src/MQTTAsync.h -+++ b/src/MQTTAsync.h -@@ -92,7 +92,7 @@ - extern "C" { - #endif - --#if defined(WIN32) || defined(WIN64) -+#if defined(_WIN32) || defined(_WIN64) - #define DLLImport __declspec(dllimport) - #define DLLExport __declspec(dllexport) - #else -@@ -1764,7 +1764,7 @@ int main(int argc, char* argv[]) - "on topic %s for client with ClientID: %s\n", - PAYLOAD, TOPIC, CLIENTID); - while (!finished) -- #if defined(WIN32) || defined(WIN64) -+ #if defined(_WIN32) || defined(_WIN64) - Sleep(100); - #else - usleep(10000L); -@@ -1914,7 +1914,7 @@ int main(int argc, char* argv[]) - } - - while (!subscribed) -- #if defined(WIN32) || defined(WIN64) -+ #if defined(_WIN32) || defined(_WIN64) - Sleep(100); - #else - usleep(10000L); -@@ -1935,7 +1935,7 @@ int main(int argc, char* argv[]) - exit(EXIT_FAILURE); - } - while (!disc_finished) -- #if defined(WIN32) || defined(WIN64) -+ #if defined(_WIN32) || defined(_WIN64) - Sleep(100); - #else - usleep(10000L); -diff --git a/src/MQTTClient.h b/src/MQTTClient.h -index b3fadbe..130b804 100644 ---- a/src/MQTTClient.h -+++ b/src/MQTTClient.h -@@ -110,7 +110,7 @@ - extern "C" { - #endif - --#if defined(WIN32) || defined(WIN64) -+#if defined(_WIN32) || defined(_WIN64) - #define DLLImport __declspec(dllimport) - #define DLLExport __declspec(dllexport) - #else -diff --git a/src/MQTTReasonCodes.h b/src/MQTTReasonCodes.h -index 369543b..38c299b 100644 ---- a/src/MQTTReasonCodes.h -+++ b/src/MQTTReasonCodes.h -@@ -66,7 +66,7 @@ enum MQTTReasonCodes { - MQTTREASONCODE_WILDCARD_SUBSCRIPTIONS_NOT_SUPPORTED = 162 - }; - --#if defined(WIN32) || defined(WIN64) -+#if defined(_WIN32) || defined(_WIN64) - #define DLLImport __declspec(dllimport) - #define DLLExport __declspec(dllexport) - #else diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index 33107e31607d17..0432bd1d0e866a 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -1,16 +1,13 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO eclipse/paho.mqtt.c - REF d34c51214f4172f2e12bb17532c9f44f72a57dd4 # v1.3.1 - SHA512 184a8ace64bb967c63ac11a2476e6753d7aad39f93b290be030356841a8891edec6e0ac4b925089f2234a56f6da9c09c1a92023d3883fa785d986342bfee3972 + REF 153dfd3a4a1d510697c5d55e169fa158db16e04a # v1.3.5 + SHA512 231978c9159b85f4b189574bfe982d99ef75aabbb616bf88f251e4fe1797fd89156b4090c6d7e05703fe9394b3243a906196cb54dab3044727b03bbc64a63e5b HEAD_REF master PATCHES remove_compiler_options.patch fix-install-path.patch - fix-static-build.patch fix-unresolvedsymbol-arm.patch - export-cmake-targets.patch - fix-win-macro.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAHO_BUILD_STATIC) @@ -30,5 +27,5 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(RENAME ${CURRENT_PACKAGES_DIR}/share/paho-mqtt/README.md ${CURRENT_PACKAGES_DIR}/share/${PORT}/readme) +file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/paho-mqtt/remove_compiler_options.patch b/ports/paho-mqtt/remove_compiler_options.patch index 60bf370ce4532c..a1193fee87745b 100644 --- a/ports/paho-mqtt/remove_compiler_options.patch +++ b/ports/paho-mqtt/remove_compiler_options.patch @@ -1,9 +1,9 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index be8d2e8..418e2f2 100644 +index 531c39c..3df385a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -37,7 +37,7 @@ STRING(TIMESTAMP BUILD_TIMESTAMP UTC) - MESSAGE(STATUS "Timestamp is ${BUILD_TIMESTAMP}") +@@ -41,7 +41,7 @@ IF (PAHO_HIGH_PERFORMANCE) + ENDIF() IF(WIN32) - ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD) From 230adcdedb246b83b18b855fe4856e85763f6572 Mon Sep 17 00:00:00 2001 From: wangli28 Date: Wed, 4 Nov 2020 10:04:36 +0000 Subject: [PATCH 2/8] [paho-mqtt] Fix build error --- ports/paho-mqtt/portfile.cmake | 6 +++++- ports/paho-mqttpp3/CONTROL | 1 + ports/paho-mqttpp3/fix-dependency.patch | 12 +++++------- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index 0432bd1d0e866a..d5123da8f1771a 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -25,7 +25,11 @@ vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH share/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c) vcpkg_copy_pdbs() -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +endif() file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) diff --git a/ports/paho-mqttpp3/CONTROL b/ports/paho-mqttpp3/CONTROL index 601358fcf90858..346528534f7347 100644 --- a/ports/paho-mqttpp3/CONTROL +++ b/ports/paho-mqttpp3/CONTROL @@ -1,5 +1,6 @@ Source: paho-mqttpp3 Version: 1.1 +Port-Version: 1 Homepage: https://github.com/eclipse/paho.mqtt.cpp Description: Paho project provides open-source C++ wrapper for Paho C library Build-Depends: paho-mqtt diff --git a/ports/paho-mqttpp3/fix-dependency.patch b/ports/paho-mqttpp3/fix-dependency.patch index a19644d861d63b..204bb34372a554 100644 --- a/ports/paho-mqttpp3/fix-dependency.patch +++ b/ports/paho-mqttpp3/fix-dependency.patch @@ -23,7 +23,7 @@ index aff9472..275655c 100644 include("${CMAKE_CURRENT_LIST_DIR}/@package_name@Targets.cmake") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 4e9b7c4..bd1e0a5 100644 +index 4e9b7c4..93eaae9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -23,7 +23,7 @@ @@ -35,16 +35,13 @@ index 4e9b7c4..bd1e0a5 100644 # --- The headers --- -@@ -76,17 +76,23 @@ target_include_directories(paho-cpp-objs - src - ) - -- +@@ -80,13 +80,21 @@ target_include_directories(paho-cpp-objs ## --- Build the shared library, if requested --- if(PAHO_BUILD_SHARED) + ## set PAHO_C_LIB + if(PAHO_WITH_SSL) ++ find_package(OpenSSL REQUIRED) + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs) + else() + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c) @@ -61,13 +58,14 @@ index 4e9b7c4..bd1e0a5 100644 # It would be nice to exort the include paths from the obj lib, but we # get an export error. Perhaps in a future version? -@@ -118,13 +124,21 @@ endif() +@@ -118,13 +126,22 @@ endif() ## --- Build static version of the library, if requested --- if(PAHO_BUILD_STATIC) + + ## set PAHO_C_LIB + if(PAHO_WITH_SSL) ++ find_package(OpenSSL REQUIRED) + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static) + else() + set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static) From d3ec5a3230d4444881f56d345addeaf94ab2991c Mon Sep 17 00:00:00 2001 From: wangli28 Date: Thu, 5 Nov 2020 08:32:37 +0000 Subject: [PATCH 3/8] [paho-mqttpp3] Fix build error --- ports/paho-mqttpp3/fix-dependency.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/paho-mqttpp3/fix-dependency.patch b/ports/paho-mqttpp3/fix-dependency.patch index 204bb34372a554..aadd1319202b7b 100644 --- a/ports/paho-mqttpp3/fix-dependency.patch +++ b/ports/paho-mqttpp3/fix-dependency.patch @@ -66,9 +66,9 @@ index 4e9b7c4..93eaae9 100644 + ## set PAHO_C_LIB + if(PAHO_WITH_SSL) + find_package(OpenSSL REQUIRED) -+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs) + else() -+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c) + endif() + ## create the static library From ce2ee9f75b7c95486fb227e4356ae62ef311b60f Mon Sep 17 00:00:00 2001 From: wangli28 Date: Thu, 5 Nov 2020 09:41:12 +0000 Subject: [PATCH 4/8] [paho-mqttpp3] Fix build error --- ports/paho-mqtt/portfile.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index d5123da8f1771a..a0d652344a0f8a 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -11,12 +11,14 @@ vcpkg_from_github( ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAHO_BUILD_STATIC) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" PAHO_BUILD_DYNAMIC) vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DPAHO_WITH_SSL=TRUE + -DPAHO_BUILD_SHARED=${PAHO_BUILD_DYNAMIC} -DPAHO_BUILD_STATIC=${PAHO_BUILD_STATIC} -DPAHO_ENABLE_TESTING=FALSE ) From 570d20b92c08dfffcab9ea7a29128eb59340b3ae Mon Sep 17 00:00:00 2001 From: wangli28 Date: Thu, 5 Nov 2020 10:06:18 +0000 Subject: [PATCH 5/8] [paho-mqttpp3] Fix build error --- ports/paho-mqttpp3/fix-dependency.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/paho-mqttpp3/fix-dependency.patch b/ports/paho-mqttpp3/fix-dependency.patch index aadd1319202b7b..204bb34372a554 100644 --- a/ports/paho-mqttpp3/fix-dependency.patch +++ b/ports/paho-mqttpp3/fix-dependency.patch @@ -66,9 +66,9 @@ index 4e9b7c4..93eaae9 100644 + ## set PAHO_C_LIB + if(PAHO_WITH_SSL) + find_package(OpenSSL REQUIRED) -+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static) + else() -+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c) ++ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static) + endif() + ## create the static library From fb6f2504634a7e914a32156c0158fd5d408a7ade Mon Sep 17 00:00:00 2001 From: wangli28 Date: Mon, 9 Nov 2020 09:12:35 +0000 Subject: [PATCH 6/8] [paho-mqtt] Fix old patch --- ports/paho-mqtt/fix-install-path.patch | 18 ------------------ ports/paho-mqtt/portfile.cmake | 6 +----- 2 files changed, 1 insertion(+), 23 deletions(-) diff --git a/ports/paho-mqtt/fix-install-path.patch b/ports/paho-mqtt/fix-install-path.patch index 749d280aacef8a..086791b1a34352 100644 --- a/ports/paho-mqtt/fix-install-path.patch +++ b/ports/paho-mqtt/fix-install-path.patch @@ -35,21 +35,3 @@ index 20b578a..75dc833 100644 IF (PAHO_WITH_SSL) SET(OPENSSL_ROOT_DIR "" CACHE PATH "Directory containing OpenSSL libraries and includes") -@@ -306,7 +306,7 @@ ENDIF() - INSTALL(EXPORT eclipse-paho-mqtt-cTargets - FILE eclipse-paho-mqtt-cConfig.cmake - NAMESPACE eclipse-paho-mqtt-c:: -- DESTINATION lib/cmake/eclipse-paho-mqtt-c) -+ DESTINATION share/eclipse-paho-mqtt-c) - - INCLUDE(CMakePackageConfigHelpers) - WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" -@@ -314,7 +314,7 @@ WRITE_BASIC_PACKAGE_VERSION_FILE("eclipse-paho-mqtt-cConfigVersion.cmake" - COMPATIBILITY SameMajorVersion) - INSTALL(FILES - "${CMAKE_CURRENT_BINARY_DIR}/eclipse-paho-mqtt-cConfigVersion.cmake" -- DESTINATION lib/cmake/eclipse-paho-mqtt-c) -+ DESTINATION share/eclipse-paho-mqtt-c) - - # Base64 test - ADD_EXECUTABLE( Base64Test EXCLUDE_FROM_ALL Base64.c Base64.h ) diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index a0d652344a0f8a..019f09749f9da7 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -24,14 +24,10 @@ vcpkg_configure_cmake( ) vcpkg_install_cmake() -vcpkg_fixup_cmake_targets(CONFIG_PATH share/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c) +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c) vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() - file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) From 58a2de05e746e1b476c22cf93aa90cee825f6650 Mon Sep 17 00:00:00 2001 From: wangli28 Date: Mon, 9 Nov 2020 09:48:21 +0000 Subject: [PATCH 7/8] [paho-mqtt] Add vcpkg_copy_tools --- ports/paho-mqtt/fix-install-path.patch | 9 --------- ports/paho-mqtt/portfile.cmake | 1 + 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/ports/paho-mqtt/fix-install-path.patch b/ports/paho-mqtt/fix-install-path.patch index 086791b1a34352..06bf396a92ea61 100644 --- a/ports/paho-mqtt/fix-install-path.patch +++ b/ports/paho-mqtt/fix-install-path.patch @@ -17,15 +17,6 @@ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 20b578a..75dc833 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -142,7 +142,7 @@ IF (PAHO_BUILD_SHARED) - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - INSTALL(TARGETS MQTTVersion -- RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ RUNTIME DESTINATION tools/paho-mqtt) - ENDIF() - - IF (PAHO_BUILD_STATIC) @@ -183,7 +183,7 @@ IF (PAHO_BUILD_STATIC) ENDIF() diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index 019f09749f9da7..3ee8ae8244fbf0 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -26,6 +26,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c) vcpkg_copy_pdbs() +vcpkg_copy_tools(TOOL_NAMES MQTTVersion AUTO_CLEAN) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") From 894e0f68c80f7e7c85d114b4d3ac2186b828d76b Mon Sep 17 00:00:00 2001 From: wangli28 Date: Mon, 9 Nov 2020 09:55:31 +0000 Subject: [PATCH 8/8] [paho-mqtt] Fix build error --- ports/paho-mqtt/portfile.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake index 3ee8ae8244fbf0..7a451aca8c428d 100644 --- a/ports/paho-mqtt/portfile.cmake +++ b/ports/paho-mqtt/portfile.cmake @@ -26,7 +26,10 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/eclipse-paho-mqtt-c TARGET_PATH share/eclipse-paho-mqtt-c) vcpkg_copy_pdbs() -vcpkg_copy_tools(TOOL_NAMES MQTTVersion AUTO_CLEAN) + +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_copy_tools(TOOL_NAMES MQTTVersion AUTO_CLEAN) +endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")