default.nix (1052B)
1 { 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 libev, 7 lua, 8 openssl, 9 zlib, 10 }: 11 12 stdenv.mkDerivation (finalAttrs: { 13 pname = "libumqtt"; 14 version = "1.1.1"; 15 16 src = fetchFromGitHub { 17 owner = "zhaojh329"; 18 repo = "libumqtt"; 19 rev = "v${finalAttrs.version}"; 20 hash = "sha256-rNKcGU0LcTnSaVJjkI3onSpgJUY1apHaoFyx8GmyO8Y="; 21 fetchSubmodules = true; 22 }; 23 24 postPatch = lib.optionalString stdenv.isDarwin '' 25 substituteInPlace src/buffer/buffer.h \ 26 --replace-fail "<endian.h>" "<machine/endian.h>" 27 ''; 28 29 nativeBuildInputs = [ cmake ]; 30 31 buildInputs = [ 32 libev 33 lua 34 openssl 35 zlib 36 ]; 37 38 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=misleading-indentation"; 39 40 meta = { 41 description = "A Lightweight and fully asynchronous MQTT client C library based on libev"; 42 homepage = "https://github.com/zhaojh329/libumqtt"; 43 license = lib.licenses.mit; 44 maintainers = [ lib.maintainers.sikmir ]; 45 platforms = lib.platforms.linux; 46 skip.ci = stdenv.isDarwin; 47 }; 48 })