about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/prometheus-cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/prometheus-cpp')
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in10
2 files changed, 56 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
new file mode 100644
index 000000000000..dda515932f2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gbenchmark
+, gtest
+, civetweb
+, zlib
+, curl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "prometheus-cpp";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "jupp0r";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-qx6oBxd0YrUyFq+7ArnKBqOwrl5X8RS9nErhRDUJ7+8=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ gbenchmark gtest zlib curl ];
+  propagatedBuildInputs = [ civetweb ];
+  strictDeps = true;
+
+  cmakeFlags = [
+    "-DUSE_THIRDPARTY_LIBRARIES=OFF"
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  postInstall = ''
+    mkdir -p $dev/lib/pkgconfig
+    substituteAll ${./prometheus-cpp.pc.in} $dev/lib/pkgconfig/prometheus-cpp.pc
+  '';
+
+  meta = {
+    description = "Prometheus Client Library for Modern C++";
+    homepage = "https://github.com/jupp0r/prometheus-cpp";
+    license = [ lib.licenses.mit ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in b/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in
new file mode 100644
index 000000000000..c373f4153b55
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in
@@ -0,0 +1,10 @@
+prefix=@out@
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Name: prometheus-cpp
+Description: Prometheus Client Library for Modern C++
+URL: https://github.com/jupp0r/prometheus-cpp
+Version: @version@
+Cflags: -isystem${includedir}
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lprometheus-cpp-core -lprometheus-cpp-pull -lprometheus-cpp-push