Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / op / opentelemetry-cpp / package.nix
blob97a7af508fb6959436ac2d4c03fd62c4f1935ba2
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , cmake
5 , gtest
6 , protobuf
7 , curl
8 , grpc
9 , prometheus-cpp
10 , nlohmann_json
11 , nix-update-script
14 let
15   opentelemetry-proto = fetchFromGitHub {
16     owner = "open-telemetry";
17     repo = "opentelemetry-proto";
18     rev = "v1.3.2";
19     hash = "sha256-bkVqPSVhyMHrmFvlI9DTAloZzDozj3sefIEwfW7OVrI=";
20   };
22 stdenv.mkDerivation (finalAttrs: {
23   pname = "opentelemetry-cpp";
24   version = "1.16.1";
26   src = fetchFromGitHub {
27     owner = "open-telemetry";
28     repo = "opentelemetry-cpp";
29     rev = "v${finalAttrs.version}";
30     hash = "sha256-31zwIZ4oehhfn+oCyg8VQTurPOmdgp72plH1Pf/9UKQ=";
31   };
33   patches = [
34     ./0001-Disable-tests-requiring-network-access.patch
35   ] ++ lib.optional stdenv.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch;
37   nativeBuildInputs = [ cmake ];
39   buildInputs = [
40     curl
41     grpc
42     nlohmann_json
43     prometheus-cpp
44     protobuf
45   ];
47   doCheck = true;
49   checkInputs = [
50     gtest
51   ];
53   strictDeps = true;
55   cmakeFlags = [
56     "-DBUILD_SHARED_LIBS=ON"
57     "-DWITH_OTLP_HTTP=ON"
58     "-DWITH_OTLP_GRPC=ON"
59     "-DWITH_ABSEIL=ON"
60     "-DWITH_PROMETHEUS=ON"
61     "-DWITH_ELASTICSEARCH=ON"
62     "-DWITH_ZIPKIN=ON"
63     "-DWITH_BENCHMARK=OFF"
64     "-DOTELCPP_PROTO_PATH=${opentelemetry-proto}"
65   ];
67   outputs = [ "out" "dev" ];
69   passthru.updateScript = nix-update-script { };
71   meta = {
72     description = "OpenTelemetry C++ Client Library";
73     homepage = "https://github.com/open-telemetry/opentelemetry-cpp";
74     license = [ lib.licenses.asl20 ];
75     maintainers = with lib.maintainers; [ jfroche ];
76     platforms = lib.platforms.linux;
77     # https://github.com/protocolbuffers/protobuf/issues/14492
78     broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform);
79   };