2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fstar";
|
2022-01-25 03:21:06 +00:00
|
|
|
version = "2022.01.15";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FStarLang";
|
|
|
|
repo = "FStar";
|
|
|
|
rev = "v${version}";
|
2022-01-25 03:21:06 +00:00
|
|
|
sha256 = "sha256-bK3McF/wTjT9q6luihPaEXjx7Lu6+ZbQ9G61Mc4KoB0=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
installShellFiles
|
2021-08-27 14:25:00 +00:00
|
|
|
] ++ (with ocamlPackages; [
|
|
|
|
ocaml
|
|
|
|
findlib
|
|
|
|
ocamlbuild
|
2022-03-05 16:20:37 +00:00
|
|
|
menhir
|
|
|
|
]);
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
z3
|
|
|
|
] ++ (with ocamlPackages; [
|
2021-08-27 14:25:00 +00:00
|
|
|
batteries
|
|
|
|
zarith
|
|
|
|
stdint
|
|
|
|
yojson
|
|
|
|
fileutils
|
|
|
|
menhirLib
|
|
|
|
pprint
|
2022-06-16 17:23:12 +00:00
|
|
|
sedlex
|
2021-08-27 14:25:00 +00:00
|
|
|
ppxlib
|
|
|
|
ppx_deriving
|
|
|
|
ppx_deriving_yojson
|
|
|
|
process
|
|
|
|
]);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
buildFlags = [ "libs" ];
|
|
|
|
|
2021-10-06 13:57:05 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-08-27 14:25:00 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs ulib/gen_mllib.sh
|
|
|
|
substituteInPlace src/ocaml-output/Makefile --replace '$(COMMIT)' 'v${version}'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/fstarlib
|
|
|
|
'';
|
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/fstar.exe --prefix PATH ":" "${z3}/bin"
|
2020-05-03 17:38:23 +00:00
|
|
|
installShellCompletion --bash .completion/bash/fstar.exe.bash
|
|
|
|
installShellCompletion --fish .completion/fish/fstar.exe.fish
|
|
|
|
installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "ML-like functional programming language aimed at program verification";
|
|
|
|
homepage = "https://www.fstar-lang.org";
|
2021-09-18 10:52:07 +00:00
|
|
|
changelog = "https://github.com/FStarLang/FStar/raw/v${version}/CHANGES.md";
|
2022-05-18 14:49:53 +00:00
|
|
|
license = licenses.asl20;
|
2021-10-06 13:57:05 +00:00
|
|
|
maintainers = with maintainers; [ gebner pnmadelaine ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "fstar.exe";
|
|
|
|
platforms = with platforms; darwin ++ linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|