aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Engberg <diizzy@FreeBSD.org>2026-08-19 20:49:00 +0000
committerDaniel Engberg <diizzy@FreeBSD.org>2026-08-20 19:18:18 +0000
commitebf4c5615678cdb2e97640039cbae2e7a2e2af0f (patch)
treedf92fe8e83bdc3c183d17c232d0c65153c28e697
parent28a4219a721786248518360a2bc74745bc62cd93 (diff)
net/mosquitto: Rework port
* Unbundle uthash as recommended by Porters Handbook * Unbundle (lib)websockets as recommended by Porters Handbook * Make (lib)websockets mandatory, default in all major distros * Use sqlite helper * Prefer libedit as upstream provides no way of selecting either libedit or readline and it'll try to find libedit first * Remove hack for adding path(s) to localbase, use helper instead * Disable WITH_HTTP_API as port will otherwise pick up libmicrohttpd in unclean environments * Remove REINPLACE_CMD for CMakeLists.txt files as it does nothing * Remove hardcoded cjson path PR: 297568 Tested by: leres (maintainer)
-rw-r--r--net/mosquitto/Makefile44
-rw-r--r--net/mosquitto/files/patch-CMakeLists.txt12
2 files changed, 15 insertions, 41 deletions
diff --git a/net/mosquitto/Makefile b/net/mosquitto/Makefile
index 781dbc0ef1d9..5855ef8b1ea9 100644
--- a/net/mosquitto/Makefile
+++ b/net/mosquitto/Makefile
@@ -1,6 +1,6 @@
PORTNAME= mosquitto
DISTVERSION= 2.1.2
-PORTREVISION= 3
+PORTREVISION= 4
CATEGORIES= net
MASTER_SITES= https://mosquitto.org/files/source/
@@ -11,46 +11,32 @@ WWW= https://mosquitto.org/
LICENSE= EPL
BUILD_DEPENDS= docbook-xsl>0:textproc/docbook-xsl \
+ uthash>0:devel/uthash \
xsltproc:textproc/libxslt
LIB_DEPENDS= libcjson.so:devel/libcjson \
- libsqlite3.so:databases/sqlite3 \
- libuuid.so:misc/libuuid
+ libwebsockets.so:net/libwebsockets
RUN_DEPENDS= ${LOCALBASE}/share/certs/ca-root-nss.crt:security/ca_root_nss
-USES= cmake cpe readline ssl
-USE_RC_SUBR= mosquitto
-USE_LDCONFIG= yes
-CMAKE_ARGS= -DCJSON_INCLUDE_DIR:PATH="${PREFIX}/include/json" \
- -DCJSON_LIBRARY:PATH="${PREFIX}/lib/libcjson.so" \
- -DCMAKE_LIBDATADIR:PATH="${PREFIX}/libdata" \
- -DWITH_TESTS:BOOL=OFF
+USES= cmake cpe libedit localbase:ldflags ssl sqlite
CPE_VENDOR= eclipse
+USE_LDCONFIG= yes
+
+USE_RC_SUBR= mosquitto
USERS= nobody
PLIST_SUB= DISTVERSION=${DISTVERSION}
-OPTIONS_DEFINE= CARES WEBSOCKETS WEBSOCKETS_BUILTIN
-OPTIONS_DEFAULT= CARES WEBSOCKETS WEBSOCKETS_BUILTIN
+CMAKE_OFF= WITH_BUNDLED_DEPS \
+ WITH_HTTP_API \
+ WITH_TESTS \
+ WITH_WEBSOCKETS_BUILTIN
-CARES_LIB_DEPENDS= libcares.so:dns/c-ares
-CARES_CMAKE_ON= -DWITH_SRV:BOOL=ON
-
-WEBSOCKETS_DESC= $(WEBSOCKET_DESC)
-WEBSOCKETS_CMAKE_OFF= -DWITH_WEBSOCKETS:BOOL=OFF
-WEBSOCKETS_BUILTIN_CMAKE_OFF= -DWITH_WEBSOCKETS_BUILTIN:BOOL=OFF
-WEBSOCKETS_BUILTIN_DESC= Use bundled version of websockets
-
-.include <bsd.port.options.mk>
+OPTIONS_DEFINE= CARES
+OPTIONS_DEFAULT= CARES
-.if ${PORT_OPTIONS:MWEBSOCKETS} && !${PORT_OPTIONS:MWEBSOCKETS_BUILTIN}
-LIB_DEPENDS+= libwebsockets.so:net/libwebsockets
-.endif
-
-post-patch:
- @${REINPLACE_CMD} -e '/ldconfig/d' ${WRKSRC}/src/CMakeLists.txt \
- ${WRKSRC}/lib/CMakeLists.txt ${WRKSRC}/lib/cpp/CMakeLists.txt
- @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g' ${WRKSRC}/CMakeLists.txt
+CARES_LIB_DEPENDS= libcares.so:dns/c-ares
+CARES_CMAKE_BOOL= WITH_SRV
post-install:
.for F in mosquitto.conf pwfile pskfile aclfile
diff --git a/net/mosquitto/files/patch-CMakeLists.txt b/net/mosquitto/files/patch-CMakeLists.txt
deleted file mode 100644
index d1603e3d9e6e..000000000000
--- a/net/mosquitto/files/patch-CMakeLists.txt
+++ /dev/null
@@ -1,12 +0,0 @@
---- CMakeLists.txt.orig 2026-02-04 22:33:13 UTC
-+++ CMakeLists.txt
-@@ -23,6 +23,9 @@ add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")
-
- add_definitions (-DCMAKE -DVERSION=\"${VERSION}\")
-
-+include_directories("/usr/local/include")
-+link_directories("/usr/local/lib")
-+
- if(WIN32)
- add_definitions("-D_CRT_SECURE_NO_WARNINGS")
- add_definitions("-D_CRT_NONSTDC_NO_DEPRECATE")