2021-01-22 12:25:31 +01:00
|
|
|
{ lib, stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
|
2016-01-19 01:44:21 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "fstar";
|
2018-05-25 10:27:02 +02:00
|
|
|
version = "0.9.6.0";
|
2016-01-19 01:44:21 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "FStarLang";
|
|
|
|
repo = "FStar";
|
2016-03-13 09:32:28 +01:00
|
|
|
rev = "v${version}";
|
2018-05-25 10:27:02 +02:00
|
|
|
sha256 = "0wix7l229afkn6c6sk4nwkfq0nznsiqdkds4ixi2yyf72immwmmb";
|
2016-01-19 01:44:21 +01:00
|
|
|
};
|
|
|
|
|
2020-04-29 11:20:00 +02:00
|
|
|
nativeBuildInputs = [ makeWrapper installShellFiles ];
|
2016-03-13 09:32:28 +01:00
|
|
|
|
2016-01-19 01:44:21 +01:00
|
|
|
buildInputs = with ocamlPackages; [
|
2017-11-14 18:43:21 +01:00
|
|
|
z3 ocaml findlib batteries menhir stdint
|
2017-10-02 12:19:41 +02:00
|
|
|
zarith camlp4 yojson pprint
|
2018-05-25 10:27:02 +02:00
|
|
|
ulex ocaml-migrate-parsetree process ppx_deriving ppx_deriving_yojson ocamlbuild
|
2016-01-19 01:44:21 +01:00
|
|
|
];
|
|
|
|
|
2017-10-02 12:19:41 +02:00
|
|
|
makeFlags = [ "PREFIX=$(out)" ];
|
2016-01-19 01:44:21 +01:00
|
|
|
|
2017-10-02 12:19:41 +02:00
|
|
|
preBuild = ''
|
2017-05-10 10:33:16 +02:00
|
|
|
patchShebangs src/tools
|
|
|
|
patchShebangs bin
|
2016-01-19 01:44:21 +01:00
|
|
|
'';
|
2019-10-27 14:03:25 +01:00
|
|
|
buildFlags = [ "-C" "src/ocaml-output" ];
|
2016-01-19 01:44:21 +01:00
|
|
|
|
2018-05-25 10:27:02 +02:00
|
|
|
preInstall = ''
|
|
|
|
mkdir -p $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/fstarlib
|
|
|
|
'';
|
2019-10-27 14:03:25 +01:00
|
|
|
installFlags = [ "-C" "src/ocaml-output" ];
|
2016-01-19 01:44:21 +01:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/fstar.exe --prefix PATH ":" "${z3}/bin"
|
2020-04-29 11:20:00 +02:00
|
|
|
installShellCompletion --bash .completion/bash/fstar.exe.bash
|
|
|
|
installShellCompletion --fish .completion/fish/fstar.exe.fish
|
|
|
|
installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe
|
2016-01-19 01:44:21 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2016-01-19 01:44:21 +01:00
|
|
|
description = "ML-like functional programming language aimed at program verification";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://www.fstar-lang.org";
|
2016-01-19 01:44:21 +01:00
|
|
|
license = licenses.asl20;
|
2016-06-30 17:57:32 +02:00
|
|
|
platforms = with platforms; darwin ++ linux;
|
2017-10-02 12:19:41 +02:00
|
|
|
maintainers = with maintainers; [ gebner ];
|
2016-01-19 01:44:21 +01:00
|
|
|
};
|
|
|
|
}
|