blob: 5efc256b5467c2e96de2414c645333899394881e (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
{ lib
, stdenv
, fetchFromGitHub
, cmake
, gtest
, protobuf
, curl
, grpc
, prometheus-cpp
, nlohmann_json
, nix-update-script
}:
let
opentelemetry-proto = fetchFromGitHub {
owner = "open-telemetry";
repo = "opentelemetry-proto";
rev = "v1.3.2";
hash = "sha256-bkVqPSVhyMHrmFvlI9DTAloZzDozj3sefIEwfW7OVrI=";
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "opentelemetry-cpp";
version = "1.16.0";
src = fetchFromGitHub {
owner = "open-telemetry";
repo = "opentelemetry-cpp";
rev = "v${finalAttrs.version}";
hash = "sha256-rMqNz8F/ahgDtQiLsswckd2jQPR9FTeSZKRFz2jWVoo=";
};
patches = [
./0001-Disable-tests-requiring-network-access.patch
] ++ lib.optional stdenv.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch;
nativeBuildInputs = [ cmake ];
buildInputs = [
curl
grpc
nlohmann_json
prometheus-cpp
protobuf
];
doCheck = true;
checkInputs = [
gtest
];
strictDeps = true;
cmakeFlags = [
"-DBUILD_SHARED_LIBS=ON"
"-DWITH_OTLP_HTTP=ON"
"-DWITH_OTLP_GRPC=ON"
"-DWITH_ABSEIL=ON"
"-DWITH_PROMETHEUS=ON"
"-DWITH_ELASTICSEARCH=ON"
"-DWITH_ZIPKIN=ON"
"-DWITH_BENCHMARK=OFF"
"-DOTELCPP_PROTO_PATH=${opentelemetry-proto}"
];
outputs = [ "out" "dev" ];
passthru.updateScript = nix-update-script { };
meta = {
description = "OpenTelemetry C++ Client Library";
homepage = "https://github.com/open-telemetry/opentelemetry-cpp";
license = [ lib.licenses.asl20 ];
maintainers = with lib.maintainers; [ jfroche ];
platforms = lib.platforms.linux;
# https://github.com/protocolbuffers/protobuf/issues/14492
broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform);
};
})
|