summary refs log tree commit diff
path: root/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
blob: 7f82d49462c5858168c71dd4f82cbc45223a150c (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
{ stdenv, lib, fetchFromGitHub, pkgconfig, protobuf, cmake, zlib
, opentracing-cpp, enableGrpc ? false
}:

let
  # be sure to use the right revision based on the submodule!
  common =
    fetchFromGitHub {
      owner = "lightstep";
      repo = "lightstep-tracer-common";
      rev = "5fe3bf885bcece14c3c65df06c86c826ba45ad69";
      sha256 = "1q39a0zaqbnqyhl2hza2xzc44235p65bbkfkzs2981niscmggq8w";
    };

in

stdenv.mkDerivation rec {
  pname = "lightstep-tracer-cpp";
  version = "0.8.1";

  src = fetchFromGitHub {
    owner = "lightstep";
    repo = "lightstep-tracer-cpp";
    rev = "v${version}";
    sha256 = "1m4kl70lhvy1bsmkdh6bf2fddz5v1ikb27vgi99i2akpq40g4fvf";
  };

  postUnpack = ''
    cp -r ${common}/* $sourceRoot/lightstep-tracer-common
  '';

  cmakeFlags = ["-DOPENTRACING_INCLUDE_DIR=${opentracing-cpp}/include" "-DOPENTRACING_LIBRARY=${opentracing-cpp}/lib/libopentracing.so"] ++ lib.optional (!enableGrpc) [ "-DWITH_GRPC=OFF" ];

  nativeBuildInputs = [
    pkgconfig cmake
  ];

  buildInputs = [
    protobuf zlib
  ];

  meta = with lib; {
    description = "Distributed tracing system built on top of the OpenTracing standard";
    homepage = "https://lightstep.com/";
    license = licenses.mit;
    platforms = platforms.linux;
    maintainers = with maintainers; [ cstrahan ];
  };
}