2020-04-24 23:36:52 +00:00
|
|
|
{ lib, stdenv, fetchurl, makeWrapper, writeText
|
|
|
|
, autoconf, ncurses, graphviz, doxygen
|
2020-11-09 15:59:12 +00:00
|
|
|
, ocamlPackages, ltl2ba, coq, why3
|
|
|
|
, gdk-pixbuf, wrapGAppsHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
mkocamlpath = p: "${p}/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib";
|
|
|
|
runtimeDeps = with ocamlPackages; [
|
2020-11-30 08:33:03 +00:00
|
|
|
apron.dev
|
2020-04-24 23:36:52 +00:00
|
|
|
biniou
|
|
|
|
camlzip
|
|
|
|
easy-format
|
2021-06-06 07:54:09 +00:00
|
|
|
menhirLib
|
2020-04-24 23:36:52 +00:00
|
|
|
mlgmpidl
|
|
|
|
num
|
|
|
|
ocamlgraph
|
2021-06-28 23:13:55 +00:00
|
|
|
stdlib-shims
|
2020-04-24 23:36:52 +00:00
|
|
|
why3
|
2021-06-28 23:13:55 +00:00
|
|
|
re
|
|
|
|
seq
|
|
|
|
sexplib
|
|
|
|
sexplib0
|
|
|
|
parsexp
|
|
|
|
base
|
2020-04-24 23:36:52 +00:00
|
|
|
yojson
|
|
|
|
zarith
|
|
|
|
];
|
|
|
|
ocamlpath = lib.concatMapStringsSep ":" mkocamlpath runtimeDeps;
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "frama-c";
|
2021-08-05 21:33:18 +00:00
|
|
|
version = "23.1";
|
2021-06-28 23:13:55 +00:00
|
|
|
slang = "Vanadium";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-07-14 22:03:04 +00:00
|
|
|
url = "https://frama-c.com/download/frama-c-${version}-${slang}.tar.gz";
|
2021-08-05 21:33:18 +00:00
|
|
|
sha256 = "1rgkq9sg436smw005ag0j6y3xryhjn18a07m5wjfrfp0s1438nnj";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
preConfigure = lib.optionalString stdenv.cc.isClang "configureFlagsArray=(\"--with-cpp=clang -E -C\")";
|
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
nativeBuildInputs = [ autoconf wrapGAppsHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildInputs = with ocamlPackages; [
|
2021-06-28 23:13:55 +00:00
|
|
|
ncurses ocaml findlib ltl2ba ocamlgraph ocamlgraph_gtk yojson menhirLib camlzip
|
2020-04-24 23:36:52 +00:00
|
|
|
lablgtk coq graphviz zarith apron why3 mlgmpidl doxygen
|
2020-11-09 15:59:12 +00:00
|
|
|
gdk-pixbuf
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-11-09 15:59:12 +00:00
|
|
|
preFixup = ''
|
|
|
|
gappsWrapperArgs+=(--prefix OCAMLPATH ':' ${ocamlpath})
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# Allow loading of external Frama-C plugins
|
|
|
|
setupHook = writeText "setupHook.sh" ''
|
|
|
|
addFramaCPath () {
|
|
|
|
if test -d "''$1/lib/frama-c/plugins"; then
|
2020-11-09 15:59:12 +00:00
|
|
|
export FRAMAC_PLUGIN="''${FRAMAC_PLUGIN-}''${FRAMAC_PLUGIN:+:}''$1/lib/frama-c/plugins"
|
|
|
|
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/frama-c/plugins"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -d "''$1/lib/frama-c"; then
|
2020-11-09 15:59:12 +00:00
|
|
|
export OCAMLPATH="''${OCAMLPATH-}''${OCAMLPATH:+:}''$1/lib/frama-c"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if test -d "''$1/share/frama-c/"; then
|
2020-11-09 15:59:12 +00:00
|
|
|
export FRAMAC_EXTRA_SHARE="''${FRAMAC_EXTRA_SHARE-}''${FRAMAC_EXTRA_SHARE:+:}''$1/share/frama-c"
|
2020-04-24 23:36:52 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
addEnvHooks "$targetOffset" addFramaCPath
|
|
|
|
'';
|
|
|
|
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "An extensible and collaborative platform dedicated to source-code analysis of C software";
|
|
|
|
homepage = "http://frama-c.com/";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.lgpl21;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice amiddelk ];
|
|
|
|
platforms = lib.platforms.unix;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|