From ebe61bb7b8d7ecc11b3258747c80863f02084f74 Mon Sep 17 00:00:00 2001 From: Altyrost <62396120+Altyrost@users.noreply.github.com> Date: Sat, 28 Oct 2023 07:06:59 +0200 Subject: [PATCH] add pahomqttc package (#2762) --- packages/p/pahomqttc/xmake.lua | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 packages/p/pahomqttc/xmake.lua diff --git a/packages/p/pahomqttc/xmake.lua b/packages/p/pahomqttc/xmake.lua new file mode 100644 index 000000000..d5e740fbd --- /dev/null +++ b/packages/p/pahomqttc/xmake.lua @@ -0,0 +1,25 @@ +package("pahomqttc") + set_homepage("https://github.com/eclipse/paho.mqtt.c") + set_description("Eclipse Paho MQTT C Client Library") + set_license("MIT") + + add_urls("https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/$(version).zip", + "https://github.com/eclipse/paho.mqtt.c.git") + + add_versions("v1.3.13", "5ba7c7ab7ebb1499938fa2e358e6c1f9a926b270f2bf082acf89d59b4771a132") + + add_deps("cmake") + + on_install("windows", "linux", "macosx", function (package) + local configs = {"-DPAHO_BUILD_SAMPLES=FALSE", + "-DPAHO_WITH_SSL=FALSE", + "-DPAHO_BUILD_DOCUMENTATION=FALSE"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("MQTTClient_connect", {includes = "MQTTClient.h"})) + end) +package_end() \ No newline at end of file