summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/science/logic
diff options
context:
space:
mode:
authorVincent Laporte <Vincent.Laporte@gmail.com>2020-09-27 17:30:34 +0200
committerVincent Laporte <vbgl@users.noreply.github.com>2020-09-30 22:03:17 +0200
commitcc739e1c67c31fec7483137f352d32e093e40b28 (patch)
treed358cd5fd463f6cf51013c0ee3f91003299b3a4f /pkgs/applications/science/logic
parent0c56c7357f9d27706b7febe057ce4b66cb265c98 (diff)
ocamlPackages.z3: init at 4.8.9
Diffstat (limited to 'pkgs/applications/science/logic')
-rw-r--r--pkgs/applications/science/logic/z3/default.nix18
1 files changed, 16 insertions, 2 deletions
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
index 84c1544071ff..88aafcdae222 100644
--- a/pkgs/applications/science/logic/z3/default.nix
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -1,10 +1,13 @@
{ stdenv, fetchFromGitHub, python, fixDarwinDylibNames
, javaBindings ? false
+, ocamlBindings ? false
, pythonBindings ? true
, jdk ? null
+, ocaml ? null, findlib ? null, zarith ? null
}:
assert javaBindings -> jdk != null;
+assert ocamlBindings -> ocaml != null && findlib != null && zarith != null;
with stdenv.lib;
@@ -19,13 +22,22 @@ stdenv.mkDerivation rec {
sha256 = "1hnbzq10d23drd7ksm3c1n2611c3kd0q0yxgz8y78zaafwczvwxx";
};
- buildInputs = [ python fixDarwinDylibNames ] ++ optional javaBindings jdk;
+ buildInputs = [ python fixDarwinDylibNames ]
+ ++ optional javaBindings jdk
+ ++ optionals ocamlBindings [ ocaml findlib zarith ]
+ ;
propagatedBuildInputs = [ python.pkgs.setuptools ];
enableParallelBuilding = true;
+ postPatch = optionalString ocamlBindings ''
+ export OCAMLFIND_DESTDIR=$ocaml/lib/ocaml/${ocaml.version}/site-lib
+ mkdir -p $OCAMLFIND_DESTDIR/stublibs
+ '';
+
configurePhase = concatStringsSep " " (
[ "${python.interpreter} scripts/mk_make.py --prefix=$out" ]
++ optional javaBindings "--java"
+ ++ optional ocamlBindings "--ml"
++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
) + "\n" + "cd build";
@@ -39,7 +51,9 @@ stdenv.mkDerivation rec {
ln -sf $lib/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} $python/${python.sitePackages}/z3/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary}
'';
- outputs = [ "out" "lib" "dev" "python" ];
+ outputs = [ "out" "lib" "dev" "python" ]
+ ++ optional ocamlBindings "ocaml"
+ ;
meta = {
description = "A high-performance theorem prover and SMT solver";