nixpkgs/pkgs/development/coq-modules/VST/default.nix

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

66 lines
2.0 KiB
Nix
Raw Normal View History

{ lib, mkCoqDerivation, coq, compcert, ITree, version ? null }:
# A few modules that are not built and installed by default
# but that may be useful to some users.
# They depend on ITree.
let extra_floyd_files = [
"ASTsize.v"
"io_events.v"
"powerlater.v"
2022-02-09 05:19:54 +00:00
]
# floyd/printf.v is broken in VST 2.9
++ lib.optional (!lib.versions.isGe "8.13" coq.coq-version) "printf.v"
2022-02-09 05:19:54 +00:00
++ [
"quickprogram.v"
];
in
2020-09-28 21:04:32 +00:00
2022-02-09 05:19:54 +00:00
mkCoqDerivation {
2020-09-28 21:04:32 +00:00
pname = "coq${coq.coq-version}-VST";
2020-08-28 21:05:46 +00:00
namePrefix = [];
displayVersion = { coq = false; };
owner = "PrincetonUniversity";
repo = "VST";
inherit version;
defaultVersion = with lib.versions; lib.switch coq.coq-version [
2022-12-13 16:23:35 +00:00
{ case = range "8.15" "8.16"; out = "2.11.1"; }
2022-10-04 07:40:10 +00:00
{ case = range "8.14" "8.16"; out = "2.10"; }
2022-02-09 05:19:54 +00:00
{ case = range "8.13" "8.15"; out = "2.9"; }
2021-06-16 05:50:50 +00:00
{ case = range "8.12" "8.13"; out = "2.8"; }
2021-04-30 06:49:33 +00:00
] null;
2022-12-13 16:23:35 +00:00
release."2.11.1".sha256 = "sha256-unpNstZBnRT4dIqAYOv9n1J0tWJMeRuaaa2RG1U0Xs0=";
release."2.10".sha256 = "sha256-RIxfPWoHnV1CFkpxCusoGY/LIk07TgC7wWGRP4BSq8w=";
2022-02-09 05:19:54 +00:00
release."2.9".sha256 = "sha256:1adwzbl1pprrrwrm7cm493098fizxanxpv7nyfbvwdhgbhcnv6qf";
2021-06-16 05:50:50 +00:00
release."2.8".sha256 = "sha256-cyK88uzorRfjapNQ6XgQEmlbWnDsiyLve5po1VG52q0=";
2020-08-28 21:05:46 +00:00
releaseRev = v: "v${v}";
buildInputs = [ ITree ];
2020-09-28 21:04:32 +00:00
propagatedBuildInputs = [ compcert ];
preConfigure = ''
patchShebangs util
substituteInPlace Makefile \
--replace 'COQVERSION= ' 'COQVERSION= 8.16.1 or-else 8.16.0 or-else 8.15.2 or-else 8.15.1 or-else '\
--replace 'FLOYD_FILES=' 'FLOYD_FILES= ${toString extra_floyd_files}'
'';
2020-09-28 21:04:32 +00:00
makeFlags = [
"BITSIZE=64"
"COMPCERT=inst_dir"
"COMPCERT_INST_DIR=${compcert.lib}/lib/coq/${coq.coq-version}/user-contrib/compcert"
"INSTALLDIR=$(out)/lib/coq/${coq.coq-version}/user-contrib/VST"
];
postInstall = ''
for d in msl veric floyd sepcomp progs64
do
cp -r $d $out/lib/coq/${coq.coq-version}/user-contrib/VST/
done
'';
meta = {
description = "Verified Software Toolchain";
homepage = "https://vst.cs.princeton.edu/";
inherit (compcert.meta) platforms;
};
}