-
Notifications
You must be signed in to change notification settings - Fork 0
/
derivation.nix
72 lines (61 loc) · 1.6 KB
/
derivation.nix
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
{
stdenv,
lib,
pkg-config,
openssl,
fetchFromGitHub,
cmake,
protobuf,
asio,
websocketpp,
prometheus-cpp,
grpc,
which,
tlms-rust,
curlpp,
curlFull,
json-structs-src
}:
let
json_struct = stdenv.mkDerivation {
pname = "json_struct";
version = "0.0.1";
src = json-structs-src;
cmakeFlags = [
"-DJSON_STRUCT_OPT_BUILD_TESTS=OFF"
"-DJSON_STRUCT_OPT_BUILD_EXAMPLES=OFF"
"-DCMAKE_INSTALL_PREFIX='./'"
];
nativeBuildInputs = [ cmake ];
meta = with lib; {
homepage = "https://github.com/jorgen/json_structs/";
description = "json_struct is a header only library that parses JSON to C++ structs and serializing structs to JSON.";
platforms = platforms.unix;
maintainers = with maintainers; [ revol-xut ];
};
};
in
stdenv.mkDerivation {
pname = "funnel";
version = "0.2.0";
src = ./.;
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
buildPhase = ''
cp ${tlms-rust}/proto/telegram.proto ./telegram.proto
mkdir -p src/protobuf
protoc -I ./ --grpc_out=./src/protobuf/ --plugin=protoc-gen-grpc=`which grpc_cpp_plugin` ./telegram.proto
protoc -I=./ --cpp_out=./src/protobuf/ ./telegram.proto
cmake .
make
'';
installPhase = ''
mkdir -p $out/bin
cp funnel $out/bin/
'';
nativeBuildInputs = [ pkg-config cmake];
buildInputs = [ openssl protobuf websocketpp asio grpc which json_struct prometheus-cpp curlFull curlpp ];
meta = with lib; {
description = "service which takes the incoming data";
homepage = "https://github.com/tlm-solutions/funnel";
};
}