diff options
author | Robert Scott <code@humanleg.org.uk> | 2023-05-16 01:01:10 +0100 |
---|---|---|
committer | Robert Scott <code@humanleg.org.uk> | 2023-05-20 18:12:48 +0100 |
commit | 91d415a123b119aef9a4d3f5d818bcdbefb27dcc (patch) | |
tree | 2f446e2b02c11e885f216530bc73021ed07857b1 /pkgs/servers/mqtt | |
parent | 1784646fc10266683fa63a32beaa2a37804f6df5 (diff) | |
download | nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar.gz nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar.bz2 nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar.lz nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar.xz nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.tar.zst nixpkgs-91d415a123b119aef9a4d3f5d818bcdbefb27dcc.zip |
nanomq: 0.16.3 -> 0.18.2
Diffstat (limited to 'pkgs/servers/mqtt')
-rw-r--r-- | pkgs/servers/mqtt/nanomq/default.nix | 74 |
1 files changed, 68 insertions, 6 deletions
diff --git a/pkgs/servers/mqtt/nanomq/default.nix b/pkgs/servers/mqtt/nanomq/default.nix index c02626b5280..06fec792f32 100644 --- a/pkgs/servers/mqtt/nanomq/default.nix +++ b/pkgs/servers/mqtt/nanomq/default.nix @@ -1,16 +1,51 @@ -{ lib, stdenv, fetchFromGitHub, cmake, ninja, pkg-config -, cyclonedds, libmysqlclient, mariadb, mbedtls, sqlite, zeromq +{ lib +, stdenv +, fetchFromGitHub +, cmake +, ninja +, pkg-config +, cyclonedds +, libmysqlclient +, mariadb +, mbedtls +, sqlite +, zeromq +, flex +, bison + +# for tests +, python3 +, mosquitto +, netcat-gnu }: -stdenv.mkDerivation (finalAttrs: { +let + + # exposing as full package in its own right would be a + # bit absurd - repo doesn't even have a license. + idl-serial = stdenv.mkDerivation { + pname = "idl-serial"; + version = "unstable-2023-03-29"; + + src = fetchFromGitHub { + owner = "nanomq"; + repo = "idl-serial"; + rev = "908c364dab4c0dcdd77b8de698d29c8a0b6d3830"; + hash = "sha256-3DS9DuzHN7BevfgiekUmKKH9ej9wKTrt6Fuh427NC4I="; + }; + + nativeBuildInputs = [ cmake ninja flex bison ]; + }; + +in stdenv.mkDerivation (finalAttrs: { pname = "nanomq"; - version = "0.16.3"; + version = "0.18.2"; src = fetchFromGitHub { owner = "emqx"; repo = "nanomq"; rev = finalAttrs.version; - hash = "sha256-9w4afVxuJbYrkagpAe1diftDnjrRjunyhJdJ0BZq3K0="; + hash = "sha256-XGJBBuRSL3InXUMGxOttdbt0zmI1APFlc4IvwC2up8g="; fetchSubmodules = true; }; @@ -19,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { --replace "DESTINATION /etc" "DESTINATION $out/etc" ''; - nativeBuildInputs = [ cmake ninja pkg-config ]; + nativeBuildInputs = [ cmake ninja pkg-config idl-serial ]; buildInputs = [ cyclonedds libmysqlclient mariadb mbedtls sqlite zeromq ]; @@ -35,6 +70,33 @@ stdenv.mkDerivation (finalAttrs: { env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-return-type"; + # disabled by default - not 100% reliable and making nanomq depend on + # mosquitto would annoy people + doInstallCheck = false; + nativeInstallCheckInputs = [ + mosquitto + netcat-gnu + (python3.withPackages (ps: with ps; [ jinja2 requests paho-mqtt ])) + ]; + installCheckPhase = '' + runHook preInstallCheck + + ( + cd .. + + # effectively distable this test because it is slow + echo > .github/scripts/fuzzy_test.txt + + PATH="$PATH:$out/bin" python .github/scripts/test.py + ) + + runHook postInstallCheck + ''; + + passthru.tests = { + withInstallChecks = finalAttrs.finalPackage.overrideAttrs (_: { doInstallCheck = true; }); + }; + meta = with lib; { description = "An ultra-lightweight and blazing-fast MQTT broker for IoT edge"; homepage = "https://nanomq.io/"; |