-
Notifications
You must be signed in to change notification settings - Fork 48
/
zkllvm.nix
61 lines (52 loc) · 1.45 KB
/
zkllvm.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
{ lib,
stdenv,
src_repo,
pkgs,
ninja,
pkg-config,
cmake,
# We'll use boost183 by default, but you can override it
boost_lib ? pkgs.boost183,
gdb,
cmake_modules,
crypto3,
blueprint,
python3,
git,
cargo,
openssl,
enableDebugging,
enableDebug ? false,
enableTesting ? false
}:
let
inherit (lib) optional;
in stdenv.mkDerivation {
name = "Zkllvm";
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 blueprint cmake_modules python3 git cargo openssl];
cmakeFlags =
[
(if enableTesting then "-DENABLE_TESTS=TRUE" else "")
(if enableTesting then "-DBUILD_TESTS=TRUE" else "")
(if enableTesting then "-DCMAKE_ENABLE_TESTS=TRUE" else "")
(if enableDebug then "-DCMAKE_BUILD_TYPE=Debug" else "-DCMAKE_BUILD_TYPE=Release")
(if enableDebug then "-DCMAKE_CXX_FLAGS=-ggdb" else "")
"-DZKLLVM_VERSION=0.1.18"
"-DGENERATE_EVM_VERIFIER=TRUE"
];
ninjaFlags = "assigner clang transpiler";
doCheck = enableTesting;
checkPhase = ''
export ARTIFACTS_DIR="$out/artifacts/"
echo "ARTIFACTS_DIR=$ARTIFACTS_DIR"
mkdir -p "$ARTIFACTS_DIR/artifacts"
bash ../run_tests.sh
'';
shellHook = ''
echo "Welcome to zkllvm development environment!"
'';
}