nur-packages

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

package.nix (1586B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   cmake,
      6   spdlog,
      7   yaml-cpp,
      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     tag = "v${finalAttrs.version}";
     29     hash = "sha256-rTMI9gqjtrmtT9SoYcHHq19Jch1dH7/tmyqz5F4f9Ao=";
     30     fetchSubmodules = true;
     31   };
     32 
     33   postPatch = ''
     34     substituteInPlace src/app/CMakeLists.txt \
     35       --replace-fail "/usr" "$out"
     36     sed -i '1i #include <iostream>' src/app-validate/main.cpp
     37     substituteInPlace src/app-validate/main.cpp \
     38       --replace-fail "OptionParseException" "exceptions::parsing"
     39     substituteInPlace src/app/main.cpp \
     40       --replace-fail "OptionParseException" "exceptions::parsing"
     41   ''
     42   + lib.optionalString stdenv.cc.isClang ''
     43     substituteInPlace src/libmqtt-to-influxdb/CMakeLists.txt \
     44       --replace-fail "stdc++fs" ""
     45   '';
     46 
     47   nativeBuildInputs = [ cmake ];
     48 
     49   buildInputs = [
     50     spdlog
     51     yaml-cpp
     52     libcpr_1_10_5
     53     cxxopts
     54     nlohmann_json
     55     influxdb-cxx
     56     boost
     57     curl
     58     paho-mqtt-cpp
     59     paho-mqtt-c
     60     stduuid
     61     microsoft-gsl
     62     catch2
     63   ];
     64 
     65   meta = {
     66     description = "MQTT message parser for writing statistics into InfluxDB";
     67     homepage = "https://github.com/DavidHamburg/mqtt-to-influxdb";
     68     license = lib.licenses.mit;
     69     maintainers = [ lib.maintainers.sikmir ];
     70     platforms = lib.platforms.unix;
     71   };
     72 })