-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
53 lines (50 loc) · 1.25 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
49
50
51
52
53
{lib, stdenv, which, fstar, fstar-dune, z3, ocamlPackages, comparse, fetchFromGitHub}:
let
dolev-yao-star = stdenv.mkDerivation {
name = "dolev-yao-star";
src =
lib.sources.sourceByRegex ./. [
"Makefile"
"src(/.*)?"
"examples(/[^/]*)?"
]
;
enableParallelBuilding = true;
buildInputs = [ which fstar z3 ];
COMPARSE_HOME = comparse;
installPhase = ''
mkdir -p $out
cp -r ml src cache hints $out
'';
passthru.tests = dolev-yao-star-tests;
};
dolev-yao-star-tests = stdenv.mkDerivation {
name = "dolev-yao-star-tests";
src =
lib.sources.sourceByRegex ./. [
"Makefile"
"src(/.*)?"
"examples(/.*)?"
]
;
enableParallelBuilding = true;
buildInputs =
[ which fstar z3 ]
++ (with ocamlPackages; [
ocaml dune_3 findlib
])
++ (fstar-dune.buildInputs);
COMPARSE_HOME = comparse;
# pre-patch uses build output from dolev-yao-star, to avoid building things twice
prePatch = ''
cp -pr --no-preserve=mode ${dolev-yao-star}/cache ${dolev-yao-star}/ml .
mkdir obj
cp -p ml/lib/src/* obj/
'';
doCheck = true;
installPhase = ''
touch $out
'';
};
in
dolev-yao-star