package.nix (1165B)
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 __structuredAttrs = true; 17 18 src = fetchFromGitHub { 19 owner = "zhaojh329"; 20 repo = "libumqtt"; 21 tag = "v${finalAttrs.version}"; 22 hash = "sha256-rNKcGU0LcTnSaVJjkI3onSpgJUY1apHaoFyx8GmyO8Y="; 23 fetchSubmodules = true; 24 }; 25 26 postPatch = lib.optionalString stdenv.isDarwin '' 27 substituteInPlace src/buffer/buffer.h \ 28 --replace-fail "<endian.h>" "<machine/endian.h>" 29 ''; 30 31 nativeBuildInputs = [ cmake ]; 32 33 buildInputs = [ 34 libev 35 lua 36 openssl 37 zlib 38 ]; 39 40 cmakeFlags = [ 41 (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10") 42 ]; 43 44 env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=misleading-indentation"; 45 46 meta = { 47 description = "A Lightweight and fully asynchronous MQTT client C library based on libev"; 48 homepage = "https://github.com/zhaojh329/libumqtt"; 49 license = lib.licenses.mit; 50 maintainers = [ lib.maintainers.sikmir ]; 51 platforms = lib.platforms.linux; 52 skip.ci = stdenv.isDarwin; 53 }; 54 })
