aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2017-09-04 01:35:01 -0700
committerGitHub <noreply@github.com>2017-09-04 01:35:01 -0700
commit41fa09af2035f795784f4e1e33fba58c4adeb6e5 (patch)
tree92f8ff54fc708f212a6a7133a6d8fc0287787486
parent309fa56fd4454bbcb68b2e9ba67b1e30f7ccc120 (diff)
parent1f5740e33b90662d0f7b0391ee9a63004d342a7d (diff)
downloadvcpkg-41fa09af2035f795784f4e1e33fba58c4adeb6e5.tar.gz
vcpkg-41fa09af2035f795784f4e1e33fba58c4adeb6e5.zip
Merge pull request #1772 from atkawa7/paho-mqqt-update
[paho-mqtt] update
-rw-r--r--ports/paho-mqtt/CONTROL2
-rw-r--r--ports/paho-mqtt/disable_tests.patch16
-rw-r--r--ports/paho-mqtt/portfile.cmake64
-rw-r--r--ports/paho-mqtt/remove_compiler_options.patch13
4 files changed, 71 insertions, 24 deletions
diff --git a/ports/paho-mqtt/CONTROL b/ports/paho-mqtt/CONTROL
index 7981a5195..8c751a868 100644
--- a/ports/paho-mqtt/CONTROL
+++ b/ports/paho-mqtt/CONTROL
@@ -1,4 +1,4 @@
Source: paho-mqtt
-Version: Version 1.1.0 (Paho 1.2)
+Version: 1.2.0
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/disable_tests.patch b/ports/paho-mqtt/disable_tests.patch
new file mode 100644
index 000000000..ed9a644ff
--- /dev/null
+++ b/ports/paho-mqtt/disable_tests.patch
@@ -0,0 +1,16 @@
+diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
+index c041df0..2feb580 100644
+--- "a/CMakeLists.txt"
++++ "b/CMakeLists.txt"
+@@ -94,7 +94,10 @@ SET(CPACK_PACKAGE_VERSION_MINOR ${PAHO_VERSION_MINOR})
+ SET(CPACK_PACKAGE_VERSION_PATCH ${PAHO_VERSION_PATCH})
+ INCLUDE(CPack)
+
++if(BUILD_TESTS)
+ ENABLE_TESTING()
+
+ INCLUDE_DIRECTORIES(test src)
+ ADD_SUBDIRECTORY(test)
++
++endif()
+\ No newline at end of file
diff --git a/ports/paho-mqtt/portfile.cmake b/ports/paho-mqtt/portfile.cmake
index 5fc6341f8..6e50f1238 100644
--- a/ports/paho-mqtt/portfile.cmake
+++ b/ports/paho-mqtt/portfile.cmake
@@ -1,56 +1,74 @@
include(vcpkg_common_functions)
vcpkg_from_github(
- OUT_SOURCE_PATH SOURCE_PATH
- REPO eclipse/paho.mqtt.c
- REF v1.1.0
- SHA512 49eebf258e15076048103ff79442ad0d21164b83f713eee7f226998106b5931d310871d3b372322d5ef1cb2801219a6e626400b6fe4198814150a6277d6bfd74
- HEAD_REF master
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO eclipse/paho.mqtt.c
+ REF v1.2.0
+ SHA512 ffad01a8f9f41049dd008e163136e4ecb8c7c51f7b49917201593b0844b15a8d2a413ddec06fa5b2d77e432f0603b71664a23afbb7c215121cebd7d419ccacfa
+ HEAD_REF master
+)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" PAHO_BUILD_STATIC)
+
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/disable_tests.patch"
+ "${CMAKE_CURRENT_LIST_DIR}/remove_compiler_options.patch"
)
vcpkg_configure_cmake(
- SOURCE_PATH ${SOURCE_PATH}
- OPTIONS -DPAHO_WITH_SSL=TRUE
+ SOURCE_PATH ${SOURCE_PATH}
+ OPTIONS -DPAHO_WITH_SSL=TRUE -DPAHO_BUILD_STATIC=${PAHO_BUILD_STATIC}
)
vcpkg_build_cmake()
file(GLOB DLLS
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.dll"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.dll"
)
file(GLOB LIBS
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.lib"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/Release/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/*/Release/*.lib"
)
file(GLOB DEBUG_DLLS
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.dll"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.dll"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.dll"
)
file(GLOB DEBUG_LIBS
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.lib"
- "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/Debug/*.lib"
+ "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/*/Debug/*.lib"
)
file(GLOB HEADERS "${SOURCE_PATH}/*/*.h")
if(DLLS)
- file(INSTALL ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
+ file(INSTALL ${DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/bin)
endif()
file(INSTALL ${LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
if(DEBUG_DLLS)
- file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
+ file(INSTALL ${DEBUG_DLLS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
file(INSTALL ${DEBUG_LIBS} DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
file(INSTALL ${HEADERS} DESTINATION ${CURRENT_PACKAGES_DIR}/include)
vcpkg_copy_pdbs()
+if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
+ foreach(libname paho-mqtt3as-static paho-mqtt3cs-static paho-mqtt3a-static paho-mqtt3c-static)
+ foreach(foldername "lib" "debug/lib")
+ string(REPLACE "-static" "" outlibname ${libname})
+ file(RENAME ${CURRENT_PACKAGES_DIR}/${foldername}/${libname}.lib ${CURRENT_PACKAGES_DIR}/${foldername}/${outlibname}.lib)
+ endforeach()
+ endforeach()
+endif()
-file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/paho-mqtt RENAME copyright)
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(INSTALL ${SOURCE_PATH}/about.html DESTINATION ${CURRENT_PACKAGES_DIR}/share/paho-mqtt RENAME copyright)
diff --git a/ports/paho-mqtt/remove_compiler_options.patch b/ports/paho-mqtt/remove_compiler_options.patch
new file mode 100644
index 000000000..256d07a8f
--- /dev/null
+++ b/ports/paho-mqtt/remove_compiler_options.patch
@@ -0,0 +1,13 @@
+diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
+index 2feb580..796d08e 100644
+--- "a/CMakeLists.txt"
++++ "b/CMakeLists.txt"
+@@ -55,7 +55,7 @@ IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
+ ENDIF()
+
+ IF(WIN32)
+- ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN -MD)
++ ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -DWIN32_LEAN_AND_MEAN)
+ ELSEIF(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
+ ADD_DEFINITIONS(-DOSX)
+ ENDIF()