commit 3b3436379a87df407abadcbcda6552fe65c8eb95
parent 1e0099471f187c2792bab745eee4b5e8faae5427
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date: Fri, 23 Feb 2024 17:42:57 +0400
Add libumqtt
Diffstat:
2 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/pkgs/default.nix b/pkgs/default.nix
@@ -418,6 +418,7 @@ lib.makeScope newScope (
influxdb-cxx = callPackage ./mqtt/influxdb-cxx { };
ioxy = callPackage ./mqtt/ioxy { };
janus-mqtt-proxy = callPackage ./mqtt/janus-mqtt-proxy { };
+ libumqtt = callPackage ./mqtt/libumqtt { };
mongoose = callPackage ./mqtt/mongoose { };
mproxy = callPackage ./mqtt/mproxy { };
mqcontrol = callPackage ./mqtt/mqcontrol { };
diff --git a/pkgs/mqtt/libumqtt/default.nix b/pkgs/mqtt/libumqtt/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libev, lua, openssl, zlib }:
+
+stdenv.mkDerivation (finalAttrs: {
+ pname = "libumqtt";
+ version = "1.1.1";
+
+ src = fetchFromGitHub {
+ owner = "zhaojh329";
+ repo = "libumqtt";
+ rev = "v${finalAttrs.version}";
+ hash = "sha256-rNKcGU0LcTnSaVJjkI3onSpgJUY1apHaoFyx8GmyO8Y=";
+ fetchSubmodules = true;
+ };
+
+ postPatch = lib.optionalString stdenv.isDarwin ''
+ substituteInPlace src/buffer/buffer.h \
+ --replace "<endian.h>" "<machine/endian.h>"
+ '';
+
+ nativeBuildInputs = [ cmake ];
+
+ buildInputs = [ libev lua openssl zlib ];
+
+ env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=misleading-indentation";
+
+ meta = with lib; {
+ description = "A Lightweight and fully asynchronous MQTT client C library based on libev";
+ inherit (finalAttrs.src.meta) homepage;
+ license = licenses.mit;
+ maintainers = [ maintainers.sikmir ];
+ platforms = platforms.linux;
+ skip.ci = stdenv.isDarwin;
+ };
+})