1{ stdenv, lib, fetchFromGitHub, pkgconfig, protobuf, cmake, zlib
2, opentracing-cpp, enableGrpc ? false
3}:
4
5let
6 # be sure to use the right revision based on the submodule!
7 common =
8 fetchFromGitHub {
9 owner = "lightstep";
10 repo = "lightstep-tracer-common";
11 rev = "5fe3bf885bcece14c3c65df06c86c826ba45ad69";
12 sha256 = "1q39a0zaqbnqyhl2hza2xzc44235p65bbkfkzs2981niscmggq8w";
13 };
14
15in
16
17stdenv.mkDerivation rec {
18 name = "lightstep-tracer-cpp-${version}";
19 version = "0.8.1";
20
21 src = fetchFromGitHub {
22 owner = "lightstep";
23 repo = "lightstep-tracer-cpp";
24 rev = "v${version}";
25 sha256 = "1m4kl70lhvy1bsmkdh6bf2fddz5v1ikb27vgi99i2akpq40g4fvf";
26 };
27
28 postUnpack = ''
29 cp -r ${common}/* $sourceRoot/lightstep-tracer-common
30 '';
31
32 cmakeFlags = ["-DOPENTRACING_INCLUDE_DIR=${opentracing-cpp}/include" "-DOPENTRACING_LIBRARY=${opentracing-cpp}/lib/libopentracing.so"] ++ lib.optional (!enableGrpc) [ "-DWITH_GRPC=OFF" ];
33
34 nativeBuildInputs = [
35 pkgconfig cmake
36 ];
37
38 buildInputs = [
39 protobuf zlib
40 ];
41
42 meta = with lib; {
43 description = "Distributed tracing system built on top of the OpenTracing standard";
44 homepage = "https://lightstep.com/";
45 license = licenses.mit;
46 platforms = platforms.linux;
47 maintainers = with maintainers; [ cstrahan ];
48 };
49}