nur-packages

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

package.nix (1775B)


      1 {
      2   lib,
      3   stdenv,
      4   fetchFromGitHub,
      5   cmake,
      6   spdlog,
      7   yaml-cpp,
      8   libcpr,
      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     substituteInPlace src/libmqtt-to-influxdb/database/iotrepository.cpp \
     42       --replace-fail "InfluxDB.h" "InfluxDB/InfluxDB.h" \
     43       --replace-fail "InfluxDBFactory.h" "InfluxDB/InfluxDBFactory.h"
     44   ''
     45   + lib.optionalString stdenv.cc.isClang ''
     46     substituteInPlace src/libmqtt-to-influxdb/CMakeLists.txt \
     47       --replace-fail "stdc++fs" ""
     48   '';
     49 
     50   nativeBuildInputs = [ cmake ];
     51 
     52   buildInputs = [
     53     spdlog
     54     yaml-cpp
     55     libcpr
     56     cxxopts
     57     nlohmann_json
     58     influxdb-cxx
     59     boost
     60     curl
     61     paho-mqtt-cpp
     62     paho-mqtt-c
     63     stduuid
     64     microsoft-gsl
     65     catch2
     66   ];
     67 
     68   meta = {
     69     description = "MQTT message parser for writing statistics into InfluxDB";
     70     homepage = "https://github.com/DavidHamburg/mqtt-to-influxdb";
     71     license = lib.licenses.mit;
     72     maintainers = [ lib.maintainers.sikmir ];
     73     platforms = lib.platforms.unix;
     74   };
     75 })