2021-08-05 21:33:18 +00:00
|
|
|
{ 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"
|
|
|
|
"printf.v"
|
|
|
|
"quickprogram.v"
|
|
|
|
];
|
|
|
|
in
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
with lib; mkCoqDerivation {
|
2020-10-07 09:15:18 +00:00
|
|
|
pname = "coq${coq.coq-version}-VST";
|
2021-01-09 10:05:03 +00:00
|
|
|
namePrefix = [];
|
|
|
|
displayVersion = { coq = false; };
|
|
|
|
owner = "PrincetonUniversity";
|
|
|
|
repo = "VST";
|
|
|
|
inherit version;
|
2021-05-20 23:08:51 +00:00
|
|
|
defaultVersion = with versions; switch coq.coq-version [
|
2021-06-28 23:13:55 +00:00
|
|
|
{ case = range "8.12" "8.13"; out = "2.8"; }
|
2021-05-20 23:08:51 +00:00
|
|
|
] null;
|
2021-06-28 23:13:55 +00:00
|
|
|
release."2.8".sha256 = "sha256-cyK88uzorRfjapNQ6XgQEmlbWnDsiyLve5po1VG52q0=";
|
2021-01-09 10:05:03 +00:00
|
|
|
releaseRev = v: "v${v}";
|
2021-08-05 21:33:18 +00:00
|
|
|
extraBuildInputs = [ ITree ];
|
2020-10-07 09:15:18 +00:00
|
|
|
propagatedBuildInputs = [ compcert ];
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
preConfigure = ''
|
|
|
|
patchShebangs util
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace 'FLOYD_FILES=' 'FLOYD_FILES= ${toString extra_floyd_files}'
|
|
|
|
'';
|
2020-10-07 09:15:18 +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;
|
|
|
|
};
|
|
|
|
}
|