-
Notifications
You must be signed in to change notification settings - Fork 25
/
shell.nix
91 lines (88 loc) · 2.2 KB
/
shell.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{ pkgs ? import <nixpkgs> { }
, cpcd
, zw-testframework
, ths-cmock
, ths-unity
, gecko-sdk
, packages
}:
with pkgs;
gcc10Stdenv.mkDerivation rec {
name = "Unify SDK development shell";
src = self;
# Build input: boost
boost_pinned = pkgs.boost174.overrideAttrs (o: {
enableMultiThreaded = true;
enableStatic = true;
});
boost = boost_pinned.override { stdenv = pkgs.gcc10Stdenv; };
cmakeFlags = [
"-GNinja"
# The find boost script that comes with cmake prioritizes installations in the system.
# Disable this so the version in the nix store can be found.
"-DBoost_NO_BOOST_CMAKE=TRUE"
"-DCMAKE_INSTALL_PREFIX=install"
"-DCOMMON_LOCATION=${packages.common}"
"-DZW-TESTFRAMEWORK_LOCATION=${zw-testframework}"
"-DTHS-CMOCK_LOCATION=${ths-cmock}"
"-DTHS-UNITY_LOCATION=${ths-unity}"
"-DCPCD_LOCATION=${cpcd}"
"-DGSDK_LOCATION=${gecko-sdk}"
"-DUNIFY-TESTFRAMEWORK_LOCATION=${self}/components/testframework"
"-DBUILD_TESTING=false"
# Opt out of building any and all components
"-DBUILD_ZPC=OFF"
"-DBUILD_ZIGPC=OFF"
"-DBUILD_DEV_GUI=OFF"
"-DBUILD_UIC_DEMO=OFF"
"-DBUILD_UPVL=OFF"
"-DBUILD_GMS=OFF"
"-DBUILD_IMAGE_PROVIDER=OFF"
"-DBUILD_AOXPC=OFF"
"-DBUILD_POSITIONING=OFF"
"-DBUILD_NAL=OFF"
"-DBUILD_UPTI_CAP=OFF"
"-DBUILD_UPTI_WRITER=OFF"
"-DBUILD_CPCD=OFF"
"-DBUILD_ZIGBEED=OFF"
"-DBUILD_OTBR=OFF"
"-DBUILD_MATTER_BRIDGE=OFF"
"-DBUILD_EPC=OFF"
"-DBUILD_EMD=OFF"
];
enableParallelBuilding = true;
nativeBuildInputs = [
cmake
ninja
just
clang
python-pinned.packages
];
buildInputs = [
# dev tool
bacon
sd
nixpkgs-fmt
# build tools
boost
nodejs
# klunge
git
graphviz
doxygen
mbedtls
(libyamlcpp.override { stdenv = pkgs.gcc10Stdenv; })
nlohmann_json
(gtest.override { stdenv = pkgs.gcc10Stdenv; })
mosquitto
sqlite
ruby
libedit
cpcd.packages.${system}.cpcd
rust-bin.stable."1.65.0".default
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
shellHook = ''
alias build='cmake -S . -B build ${ builtins.concatStringsSep " " cmakeFlags } && ninja -C build install'
'';
}