-
Notifications
You must be signed in to change notification settings - Fork 0
/
default.nix
46 lines (38 loc) · 1.21 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
{ pkgs ? import <nixpkgs> {}
, inCI ? false
, coqDeps ? !inCI
, ocamlDeps ? !inCI
, testDeps ? !inCI
, devTools ? !inCI
, enableFramePointers ? false
}:
with pkgs;
let inherit (lib) optionals; in
let coqPackages = coqPackages_8_12; in
let coqword = callPackage ./coqword.nix { inherit coqPackages; }; in
let inherit (coqPackages.coq) ocamlPackages; in
let oP =
if enableFramePointers
then ocamlPackages.overrideScope' (self: super: {
ocaml = super.ocaml.overrideAttrs (o: {
configureFlags = o.configureFlags ++ [ "--enable-frame-pointers" ];
});
})
else ocamlPackages
; in
if !lib.versionAtLeast oP.ocaml.version "4.08"
then throw "Jasmin requires OCaml ≥ 4.08"
else
stdenv.mkDerivation {
name = "jasmin-0";
src = null;
buildInputs = []
++ optionals coqDeps [ coqPackages.coq coqword coqPackages.coq.ocamlPackages.ocaml ]
++ optionals testDeps ([ ocamlPackages.apron.out ] ++ (with python3Packages; [ python pyyaml ]))
++ optionals ocamlDeps ([ mpfr ppl ] ++ (with oP; [
ocaml findlib ocamlbuild
(batteries.overrideAttrs (o: { doCheck = false; }))
menhir (oP.menhirLib or null) zarith camlidl apron yojson ]))
++ optionals devTools (with oP; [ merlin ])
;
}