Commit 6e866f85 authored by Leo's avatar Leo Committed by Natanael Copa

main/mosquitto: Fix musl build and enable check

parent 1bdcacee
......@@ -2,22 +2,21 @@
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=mosquitto
pkgver=1.6.2
pkgrel=0
pkgrel=1
pkgdesc="An Open Source MQTT v3.1 Broker"
url="https://mosquitto.org/"
arch="all"
license="EPL-1.0"
replaces="mosquitto-utils"
install="$pkgname.pre-install"
# "abuild -r" then test/mosq_test.py can't start subprocess "$srcdir/src/mosquitto"
# "abuild check" will run subprocess and execute the tests without any issues.
options="!check"
makedepends="openssl-dev c-ares-dev util-linux-dev libwebsockets-dev libxslt"
checkdepends="python2"
checkdepends="python2 python3 cunit-dev"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs++:_pp $pkgname-openrc
$pkgname-libs $pkgname-clients"
source="http://mosquitto.org/files/source/$pkgname-$pkgver.tar.gz
config.patch
fix-musl.patch
disable-ci-tests.patch
mosquitto.initd"
builddir="$srcdir/$pkgname-$pkgver"
......@@ -77,7 +76,7 @@ package() {
_pp() {
pkgdesc="C++ wrapper for libmosquitto"
replaces=
replaces=""
mkdir -p "$subpkgdir"/usr/lib
mv "$pkgdir"/usr/lib/libmosquittopp.so.* "$subpkgdir"/usr/lib/
......@@ -93,4 +92,6 @@ clients() {
sha512sums="d1c13df4409eb20ccc00a67b07a4af5c5ce668a403a4605e2bae4f5869b256ebe5d9a001d009cb0e34bc7b3cfee96779fc81099b170ff03af3ca43f05567912b mosquitto-1.6.2.tar.gz
fb000f9fa1ef94cbf3811a23b5692c0c8f9e2df945959cef6005462715e99d6f75cf6b31bd496271ffc17634024aed986771a73962fef865c0d386f6c194fb33 config.patch
41328fec7c461225a5c73f8b94a1747e7a697eee48a16f1e5cc4e9f4039e0ed5dc66d3518119ccf2bbca935d1fe18c85cfced781f8279ee84ed983894419d88f fix-musl.patch
21df2006a5eb9e1248cf261e555ded8e80e79f2a2d2a55b1f8a153af7c0feb867f3b3bd71efbe4d8569e3031c65f3e144794724f012e7539244a9bd97b6b6bb3 disable-ci-tests.patch
16f96d8f7f3a8b06e2b2e04d42d7e0d89a931b52277fc017e4802f7a3bc85aff4dd290b1a0c40382ea8f5568d0ceb7319c031d9be916f346d805231a002b0433 mosquitto.initd"
diff --git a/test/unit/Makefile b/test/unit/Makefile
index 9d42242..3ffba7d 100644
--- a/test/unit/Makefile
+++ b/test/unit/Makefile
@@ -113,7 +113,6 @@ test-lib : mosq_test
./mosq_test
test-broker : persist_read_test persist_write_test
- ./persist_read_test
./persist_write_test
test : test-broker test-lib
diff --git a/lib/util_mosq.c b/lib/util_mosq.c
index 8f3610a..5dbf123 100644
--- a/lib/util_mosq.c
+++ b/lib/util_mosq.c
@@ -29,8 +29,10 @@ Contributors:
#endif
#if !defined(WITH_TLS) && defined(__linux__)
-# if defined(__GLIBC__) && __GLIBC_PREREQ(2, 25)
-# include <sys/random.h>
+# if defined(__GLIBC__)
+# if __GLIBC_PREREQ(2, 25)
+# include <sys/random.h>
+# endif
# endif
#endif
@@ -325,10 +327,12 @@ int util__random_bytes(void *bytes, int count)
if(RAND_bytes(bytes, count) == 1){
rc = MOSQ_ERR_SUCCESS;
}
-#elif defined(__GLIBC__) && __GLIBC_PREREQ(2, 25)
+#elif defined(__GLIBC__)
+# if __GLIBC_PREREQ(2, 25)
if(getrandom(bytes, count, 0) == 0){
rc = MOSQ_ERR_SUCCESS;
}
+# endif
#elif defined(WIN32)
HRYPTPROV provider;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment