-
Notifications
You must be signed in to change notification settings - Fork 4
/
evm-assigner.nix
52 lines (45 loc) · 1.31 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
50
51
52
{ lib,
stdenv,
ninja,
pkg-config,
cmake,
boost183,
# We'll use boost183 by default, but you can override it
boost_lib ? boost183,
gdb,
lldb,
cmake_modules,
ethash,
intx,
sszpp,
valijson,
gtest,
enableDebugging,
enableDebug ? false,
runTests ? false,
}:
let
inherit (lib) optional;
in stdenv.mkDerivation rec {
name = "evm-assigner";
src = lib.sourceByRegex ./. ["^evm-assigner(/.*)?$" "^crypto3(/.*)?$" "^parallel-crypto3(/.*)?$" "CMakeLists.txt"];
hardeningDisable = [ "fortify" ];
nativeBuildInputs = [ cmake ninja pkg-config ] ++
(lib.optional (!stdenv.isDarwin) gdb) ++
(lib.optional (stdenv.isDarwin) lldb);
# enableDebugging will keep debug symbols in boost
propagatedBuildInputs = [ (if enableDebug then (enableDebugging boost_lib) else boost_lib) ];
buildInputs = [sszpp valijson cmake_modules ethash intx gtest];
cmakeFlags =
[
(if runTests then "-DBUILD_ASSIGNER_TESTS=TRUE" else "")
(if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release")
"-DZKEVM_FRAMEWORK_ENABLE=TRUE"
"-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!"
'';
}