koboldcpp: 1.81.1 -> 1.82.4 (#374773)
[NixPkgs.git] / pkgs / by-name / op / opentelemetry-cpp / package.nix
blob8d7640cb12b2ff1aa4d20584cce6771797a111d4
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   gtest,
7   protobuf,
8   curl,
9   grpc,
10   prometheus-cpp,
11   nlohmann_json,
12   nix-update-script,
15 let
16   opentelemetry-proto = fetchFromGitHub {
17     owner = "open-telemetry";
18     repo = "opentelemetry-proto";
19     rev = "v1.3.2";
20     hash = "sha256-bkVqPSVhyMHrmFvlI9DTAloZzDozj3sefIEwfW7OVrI=";
21   };
23 stdenv.mkDerivation (finalAttrs: {
24   pname = "opentelemetry-cpp";
25   version = "1.16.1";
27   src = fetchFromGitHub {
28     owner = "open-telemetry";
29     repo = "opentelemetry-cpp";
30     rev = "v${finalAttrs.version}";
31     hash = "sha256-31zwIZ4oehhfn+oCyg8VQTurPOmdgp72plH1Pf/9UKQ=";
32   };
34   patches = [
35     ./0001-Disable-tests-requiring-network-access.patch
36   ] ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Disable-segfaulting-test-on-Darwin.patch;
38   nativeBuildInputs = [ cmake ];
40   buildInputs = [
41     curl
42     grpc
43     nlohmann_json
44     prometheus-cpp
45     protobuf
46   ];
48   doCheck = true;
50   checkInputs = [
51     gtest
52   ];
54   strictDeps = true;
56   cmakeFlags = [
57     "-DBUILD_SHARED_LIBS=ON"
58     "-DWITH_OTLP_HTTP=ON"
59     "-DWITH_OTLP_GRPC=ON"
60     "-DWITH_ABSEIL=ON"
61     "-DWITH_PROMETHEUS=ON"
62     "-DWITH_ELASTICSEARCH=ON"
63     "-DWITH_ZIPKIN=ON"
64     "-DWITH_BENCHMARK=OFF"
65     "-DOTELCPP_PROTO_PATH=${opentelemetry-proto}"
66   ];
68   outputs = [
69     "out"
70     "dev"
71   ];
73   postInstall = ''
74     substituteInPlace $out/lib/cmake/opentelemetry-cpp/opentelemetry-cpp-target.cmake \
75       --replace-fail "\''${_IMPORT_PREFIX}/include" "$dev/include"
76   '';
78   passthru.updateScript = nix-update-script { };
80   meta = {
81     description = "OpenTelemetry C++ Client Library";
82     homepage = "https://github.com/open-telemetry/opentelemetry-cpp";
83     license = [ lib.licenses.asl20 ];
84     maintainers = with lib.maintainers; [ jfroche ];
85     platforms = lib.platforms.linux;
86     # https://github.com/protocolbuffers/protobuf/issues/14492
87     broken = !(stdenv.buildPlatform.canExecute stdenv.hostPlatform);
88   };