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