-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevm-assigner.nix
49 lines (42 loc) · 1.18 KB
/
evm-assigner.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
{ lib,
stdenv,
src_repo,
ninja,
pkg-config,
cmake,
boost183,
# We'll use boost183 by default, but you can override it
boost_lib ? boost183,
gdb,
ethash,
intx,
gtest,
crypto3,
enableDebugging,
enableDebug ? false,
runTests ? false,
}:
let
inherit (lib) optional;
in stdenv.mkDerivation rec {
name = "evm-assigner";
src = src_repo;
nativeBuildInputs = [ cmake ninja pkg-config ] ++ (lib.optional (!stdenv.isDarwin) gdb);
# enableDebugging will keep debug symbols in boost
propagatedBuildInputs = [ (if enableDebug then (enableDebugging boost_lib) else boost_lib) ];
buildInputs = [crypto3 ethash intx gtest];
cmakeFlags =
[
(if runTests then "-DBUILD_TESTS=TRUE" else "")
(if runTests then "-DCMAKE_ENABLE_TESTS=TRUE" else "")
(if runTests then "-DBUILD_ASSIGNER_TESTS=TRUE" else "")
(if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release")
(if enableDebug then "-DCMAKE_CXX_FLAGS=-ggdb" else "")
"-G Ninja"
];
doCheck = runTests;
shellHook = ''
PS1="\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ "
echo "Welcome to evm-assigner development environment!"
'';
}