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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

74 lines
1.7 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";
2022-01-24 10:29:43 +00:00
version = "2022.01.15";
2016-01-19 00:44:21 +00:00
src = fetchFromGitHub {
owner = "FStarLang";
repo = "FStar";
rev = "v${version}";
2022-01-24 10:29:43 +00:00
sha256 = "sha256-bK3McF/wTjT9q6luihPaEXjx7Lu6+ZbQ9G61Mc4KoB0=";
2016-01-19 00:44:21 +00:00
};
strictDeps = true;
nativeBuildInputs = [
makeWrapper
installShellFiles
2021-08-25 21:42:21 +00:00
] ++ (with ocamlPackages; [
ocaml
findlib
ocamlbuild
menhir
]);
buildInputs = [
z3
] ++ (with ocamlPackages; [
2021-08-25 21:42:21 +00:00
batteries
zarith
stdint
yojson
fileutils
menhirLib
pprint
sedlex
2021-08-25 21:42:21 +00:00
ppxlib
ppx_deriving
ppx_deriving_yojson
process
]);
2016-01-19 00:44:21 +00:00
makeFlags = [ "PREFIX=$(out)" ];
2016-01-19 00:44:21 +00:00
2021-08-25 21:42:21 +00:00
buildFlags = [ "libs" ];
2021-10-04 15:34:32 +00:00
enableParallelBuilding = true;
2021-08-25 21:42:21 +00:00
postPatch = ''
patchShebangs ulib/gen_mllib.sh
substituteInPlace src/ocaml-output/Makefile --replace '$(COMMIT)' 'v${version}'
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
'';
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";
changelog = "https://github.com/FStarLang/FStar/raw/v${version}/CHANGES.md";
license = licenses.asl20;
2021-10-04 15:34:32 +00:00
maintainers = with maintainers; [ gebner pnmadelaine ];
mainProgram = "fstar.exe";
platforms = with platforms; darwin ++ linux;
2016-01-19 00:44:21 +00:00
};
}