default.nix (1530B)
1 { lib 2 , stdenv 3 , fetchFromGitHub 4 , cmake 5 , spdlog 6 , libyamlcpp 7 , libcpr 8 , cxxopts 9 , nlohmann_json 10 , influxdb-cxx 11 , boost 12 , curl 13 , paho-mqtt-cpp 14 , paho-mqtt-c 15 , stduuid 16 , microsoft_gsl 17 , catch2 18 }: 19 20 stdenv.mkDerivation (finalAttrs: { 21 pname = "mqtt-to-influxdb"; 22 version = "0.2.1"; 23 24 src = fetchFromGitHub { 25 owner = "DavidHamburg"; 26 repo = "mqtt-to-influxdb"; 27 rev = "v${finalAttrs.version}"; 28 hash = "sha256-rTMI9gqjtrmtT9SoYcHHq19Jch1dH7/tmyqz5F4f9Ao="; 29 fetchSubmodules = true; 30 }; 31 32 postPatch = '' 33 substituteInPlace src/app/CMakeLists.txt \ 34 --replace-fail "/usr" "$out" 35 sed -i '1i #include <iostream>' src/app-validate/main.cpp 36 substituteInPlace src/app-validate/main.cpp \ 37 --replace-fail "OptionParseException" "exceptions::parsing" 38 substituteInPlace src/app/main.cpp \ 39 --replace-fail "OptionParseException" "exceptions::parsing" 40 '' + lib.optionalString stdenv.cc.isClang '' 41 substituteInPlace src/libmqtt-to-influxdb/CMakeLists.txt \ 42 --replace-fail "stdc++fs" "" 43 ''; 44 45 nativeBuildInputs = [ cmake ]; 46 47 buildInputs = [ 48 spdlog 49 libyamlcpp 50 libcpr 51 cxxopts 52 nlohmann_json 53 influxdb-cxx 54 boost 55 curl 56 paho-mqtt-cpp 57 paho-mqtt-c 58 stduuid 59 microsoft_gsl 60 catch2 61 ]; 62 63 meta = with lib; { 64 description = "MQTT message parser for writing statistics into InfluxDB"; 65 inherit (finalAttrs.src.meta) homepage; 66 license = licenses.mit; 67 maintainers = [ maintainers.sikmir ]; 68 platforms = platforms.unix; 69 }; 70 })