-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathrelease.nix
117 lines (108 loc) · 2.68 KB
/
release.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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{ lib,
nix-filter,
version ? null,
coq,
rocq,
rocqPkgs,
coqPkgs,
perl,
... }:
{ vellvm =
rocqPkgs.mkRocqDerivation {
pname = "vellvm";
owner = "vellvm";
inherit version;
buildInputs =
with rocq.ocamlPackages;
[ rocq
coq # Needed to make QuickChick happy for now...
dune_3
perl
] ++
# These ocaml packages have to come from rocq.ocamlPackages to
# avoid disagreements between ocaml compiler versions.
[ ocaml
ocamlbuild
findlib
menhir
qcheck
cppo
];
propagatedBuildInputs =
# Rocq libraries
with rocqPkgs;
with coqPkgs;
with rocq.ocamlPackages;
[ mathcomp
mathcomp-ssreflect
ExtLib
paco
ITree
flocq
ceres
simple-io
zarith
QuickChick
] ++
# These ocaml packages have to come from rocq.ocamlPackages to
# avoid disagreements between ocaml compiler versions.
[ ocaml
ocamlbuild
findlib
menhir
qcheck
cppo
];
src =
# Some filtering to ignore files that are unimportant for the build.
# Helps with caching and preventing rebuilds when, e.g., only
# a README changed.
nix-filter {
root = ./.;
include = [
./lib
./src
./src/Makefile
(nix-filter.matchExt "v")
(nix-filter.matchExt "ml")
(nix-filter.matchExt "patch")
(nix-filter.matchName "dune")
(nix-filter.matchName "dune-project")
];
exclude = [
./src/doc
./src/cachix-push.sh
./utilities
./qc-test-failures
(nix-filter.matchExt "org")
(nix-filter.matchExt "md")
(nix-filter.matchExt "txt")
(nix-filter.matchExt "yml")
(nix-filter.matchExt "cff")
(nix-filter.matchName "README")
./.gitignore
./.git
];
};
buildPhase = ''
runHook preBuild
unset COQPATH
make -C src/
make -C src/ frontend
runHook postBuild
'';
installPhase = ''
runHook preInstall
unset COQPATH
mkdir -p $out/bin
install src/vellvm $out/bin/vellvm
install src/frontend $out/bin/frontend
COQLIBINSTALL=$out/lib/coq/${rocq.rocq-version}/user-contrib make -C src/ install
runHook postInstall
'';
meta = {
description = "Vellvm, a formal specification and interpreter for LLVM";
license = lib.licenses.gpl3Only;
};
};
}