2016-09-19 19:00:42 +02:00
|
|
|
{ stdenv, lib, fetchurl
|
2017-02-20 21:09:53 +01:00
|
|
|
, coq, ocamlPackages
|
2015-07-15 19:14:18 +02:00
|
|
|
, tools ? stdenv.cc
|
|
|
|
}:
|
2014-05-02 02:09:37 +02:00
|
|
|
|
2017-02-20 21:09:53 +01:00
|
|
|
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
|
2016-09-19 19:00:42 +02:00
|
|
|
|
2014-05-02 02:09:37 +02:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "compcert-${version}";
|
2017-02-20 21:09:53 +01:00
|
|
|
version = "3.0.1";
|
2014-05-02 02:09:37 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://compcert.inria.fr/release/${name}.tgz";
|
2017-02-20 21:09:53 +01:00
|
|
|
sha256 = "0dgrj26dzdy4n3s9b5hwc6lm54vans1v4qx9hdp1q8w1qqcdriq9";
|
2014-05-02 02:09:37 +02:00
|
|
|
};
|
|
|
|
|
2017-02-20 21:09:53 +01:00
|
|
|
buildInputs = [ coq ]
|
|
|
|
++ (with ocamlPackages; [ ocaml findlib menhir ]);
|
2014-05-02 02:09:37 +02:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2014-12-17 19:11:30 +01:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
|
2017-02-01 01:03:12 +01:00
|
|
|
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
|
2014-07-01 23:43:27 +02:00
|
|
|
(if stdenv.isDarwin then "ia32-macosx" else "ia32-linux");
|
2014-05-02 02:09:37 +02:00
|
|
|
|
2015-07-15 19:14:18 +02: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-02-20 21:09:53 +01:00
|
|
|
mv backend cfrontend common cparser driver flocq x86 x86_32 lib \
|
2015-07-15 19:14:18 +02:00
|
|
|
$lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
|
|
|
|
'';
|
|
|
|
|
|
|
|
outputs = [ "out" "lib" ];
|
|
|
|
|
2014-10-06 00:07:34 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-05-02 02:09:37 +02:00
|
|
|
description = "Formally verified C compiler";
|
|
|
|
homepage = "http://compcert.inria.fr";
|
2014-10-06 00:07:34 +02:00
|
|
|
license = licenses.inria;
|
|
|
|
platforms = platforms.linux ++
|
|
|
|
platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
|
2014-05-02 02:09:37 +02:00
|
|
|
};
|
|
|
|
}
|