diff options
author | Lorenz Leutgeb <lorenz@leutgeb.xyz> | 2020-08-15 07:37:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-15 07:37:38 +0200 |
commit | d50a6db016e7d4ccaa2f089d0928062b6eb16be1 (patch) | |
tree | b0a2afba5f828f450187555fb76236ea487ba295 | |
parent | 774db64cc69b468f691dd425758844e038e3bc41 (diff) |
z3: Add Java Bindings (#92096)
Introduce new arguments to build Java Bindings, and to disable
building of Python bindings. Default behaviour is preserved.
-rw-r--r-- | pkgs/applications/science/logic/z3/default.nix | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix index 170a56b95b91..53dfb84760e8 100644 --- a/pkgs/applications/science/logic/z3/default.nix +++ b/pkgs/applications/science/logic/z3/default.nix @@ -1,4 +1,12 @@ -{ stdenv, fetchFromGitHub, python, fixDarwinDylibNames }: +{ stdenv, fetchFromGitHub, python, fixDarwinDylibNames +, javaBindings ? false +, pythonBindings ? true +, jdk ? null +}: + +assert javaBindings -> jdk != null; + +with stdenv.lib; stdenv.mkDerivation rec { pname = "z3"; @@ -11,22 +19,23 @@ stdenv.mkDerivation rec { sha256 = "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q"; }; - buildInputs = [ python fixDarwinDylibNames ]; + buildInputs = [ python fixDarwinDylibNames ] ++ optional javaBindings jdk; propagatedBuildInputs = [ python.pkgs.setuptools ]; enableParallelBuilding = true; - configurePhase = '' - ${python.interpreter} scripts/mk_make.py --prefix=$out --python --pypkgdir=$out/${python.sitePackages} - cd build - ''; + configurePhase = concatStringsSep " " ( + [ "${python.interpreter} scripts/mk_make.py --prefix=$out" ] + ++ optional javaBindings "--java" + ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}" + ) + "\n" + "cd build"; postInstall = '' - mkdir -p $dev $lib $python/lib - - mv $out/lib/python* $python/lib/ - mv $out/lib $lib/lib - mv $out/include $dev/include - + mkdir -p $dev $lib + mv $out/lib $lib/lib + mv $out/include $dev/include + '' + optionalString pythonBindings '' + mkdir -p $python/lib + mv $lib/lib/python* $python/lib/ ln -sf $lib/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} $python/${python.sitePackages}/z3/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} ''; |