mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-28 09:53:10 +00:00
8fde5790b4
The license of CompCert is not a generic "INRIA" license. It is "INRIA Non-Commercial Agreement for the CompCert verified compiler". As unfortunate as it may seem, this is a non-free license (clearly mentioned as such in its preamble). See also #20256.
49 lines
1.4 KiB
Nix
49 lines
1.4 KiB
Nix
{ stdenv, lib, fetchurl
|
|
, coq, ocamlPackages
|
|
, tools ? stdenv.cc
|
|
}:
|
|
|
|
assert lib.versionAtLeast ocamlPackages.ocaml.version "4.02";
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "compcert-${version}";
|
|
version = "3.1";
|
|
|
|
src = fetchurl {
|
|
url = "http://compcert.inria.fr/release/${name}.tgz";
|
|
sha256 = "0irfwlw2chalp0g2gw0makc699hn3z37sha1a239p9d90mzx03cx";
|
|
};
|
|
|
|
buildInputs = [ coq ]
|
|
++ (with ocamlPackages; [ ocaml findlib menhir ]);
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
configurePhase = ''
|
|
substituteInPlace VERSION --replace '3.0.1' '3.1'
|
|
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" ];
|
|
|
|
meta = with stdenv.lib; {
|
|
description = "Formally verified C compiler";
|
|
homepage = "http://compcert.inria.fr";
|
|
license = licenses.inria-compcert;
|
|
platforms = platforms.linux ++
|
|
platforms.darwin;
|
|
maintainers = with maintainers; [ thoughtpolice jwiegley vbgl ];
|
|
};
|
|
}
|