-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdefault.nix
48 lines (44 loc) · 1.08 KB
/
default.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
{
stdenv,
lib,
nix-gitignore,
cmake,
pkg-config,
protobuf,
mbedtls,
unitySrc ? null,
libprotobufMutatorSrc ? null,
}:
stdenv.mkDerivation rec {
pname = "cpc-daemon";
version = "4.6.0";
src = nix-gitignore.gitignoreSource [ ] ./.;
doCheck = (unitySrc != null) && (libprotobufMutatorSrc != null);
separateDebugInfo = doCheck;
nativeBuildInputs = [
cmake
pkg-config
];
nativeCheckInputs = [ protobuf ];
buildInputs = [ mbedtls ];
checkInputs = [ protobuf ];
cmakeBuildType = "RelWithDebInfo";
cmakeFlags =
with lib.strings;
[
(cmakeBool "CMAKE_COMPILE_WARNING_AS_ERROR" doCheck)
(cmakeBool "BUILD_TESTING" doCheck)
]
++ lib.optionals doCheck [
(cmakeOptionType "path" "UNITY_DIR" unitySrc.outPath)
(cmakeOptionType "path" "LIBPROTOBUF_MUTATOR_DIR" libprotobufMutatorSrc.outPath)
];
meta = with lib; {
description = "CPC daemon";
homepage = "https://github.com/SiliconLabs/cpc-daemon";
license = "MSLA";
maintainers = [ "iemaghni" ];
platform = platforms.linux;
mainProgram = "cpcd";
};
}