@@ -0,0 +1,50 @@
1+{ lib, stdenv, fetchFromGitHub, ocamlPackages, why3 }:
2+
3+stdenv.mkDerivation rec {
4+ pname = "easycrypt";
5+ version = "2022.04";
6+
7+ src = fetchFromGitHub {
8+ owner = pname;
9+ repo = pname;
10+ rev = "r${version}";
11+ sha256 = "sha256:09rdwcj70lkamkhd895p284rfpz4bcnsf55mcimhiqncd2a21ml7";
12+ };
13+
14+ nativeBuildInputs = with ocamlPackages; [
15+ dune_3
16+ findlib
17+ menhir
18+ ocaml
19+ ];
20+ buildInputs = with ocamlPackages; [
21+ batteries
22+ dune-build-info
23+ inifiles
24+ yojson
25+ zarith
26+ ];
27+
28+ propagatedBuildInputs = [ why3 ];
29+
30+ strictDeps = true;
31+
32+ postPatch = ''
33+ substituteInPlace dune-project --replace '(name easycrypt)' '(name easycrypt)(version ${version})'
34+ '';
35+
36+ installPhase = ''
37+ runHook preInstall
38+ dune install --prefix $out ${pname}
39+ rm $out/bin/ec-runtest
40+ runHook postInstall
41+ '';
42+
43+ meta = {
44+ license = lib.licenses.mit;
45+ maintainers = [ lib.maintainers.vbgl ];
46+ platforms = lib.platforms.all;
47+ homepage = "https://easycrypt.info/";
48+ description = "Computer-Aided Cryptographic Proofs";
49+ };
50+}