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