z3: Add Java Bindings (#92096)
Introduce new arguments to build Java Bindings, and to disable building of Python bindings. Default behaviour is preserved.
This commit is contained in:
parent
774db64cc6
commit
d50a6db016
@ -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 {
|
stdenv.mkDerivation rec {
|
||||||
pname = "z3";
|
pname = "z3";
|
||||||
@ -11,22 +19,23 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q";
|
sha256 = "0hprcdwhhyjigmhhk6514m71bnmvqci9r8gglrqilgx424r6ff7q";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [ python fixDarwinDylibNames ];
|
buildInputs = [ python fixDarwinDylibNames ] ++ optional javaBindings jdk;
|
||||||
propagatedBuildInputs = [ python.pkgs.setuptools ];
|
propagatedBuildInputs = [ python.pkgs.setuptools ];
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = concatStringsSep " " (
|
||||||
${python.interpreter} scripts/mk_make.py --prefix=$out --python --pypkgdir=$out/${python.sitePackages}
|
[ "${python.interpreter} scripts/mk_make.py --prefix=$out" ]
|
||||||
cd build
|
++ optional javaBindings "--java"
|
||||||
'';
|
++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
|
||||||
|
) + "\n" + "cd build";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
mkdir -p $dev $lib $python/lib
|
mkdir -p $dev $lib
|
||||||
|
|
||||||
mv $out/lib/python* $python/lib/
|
|
||||||
mv $out/lib $lib/lib
|
mv $out/lib $lib/lib
|
||||||
mv $out/include $dev/include
|
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}
|
ln -sf $lib/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} $python/${python.sitePackages}/z3/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user