paho.mqtt.c: Update to 1.3.0

This commit is contained in:
Alexey Pavlov
2019-07-08 11:30:19 +03:00
parent a53c5716c6
commit f35f8293c3
3 changed files with 42 additions and 20 deletions

View File

@@ -1,12 +0,0 @@
--- origsrc/paho.mqtt.c-1.1.0/src/CMakeLists.txt 2016-06-20 01:00:10.000000000 +0200
+++ src/paho.mqtt.c-1.1.0/src/CMakeLists.txt 2016-10-16 21:08:35.069400000 +0200
@@ -65,7 +65,8 @@
SOVERSION ${PAHO_VERSION_MAJOR})
INSTALL(TARGETS paho-mqtt3c paho-mqtt3a MQTTVersion
RUNTIME DESTINATION bin
- LIBRARY DESTINATION lib)
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
INSTALL(FILES MQTTAsync.h MQTTClient.h MQTTClientPersistence.h
DESTINATION include)

View File

@@ -0,0 +1,30 @@
--- paho.mqtt.c-1.3.0/src/CMakeLists.txt.orig 2019-07-08 11:09:47.589051500 +0300
+++ paho.mqtt.c-1.3.0/src/CMakeLists.txt 2019-07-08 11:10:03.139073200 +0300
@@ -55,7 +55,7 @@
)
IF (WIN32)
- SET(LIBS_SYSTEM ws2_32)
+ SET(LIBS_SYSTEM ws2_32 rpcrt4 crypt32)
ELSEIF (UNIX)
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
SET(LIBS_SYSTEM c dl pthread)
--- paho.mqtt.c-1.3.0/src/WebSocket.c.orig 2019-07-08 11:19:09.467968000 +0300
+++ paho.mqtt.c-1.3.0/src/WebSocket.c 2019-07-08 11:19:48.539022800 +0300
@@ -47,10 +47,15 @@
# if BYTE_ORDER == LITTLE_ENDIAN
# define htobe16(x) htons(x)
# define htobe32(x) htonl(x)
+#if defined(WIN32)
+# define htobe64(x) ((1==htonl(1)) ? (x) : ((uint64_t)htonl((x) & 0xFFFFFFFF) << 32) | htonl((x) >> 32))
+# define be64toh(x) ((1==ntohl(1)) ? (x) : ((uint64_t)ntohl((x) & 0xFFFFFFFF) << 32) | ntohl((x) >> 32))
+#else
# define htobe64(x) htonll(x)
+# define be64toh(x) ntohll(x)
+#endif
# define be16toh(x) ntohs(x)
# define be32toh(x) ntohl(x)
-# define be64toh(x) ntohll(x)
# elif BTYE_ORDER == BIG_ENDIAN
# define htobe16(x) (x)
# define htobe32(x) (x)

View File

@@ -3,7 +3,7 @@
_realname=paho.mqtt.c
pkgbase=mingw-w64-${_realname}
pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}")
pkgver=1.1.0
pkgver=1.3.0
pkgrel=1
pkgdesc="Eclipse Paho MQTT C client (mingw-w64)"
arch=('any')
@@ -12,20 +12,21 @@ license=('EPL/EDL')
makedepends=("${MINGW_PACKAGE_PREFIX}-cmake")
options=('strip' 'staticlibs')
source=("${_realname}-${pkgver}.tar.gz"::"https://github.com/eclipse/${_realname}/archive/v${pkgver}.tar.gz"
"0001-CMakeLists.patch")
sha256sums=('970b9621efc24251441d386274cd0a90cf6ad52b64031f3c8cb53fdd5526f5f3'
'4163cf0db590d39f5b86aa54a0e5331b7e7e374e796748d6df78c8be30ceaf83')
002-fix-build.patch)
sha256sums=('87cf846b02dde6328b84832287d8725d91f12f41366eecb4d59eeda1d6c7efdf'
'016b8a1f7716bd2b916ac54afed349e4943b1c682870c9997aa155b8c7805e72')
prepare() {
cd "$srcdir"/${_realname}-${pkgver}
patch -p2 -i ${srcdir}/0001-CMakeLists.patch
cd "${srcdir}"/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/002-fix-build.patch
}
build() {
cd "$srcdir"/${_realname}-${pkgver}
[[ -d "${srcdir}"/build-${CARCH} ]] && rm -rf "${srcdir}"/build-${CARCH}
mkdir -p "${srcdir}"/build-${CARCH} && cd "${srcdir}"/build-${CARCH}
CFLAGS+=" -D_WINDOWS"
CXXFLAGS+=" -D_WINDOWS"
declare -a extra_config
if check_option "debug" "n"; then
extra_config+=("-DCMAKE_BUILD_TYPE=Release")
@@ -38,7 +39,9 @@ build() {
-G'MSYS Makefiles' \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
"${extra_config[@]}" \
-DBUILD_{SHARED,STATIC}_LIBS=ON \
-DPAHO_BUILD_STATIC=ON \
-DPAHO_WITH_SSL=OFF \
-DPAHO_ENABLE_CPACK=OFF \
../${_realname}-${pkgver}
make
@@ -51,4 +54,5 @@ check() {
package() {
cd "${srcdir}"/build-${CARCH}
make install DESTDIR="${pkgdir}"
install -Dm644 "${srcdir}"/${_realname}-${pkgver}/LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE
}