nixpkgs/pkgs/development/compilers/fstar/default.nix

49 lines
1.5 KiB
Nix
Raw Normal View History

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