nixpkgs/pkgs/development/ocaml-modules/z3/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

36 lines
844 B
Nix
Raw Normal View History

2022-01-13 14:42:04 +00:00
{ stdenv, lib, ocaml, findlib, zarith, z3 }:
2020-09-27 15:30:34 +00:00
if lib.versionOlder ocaml.version "4.07"
2022-01-13 14:42:04 +00:00
then throw "z3 is not available for OCaml ${ocaml.version}"
else
let z3-with-ocaml = (z3.override {
2020-09-27 15:30:34 +00:00
ocamlBindings = true;
inherit ocaml findlib zarith;
2022-01-13 14:42:04 +00:00
}); in
2020-09-27 15:30:34 +00:00
stdenv.mkDerivation {
pname = "ocaml${ocaml.version}-z3";
inherit (z3-with-ocaml) version;
2021-08-02 20:15:16 +00:00
dontUnpack = true;
2020-09-27 15:30:34 +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
'';
nativeBuildInputs = [ findlib ];
2020-09-27 15:30:34 +00:00
propagatedBuildInputs = [ zarith ];
strictDeps = true;
2020-09-27 15:30:34 +00:00
meta = z3.meta // {
description = "Z3 Theorem Prover (OCaml API)";
};
}