about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix45
1 files changed, 45 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix b/nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix
new file mode 100644
index 000000000000..cc97be1c6874
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/in/influxdb-cxx/package.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, boost, catch2_3, libcpr, trompeloeil }:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "influxdb-cxx";
+  version = "0.7.2";
+
+  src = fetchFromGitHub {
+    owner = "offa";
+    repo = "influxdb-cxx";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-DFslPrbgqS3JGx62oWlsC+AN5J2CsFjGcDaDRCadw7E=";
+  };
+
+  patches = [
+    # Fix unclosed test case tag
+    (fetchpatch {
+      url = "https://github.com/offa/influxdb-cxx/commit/b31f94982fd1d50e89ce04f66c694bec108bf470.patch";
+      hash = "sha256-oSdpNlWV744VpzfiWzp0ziNKaReLTlyfJ+SF2qyH+TU=";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt --replace "-Werror" ""
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost libcpr ]
+    ++ lib.optionals finalAttrs.doCheck [ catch2_3 trompeloeil ];
+
+  cmakeFlags = [
+    (lib.cmakeBool "INFLUXCXX_TESTING" finalAttrs.doCheck)
+    (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "-E;BoostSupportTest") # requires network access
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "InfluxDB C++ client library";
+    homepage = "https://github.com/offa/influxdb-cxx";
+    license = licenses.mit;
+    maintainers = with maintainers; [ sikmir ];
+    platforms = platforms.unix;
+  };
+})