2016-09-19 17:00:42 +00:00
|
|
|
{ stdenv, lib, fetchurl
|
|
|
|
, coq, ocaml, findlib, menhir
|
2015-07-15 17:14:18 +00:00
|
|
|
, tools ? stdenv.cc
|
|
|
|
}:
|
2014-05-02 00:09:37 +00:00
|
|
|
|
2016-09-19 17:00:42 +00:00
|
|
|
assert lib.versionAtLeast ocaml.version "4.02";
|
|
|
|
|
2014-05-02 00:09:37 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "compcert-${version}";
|
2016-08-13 23:03:16 +00:00
|
|
|
version = "2.7.1";
|
2014-05-02 00:09:37 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://compcert.inria.fr/release/${name}.tgz";
|
2016-08-13 23:03:16 +00:00
|
|
|
sha256 = "1vhbs1fmr9x2imqyd6yfvkbz763jhjfm9wk4nizf9rn1cvxrjqa4";
|
2014-05-02 00:09:37 +00:00
|
|
|
};
|
|
|
|
|
2016-09-19 17:00:42 +00:00
|
|
|
buildInputs = [ coq ocaml findlib menhir ];
|
2014-05-02 00:09:37 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
2014-12-17 18:11:30 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
2016-10-31 18:10:30 +00:00
|
|
|
substituteInPlace ./configure --replace pl2 pl3
|
2014-12-17 18:11:30 +00:00
|
|
|
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
|
2017-02-01 00:03:12 +00:00
|
|
|
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
|
2014-07-01 21:43:27 +00:00
|
|
|
(if stdenv.isDarwin then "ia32-macosx" else "ia32-linux");
|
2014-05-02 00:09:37 +00:00
|
|
|
|
2015-07-15 17:14:18 +00: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 22:07:34 +00:00
|
|
|
meta = with stdenv.lib; {
|
2014-05-02 00:09:37 +00:00
|
|
|
description = "Formally verified C compiler";
|
|
|
|
homepage = "http://compcert.inria.fr";
|
2014-10-05 22:07:34 +00:00
|
|
|
license = licenses.inria;
|
|
|
|
platforms = platforms.linux ++
|
|
|
|
platforms.darwin;
|
|
|
|
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
|
2014-05-02 00:09:37 +00:00
|
|
|
};
|
|
|
|
}
|