2015-07-15 18:14:18 +01:00
|
|
|
{ stdenv, fetchurl, coq, ocamlPackages
|
|
|
|
, tools ? stdenv.cc
|
|
|
|
}:
|
2014-05-02 01:09:37 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "compcert-${version}";
|
2015-07-15 18:14:18 +01:00
|
|
|
version = "2.5";
|
2014-05-02 01:09:37 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://compcert.inria.fr/release/${name}.tgz";
|
2015-07-15 18:14:18 +01:00
|
|
|
sha256 = "15gxarl2a8mz33fdn8pycj0ccazgmllbg2940n7aqdjlz807p11n";
|
2014-05-02 01:09:37 +01:00
|
|
|
};
|
|
|
|
|
2015-07-15 18:14:18 +01:00
|
|
|
buildInputs = [ coq ] ++ (with ocamlPackages; [ ocaml menhir ]);
|
2014-05-02 01:09:37 +01:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2014-12-17 18:11:30 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
|
2015-07-15 18:14:18 +01:00
|
|
|
./configure -prefix $out -toolprefix ${tools}/bin/ '' +
|
2014-07-01 22:43:27 +01:00
|
|
|
(if stdenv.isDarwin then "ia32-macosx" else "ia32-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/
|
|
|
|
mv backend cfrontend common cparser driver flocq ia32 lib \
|
|
|
|
$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";
|
2014-10-05 23:07:34 +01:00
|
|
|
license = licenses.inria;
|
|
|
|
platforms = platforms.linux ++
|
|
|
|
platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
|
2014-05-02 01:09:37 +01:00
|
|
|
};
|
|
|
|
}
|