3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/development/compilers/compcert/default.nix

48 lines
1.4 KiB
Nix
Raw Normal View History

2018-08-05 20:14:55 +01:00
{ stdenv, lib, fetchurl, fetchpatch
2018-09-17 18:50:38 +01:00
, coq, ocamlPackages, coq2html
, tools ? stdenv.cc
}:
2017-02-20 20:09:53 +00:00
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
2016-09-19 18:00:42 +01:00
stdenv.mkDerivation rec {
name = "compcert-${version}";
2018-09-17 18:50:38 +01:00
version = "3.4";
src = fetchurl {
url = "http://compcert.inria.fr/release/${name}.tgz";
2018-09-17 18:50:38 +01:00
sha256 = "12gchwvkzhd2bhrnwzfb4a06wc4hgv98z987k06vj7ga31ii763h";
};
2018-09-17 18:50:38 +01:00
buildInputs = [ coq coq2html ]
2017-02-20 20:09:53 +00:00
++ (with ocamlPackages; [ ocaml findlib menhir ]);
enableParallelBuilding = true;
configurePhase = ''
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
./configure -clightgen -prefix $out -toolprefix ${tools}/bin/ '' +
(if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux");
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 x86 x86_64 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; {
description = "Formally verified C compiler";
homepage = "http://compcert.inria.fr";
license = licenses.inria-compcert;
2014-10-05 23:07:34 +01:00
platforms = platforms.linux ++
platforms.darwin;
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
};
}