2021-01-21 17:00:13 +00:00
|
|
|
{ lib, stdenv
|
2019-03-07 08:52:56 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, gbenchmark
|
|
|
|
, gtest
|
|
|
|
, civetweb
|
|
|
|
, zlib
|
|
|
|
, curl
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "prometheus-cpp";
|
2020-02-14 20:49:04 +00:00
|
|
|
version = "0.9.0";
|
2019-03-07 08:52:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jupp0r";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2020-02-14 20:49:04 +00:00
|
|
|
sha256 = "1pjz29ywzfg3blhg2v8fn7gjvq46k3bqn7y0xvmn468ixxhv21fi";
|
2019-03-07 08:52:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
buildInputs = [ gbenchmark civetweb gtest zlib curl ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DUSE_THIRDPARTY_LIBRARIES=OFF"
|
|
|
|
"-DCIVETWEB_INCLUDE_DIR=${civetweb.dev}/include"
|
|
|
|
"-DCIVETWEB_CXX_LIBRARY=${civetweb}/lib/libcivetweb${stdenv.targetPlatform.extensions.sharedLibrary}"
|
2020-01-01 19:45:11 +00:00
|
|
|
"-DBUILD_SHARED_LIBS=ON"
|
2019-03-07 08:52:56 +00:00
|
|
|
];
|
|
|
|
|
2019-10-30 11:34:47 +00:00
|
|
|
NIX_LDFLAGS = "-ldl";
|
2019-03-07 08:52:56 +00:00
|
|
|
|
2021-01-21 10:54:38 +00:00
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $out/lib/pkgconfig
|
|
|
|
substituteAll ${./prometheus-cpp.pc.in} $out/lib/pkgconfig/prometheus-cpp.pc
|
|
|
|
'';
|
|
|
|
|
2019-03-07 08:52:56 +00:00
|
|
|
meta = {
|
|
|
|
description = "Prometheus Client Library for Modern C++";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/jupp0r/prometheus-cpp";
|
2021-01-21 17:00:13 +00:00
|
|
|
license = [ lib.licenses.mit ];
|
2019-03-07 08:52:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|