nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

commit b84b260ccdb0320a0bf69b075ef4b136b6f7cff0
parent 9e770982a4f5f16e79a80017528bb9b18acf5dd5
Author: Nikolay Korotkiy <sikmir@disroot.org>
Date:   Thu, 25 Jan 2024 19:11:28 +0400

Add mqtt-c

Diffstat:
Mpkgs/default.nix | 1+
Apkgs/mqtt/mqtt-c/default.nix | 36++++++++++++++++++++++++++++++++++++
2 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/pkgs/default.nix b/pkgs/default.nix @@ -421,6 +421,7 @@ lib.makeScope newScope ( mproxy = callPackage ./mqtt/mproxy { }; mqcontrol = callPackage ./mqtt/mqcontrol { }; mqtt-benchmark = callPackage ./mqtt/mqtt-benchmark { }; + mqtt-c = callPackage ./mqtt/mqtt-c { }; mqtt-cli = callPackage ./mqtt/mqtt-cli { }; mqtt-explorer = callPackage ./mqtt/mqtt-explorer { }; mqtt-launcher = callPackage ./mqtt/mqtt-launcher { }; diff --git a/pkgs/mqtt/mqtt-c/default.nix b/pkgs/mqtt/mqtt-c/default.nix @@ -0,0 +1,36 @@ +{ lib, stdenv, fetchFromGitHub, cmake, cmocka }: + +stdenv.mkDerivation (finalAttrs: { + pname = "MQTT-C"; + version = "1.1.6"; + + src = fetchFromGitHub { + owner = "LiamBindle"; + repo = "MQTT-C"; + rev = "v${finalAttrs.version}"; + hash = "sha256-TmqEekdAyxueY0A1a96eyADBpLe+AWd6xMQP3tF6968="; + }; + + nativeBuildInputs = [ cmake ]; + + buildInputs = [ cmocka ]; + + cmakeFlags = [ + (lib.cmakeBool "MQTT_C_INSTALL_EXAMPLES" true) + (lib.cmakeBool "MQTT_C_TESTS" true) + ]; + + doCheck = true; + + checkPhase = '' + ./tests + ''; + + meta = with lib; { + description = "A portable MQTT C client for embedded systems and PCs alike"; + inherit (finalAttrs.src.meta) homepage; + license = licenses.mit; + maintainers = [ maintainers.sikmir ]; + platforms = platforms.unix; + }; +})