2021-01-15 22:18:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, perl, ocaml, findlib, ocamlbuild }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
if lib.versionAtLeast ocaml.version "4.06"
|
2020-04-24 23:36:52 +00:00
|
|
|
then throw "cil is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "ocaml-cil";
|
|
|
|
version = "1.7.3";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchurl {
|
2021-12-06 16:07:01 +00:00
|
|
|
url = "mirror://sourceforge/cil/cil-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "05739da0b0msx6kmdavr3y2bwi92jbh3szc35d7d8pdisa8g5dv9";
|
|
|
|
};
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ perl ocaml findlib ocamlbuild ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
substituteInPlace Makefile.in --replace 'MACHDEPCC=gcc' 'MACHDEPCC=$(CC)'
|
|
|
|
export FORCE_PERL_PREFIX=1
|
|
|
|
'';
|
|
|
|
prefixKey = "-prefix=";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
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 ];
|
2021-12-06 16:07:01 +00:00
|
|
|
platforms = ocaml.meta.platforms or [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|