diff options
author | Giuseppe Foti <foti.giuseppe@gmail.com> | 2023-08-23 09:40:51 +0200 |
---|---|---|
committer | Florian Schmaus <flow@gentoo.org> | 2023-08-23 10:49:17 +0200 |
commit | ca3e2c4f7d9c947c21ab6be1d5e7d073da93af55 (patch) | |
tree | b3c46698439b38b7c0e3a5644febadde8670b764 /net-libs/paho-mqtt-c | |
parent | sys-fs/lvm2: add 2.03.22 (diff) | |
download | gentoo-ca3e2c4f7d9c947c21ab6be1d5e7d073da93af55.tar.gz gentoo-ca3e2c4f7d9c947c21ab6be1d5e7d073da93af55.tar.bz2 gentoo-ca3e2c4f7d9c947c21ab6be1d5e7d073da93af55.zip |
Rename {dev-libs → net-libs}/paho-mqtt-c
Signed-off-by: Giuseppe Foti <foti.giuseppe@gmail.com>
Signed-off-by: Florian Schmaus <flow@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/32418
Diffstat (limited to 'net-libs/paho-mqtt-c')
-rw-r--r-- | net-libs/paho-mqtt-c/Manifest | 3 | ||||
-rw-r--r-- | net-libs/paho-mqtt-c/metadata.xml | 23 | ||||
-rw-r--r-- | net-libs/paho-mqtt-c/paho-mqtt-c-1.3.12.ebuild | 102 |
3 files changed, 128 insertions, 0 deletions
diff --git a/net-libs/paho-mqtt-c/Manifest b/net-libs/paho-mqtt-c/Manifest new file mode 100644 index 000000000000..aaf25ad26fc3 --- /dev/null +++ b/net-libs/paho-mqtt-c/Manifest @@ -0,0 +1,3 @@ +DIST paho-mqtt-c-1.3.12-live.tar.gz 3642676 BLAKE2B c20e3bb1b4eae30b268639d30c1e4d72f6759850bef2dc13de424debb7a0785a5ba083af094e28cb80814df519831ac0e1da27d8aa4958361724aabea92c03e5 SHA512 af0f52944c46fe7874203b3b359d8fb8935d5bd6b394045138624b96130c6b756045fb3b486e224b7e55b3cb478197b8a049bbeb01ff7e3d16d0d3f12c521110 +DIST paho-mqtt-c-1.3.12.tar.gz 3622938 BLAKE2B 9eb7bca0367a3001f00122f2056b60ddf3633e0304661a424821c3e2b3370d65e09c51c62f90bb89f0e4ce291640e71ae0d3b093fe600efb87aa3744e431cafe SHA512 3152b557a8ab7c9b9c80277283e0f5e9965ce4c2ebbdaef0f238908d49e6fa1281aa72932ea112a836144b79656e4abe6e0cbd93840429a52e501a2c6b12d313 +DIST paho.mqtt.testing.tar.gz 175845 BLAKE2B 02c284c4e1cfe91bb87735e8fc61f206c3e93adf18c567ff330ae8d1c2bd04b7aa079ba3961610b7c9cc7e22340be000bf56772d5c39d1bc4d1b406bf564da66 SHA512 8328c6a010d76cf62ee2007a849acb61b84cf2dc058525bc967661984fdf26407dd52da83a3f2acda56e3c5d309301ea2a8ed264466d0fb933994dd248dbbe8d diff --git a/net-libs/paho-mqtt-c/metadata.xml b/net-libs/paho-mqtt-c/metadata.xml new file mode 100644 index 000000000000..b2e9b98f3ec3 --- /dev/null +++ b/net-libs/paho-mqtt-c/metadata.xml @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>foti.giuseppe@gmail.com</email> + <name>Giuseppe Foti</name> + </maintainer> + <maintainer type="project" proxied="proxy"> + <email>proxy-maint@gentoo.org</email> + <name>Proxy Maintainers</name> + </maintainer> + <use> + <flag name="high-performance"> + The debugging aids internal tracing and heap tracking are not included + </flag> + </use> + <longdescription lang="en"> + These libraries enable applications to connect to an MQTT broker to publish messages, and to subscribe to topics and receive published messages. + </longdescription> + <upstream> + <remote-id type="github">eclipse/paho.mqtt.c</remote-id> + </upstream> +</pkgmetadata> diff --git a/net-libs/paho-mqtt-c/paho-mqtt-c-1.3.12.ebuild b/net-libs/paho-mqtt-c/paho-mqtt-c-1.3.12.ebuild new file mode 100644 index 000000000000..e417fe9118a4 --- /dev/null +++ b/net-libs/paho-mqtt-c/paho-mqtt-c-1.3.12.ebuild @@ -0,0 +1,102 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +PYTHON_COMPAT=( python3_{10..11} ) + +inherit cmake python-any-r1 toolchain-funcs + +MY_TEST_UTILS="paho.mqtt.testing" +MY_TEST_COMMIT="577f955352e41205c554d44966c2908e90026345" +MY_LIVE_COMMIT="7db21329301b1f527c925dff789442db3ca3c1e7" + +DESCRIPTION="An Eclipse Paho C client library for MQTT for Windows, Linux and MacOS." +HOMEPAGE="https://eclipse.org/paho" +SRC_URI=" + https://github.com/eclipse/paho.mqtt.c/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz + https://github.com/eclipse/paho.mqtt.c/archive/${MY_LIVE_COMMIT}.tar.gz -> ${P}-live.tar.gz + https://github.com/eclipse/${MY_TEST_UTILS}/archive/${MY_TEST_COMMIT}.tar.gz -> ${MY_TEST_UTILS}.tar.gz +" + +LICENSE="EPL-2.0" +SLOT="1.3" +KEYWORDS="~amd64 ~x86" +IUSE="doc examples +high-performance +ssl test" + +BDEPEND=" + doc? ( app-doc/doxygen + media-gfx/graphviz ) + ssl? ( dev-libs/openssl ) + test? ( dev-lang/python ) +" + +# Tests can be run only if a MQTT broker is available +RESTRICT="!test? ( test )" + +S="${WORKDIR}/paho.mqtt.c-${PV}" + +BUILD_DIR="${S}_build" + +src_prepare(){ + cmake_src_prepare + if use test; then + # removing old certs + rm -r "${S}"/test/ssl || die + mv "${WORKDIR}"/paho.mqtt.c-"${MY_LIVE_COMMIT}"/test/ssl "${S}"/test/ssl || die + + mv "${WORKDIR}/${MY_TEST_UTILS}-${MY_TEST_COMMIT}" "${WORKDIR}/${MY_TEST_UTILS}" || die + fi +} + +src_configure(){ + local mycmakeargs=( + -DPAHO_BUILD_SHARED=TRUE + -DPAHO_HIGH_PERFORMANCE="$(usex high-performance "TRUE" "FALSE")" + -DPAHO_WITH_SSL="$(usex ssl "TRUE" "FALSE")" + -DPAHO_BUILD_DOCUMENTATION="$(usex doc "TRUE" "FALSE")" + -DPAHO_BUILD_SAMPLES="$(usex examples "TRUE" "FALSE")" + -DPAHO_ENABLE_TESTING="$(usex test "TRUE" "FALSE")" + ) + cmake_src_configure +} + +src_test() { + if tc-is-cross-compiler; then + elog "Disabling tests due to crosscompiling." + return + fi + + cd "${WORKDIR}/${MY_TEST_UTILS}/interoperability" || die + + ${EPYTHON} startbroker.py -c localhost_testing.conf \ + > "${T}/testbroker.log" & + local -r startbroker_pid=$! + + ${EPYTHON} "${S}"/test/mqttsas.py \ + > "${T}/testmqttsas.log" & + local -r mqttsas_pid=$! + + local port ports + ports=(1883 1888{3..8}) + + for port in ${ports[@]}; do + einfo "Waiting for TCP port ${port} to become available" + if timeout 30 bash -c \ + 'until printf "" >/dev/tcp/${0}/${1} 2>> "${T}/portlog"; do sleep 1; done' \ + localhost "${port}"; then + continue + fi + + kill ${startbroker_pid} ${mqttsas_pid} + die "Timeout waiting for port ${port} to become available" + done + + local myctestargs=( + -j 1 + --timeout 600 + ) + cmake_src_test + + kill ${startbroker_pid} ${mqttsas_pid} || die +} |