depot/third_party/nixpkgs/pkgs/applications/science/logic/easycrypt/default.nix
Default email 504525a148 Project import generated by Copybara.
GitOrigin-RevId: bd645e8668ec6612439a9ee7e71f7eac4099d4f6
2024-01-02 12:29:13 +01:00

54 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub, ocamlPackages, why3, python3 }:
stdenv.mkDerivation rec {
pname = "easycrypt";
version = "2023.09";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "r${version}";
hash = "sha256-9xavU9jRisZekPqC87EyiLXtZCGu/9QeGzq6BJGt1+Y=";
};
nativeBuildInputs = with ocamlPackages; [
dune_3
findlib
menhir
ocaml
python3.pkgs.wrapPython
];
buildInputs = with ocamlPackages; [
batteries
dune-build-info
inifiles
yojson
zarith
];
propagatedBuildInputs = [ why3 ];
strictDeps = true;
postPatch = ''
substituteInPlace dune-project --replace '(name easycrypt)' '(name easycrypt)(version ${version})'
'';
pythonPath = with python3.pkgs; [ pyyaml ];
installPhase = ''
runHook preInstall
dune install --prefix $out ${pname}
rm $out/bin/ec-runtest
wrapPythonProgramsIn "$out/lib/easycrypt/commands" "$pythonPath"
runHook postInstall
'';
meta = {
license = lib.licenses.mit;
maintainers = [ lib.maintainers.vbgl ];
platforms = lib.platforms.all;
homepage = "https://easycrypt.info/";
description = "Computer-Aided Cryptographic Proofs";
};
}