13 , withSystemd ? lib.meta.availableOn stdenv.hostPlatform systemd
20 # Mosquitto needs external poll enabled in libwebsockets.
21 libwebsockets' = (libwebsockets.override {
22 withExternalPoll = true;
23 }).overrideAttrs (old: {
24 # Avoid bug in firefox preventing websockets being created over http/2 connections
25 # https://github.com/eclipse/mosquitto/issues/1211#issuecomment-958137569
26 cmakeFlags = old.cmakeFlags ++ [ "-DLWS_WITH_HTTP2=OFF" ];
30 stdenv.mkDerivation rec {
34 src = fetchFromGitHub {
38 hash = "sha256-oZo6J6mxMC05jJ8RXIunOMB3kptA6FElchKlg4qmuQ8=";
42 for f in html manpage ; do
43 substituteInPlace man/$f.xsl \
44 --replace http://docbook.sourceforge.net/release/xsl/current ${docbook_xsl}/share/xml/docbook-xsl
48 outputs = [ "out" "dev" "lib" ];
50 nativeBuildInputs = [ cmake docbook_xsl libxslt ];
60 ] ++ lib.optional withSystemd systemd;
63 (lib.cmakeBool "WITH_BUNDLED_DEPS" false)
64 (lib.cmakeBool "WITH_WEBSOCKETS" true)
65 (lib.cmakeBool "WITH_SYSTEMD" withSystemd)
69 sed -i "s|^prefix=.*|prefix=$lib|g" $dev/lib/pkgconfig/*.pc
73 inherit (nixosTests) mosquitto;
77 description = "Open source MQTT v3.1/3.1.1/5.0 broker";
78 homepage = "https://mosquitto.org/";
79 changelog = "https://github.com/eclipse/mosquitto/blob/v${version}/ChangeLog.txt";
80 license = lib.licenses.epl10;
81 maintainers = [ lib.maintainers.peterhoeg ];
82 platforms = lib.platforms.unix;
83 mainProgram = "mosquitto";