We are hiring ! See our job offers.
https://github.com/EasyCrypt/easycrypt
Raw File
Tip revision: 7d3e818caa68b1e2456f4ec140261a0a890a6948 authored by Fran├žois Dupressoir on 22 July 2022, 14:34:38 UTC
workflow to compile with nix
Tip revision: 7d3e818
default.nix
{ provers ? []
, devDeps ? []
, testDeps ? false
}:

let
  version = "git";
  src = ./.;
in

with import <nixpkgs> {};

let inherit (lib) optionals; in

let runtest = optionals testDeps (python3Packages.buildPythonApplication rec {
  pname = "easycrypt-runtest";
  inherit src version;

  dontConfigure = true;
  dontBuild = true;
  doCheck = false;

  pythonPath = with python3Packages; [ pyyaml ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/bin
    cp scripts/testing/runtest $out/bin/ec-runtest
    runHook postInstall
  '';
}); in

stdenv.mkDerivation {
  pname = "easycrypt";
  inherit version src;

  buildInputs = [ git ] ++ (with ocamlPackages; [
      ocaml
      findlib
      batteries
      camlp-streams
      dune_2
      dune-build-info
      dune-site
      inifiles
      menhir
      menhirLib
      merlin
      yojson
      zarith
  ]);
  propagatedBuildInputs = [ why3 runtest ]
    ++ devDeps
    ++ provers;

  installPhase = ''
    runHook preInstall
    dune install --prefix $out -p $pname
    rm $out/bin/ec-runtest
    runHook postInstall
  '';

  passthru = {
    inherit runtest;
  };
}
back to top