1{
2 lib,
3 stdenv,
4 fetchurl,
5 perl,
6 ocaml,
7 findlib,
8 ocamlbuild,
9}:
10
11if lib.versionAtLeast ocaml.version "4.06" then
12 throw "cil is not available for OCaml ${ocaml.version}"
13else
14
15 stdenv.mkDerivation rec {
16 pname = "ocaml-cil";
17 version = "1.7.3";
18
19 src = fetchurl {
20 url = "mirror://sourceforge/cil/cil-${version}.tar.gz";
21 sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9";
22 };
23
24 nativeBuildInputs = [
25 perl
26 ocaml
27 findlib
28 ocamlbuild
29 ];
30
31 strictDeps = true;
32
33 createFindlibDestdir = true;
34
35 preConfigure = ''
36 substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)'
37 export FORCE_PERL_PREFIX=1
38 '';
39 prefixKey = "-prefix=";
40
41 meta = with lib; {
42 homepage = "https://sourceforge.net/projects/cil/";
43 description = "Front-end for the C programming language that facilitates program analysis and transformation";
44 license = licenses.bsd3;
45 maintainers = [ maintainers.vbgl ];
46 platforms = ocaml.meta.platforms or [ ];
47 };
48 }