2022-01-19 23:45:15 +00:00
|
|
|
{ stdenv, lib, ocaml, findlib, zarith, z3 }:
|
2020-10-07 09:15:18 +00:00
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
if lib.versionOlder ocaml.version "4.07"
|
2022-01-19 23:45:15 +00:00
|
|
|
then throw "z3 is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
let z3-with-ocaml = (z3.override {
|
2020-10-07 09:15:18 +00:00
|
|
|
ocamlBindings = true;
|
|
|
|
inherit ocaml findlib zarith;
|
2022-01-19 23:45:15 +00:00
|
|
|
}); in
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
|
|
|
pname = "ocaml${ocaml.version}-z3";
|
|
|
|
inherit (z3-with-ocaml) version;
|
|
|
|
|
2021-08-08 23:34:03 +00:00
|
|
|
dontUnpack = true;
|
2020-10-07 09:15:18 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $OCAMLFIND_DESTDIR
|
|
|
|
cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/stublibs $OCAMLFIND_DESTDIR
|
|
|
|
cp -r ${z3-with-ocaml.ocaml}/lib/ocaml/${ocaml.version}/site-lib/Z3 $OCAMLFIND_DESTDIR/z3
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
nativeBuildInputs = [ findlib ];
|
2020-10-07 09:15:18 +00:00
|
|
|
propagatedBuildInputs = [ zarith ];
|
|
|
|
|
2022-03-05 16:20:37 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2020-10-07 09:15:18 +00:00
|
|
|
meta = z3.meta // {
|
|
|
|
description = "Z3 Theorem Prover (OCaml API)";
|
|
|
|
};
|
|
|
|
}
|