2016-09-19 18:00:42 +01:00
|
|
|
{ stdenv, lib, fetchurl
|
2017-02-20 20:09:53 +00:00
|
|
|
, coq, ocamlPackages
|
2015-07-15 18:14:18 +01:00
|
|
|
, tools ? stdenv.cc
|
|
|
|
}:
|
2014-05-02 01:09:37 +01:00
|
|
|
|
2017-02-20 20:09:53 +00:00
|
|
|
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
|
2016-09-19 18:00:42 +01:00
|
|
|
|
2014-05-02 01:09:37 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "compcert-${version}";
|
2018-02-13 22:26:39 +00:00
|
|
|
version = "3.2";
|
2014-05-02 01:09:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://compcert.inria.fr/release/${name}.tgz";
|
2018-02-13 22:26:39 +00:00
|
|
|
sha256 = "11q4121s0rxva63njjwya7syfx9w0p4hzr6avh8s57vfbrcakc93";
|
2014-05-02 01:09:37 +01:00
|
|
|
};
|
|
|
|
|
2017-02-20 20:09:53 +00:00
|
|
|
buildInputs = [ coq ]
|
|
|
|
++ (with ocamlPackages; [ ocaml findlib menhir ]);
|
2014-05-02 01:09:37 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2014-12-17 18:11:30 +00:00
|
|
|
|
2018-02-16 22:09:43 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i -e 's/8\.6\.1|8\.7\.0|8\.7\.1)/8.6.1|8.7.0|8.7.1|8.7.2)/' configure
|
|
|
|
'';
|
|
|
|
|
2014-12-17 18:11:30 +00:00
|
|
|
configurePhase = ''
|
|
|
|
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
|
2017-02-01 00:03:12 +00:00
|
|
|
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
|
2017-07-17 16:20:47 +01:00
|
|
|
(if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux");
|
2014-05-02 01:09:37 +01:00
|
|
|
|
2015-07-15 18:14:18 +01:00
|
|
|
installTargets = "documentation install";
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p $lib/share/doc/compcert
|
|
|
|
mv doc/html $lib/share/doc/compcert/
|
|
|
|
mkdir -p $lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
|
2017-07-17 16:20:47 +01:00
|
|
|
mv backend cfrontend common cparser driver flocq x86 x86_64 lib \
|
2015-07-15 18:14:18 +01:00
|
|
|
$lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" ];
|
|
|
|
|
2014-10-05 23:07:34 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-05-02 01:09:37 +01:00
|
|
|
description = "Formally verified C compiler";
|
|
|
|
homepage = "http://compcert.inria.fr";
|
2017-09-21 14:24:17 +01:00
|
|
|
license = licenses.inria-compcert;
|
2014-10-05 23:07:34 +01:00
|
|
|
platforms = platforms.linux ++
|
|
|
|
platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
|
2014-05-02 01:09:37 +01:00
|
|
|
};
|
|
|
|
}
|