about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/cil/default.nix
blob: 9903c237e6323820021f97b9862be30b099774a0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
{ stdenv, fetchurl, perl, ocaml, findlib, ocamlbuild }:

if stdenv.lib.versionAtLeast ocaml.version "4.06"
then throw "cil is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation {
  name = "ocaml-cil-1.7.3";
  src = fetchurl {
    url = "mirror://sourceforge/cil/cil-1.7.3.tar.gz";
    sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9";
  };

  buildInputs = [ perl ocaml findlib ocamlbuild ];

  createFindlibDestdir = true;

  preConfigure = ''
    substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)'
    export FORCE_PERL_PREFIX=1
  '';
  prefixKey = "-prefix=";

  meta = with stdenv.lib; {
    homepage = "http://kerneis.github.io/cil/";
    description = "A front-end for the C programming language that facilitates program analysis and transformation";
    license = licenses.bsd3;
    maintainers = [ maintainers.vbgl ];
    platforms = ocaml.meta.platforms or [];
  };
}