nixpkgs/pkgs/development/compilers/compcert/default.nix
Vincent Laporte 475527adb7 compcert: 2.4 -> 2.5
Also installs the Coq library as a separate output.
2015-07-15 19:14:18 +02:00

44 lines
1.3 KiB
Nix

{ stdenv, fetchurl, coq, ocamlPackages
, tools ? stdenv.cc
}:
stdenv.mkDerivation rec {
name = "compcert-${version}";
version = "2.5";
src = fetchurl {
url = "http://compcert.inria.fr/release/${name}.tgz";
sha256 = "15gxarl2a8mz33fdn8pycj0ccazgmllbg2940n7aqdjlz807p11n";
};
buildInputs = [ coq ] ++ (with ocamlPackages; [ ocaml menhir ]);
enableParallelBuilding = true;
configurePhase = ''
substituteInPlace ./configure --replace '{toolprefix}gcc' '{toolprefix}cc'
./configure -prefix $out -toolprefix ${tools}/bin/ '' +
(if stdenv.isDarwin then "ia32-macosx" else "ia32-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 ia32 lib \
$lib/lib/coq/${coq.coq-version}/user-contrib/compcert/
'';
outputs = [ "out" "lib" ];
meta = with stdenv.lib; {
description = "Formally verified C compiler";
homepage = "http://compcert.inria.fr";
license = licenses.inria;
platforms = platforms.linux ++
platforms.darwin;
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
};
}