nur-packages

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

package.nix (1136B)


      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     tag = "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   cmakeFlags = [
     39     (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.10")
     40   ];
     41 
     42   env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=misleading-indentation";
     43 
     44   meta = {
     45     description = "A Lightweight and fully asynchronous MQTT client C library based on libev";
     46     homepage = "https://github.com/zhaojh329/libumqtt";
     47     license = lib.licenses.mit;
     48     maintainers = [ lib.maintainers.sikmir ];
     49     platforms = lib.platforms.linux;
     50     skip.ci = stdenv.isDarwin;
     51   };
     52 })