2015-03-27 23:46:35 +01:00
|
|
|
{ stdenv, fetchFromGitHub, python }:
|
2014-03-08 05:45:15 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "z3-${version}";
|
2015-01-23 17:41:55 +01:00
|
|
|
version = "4.3.2";
|
2015-03-27 23:46:35 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Z3Prover";
|
|
|
|
repo = "z3";
|
|
|
|
rev = "ac21ffebdf1512da2a77dc46c47bde87cc3850f3";
|
|
|
|
sha256 = "1y86akhpy41wx3gx7r8gvf7xbax7dj36ikj6gqh5a7p6r6maz9ci";
|
2014-03-08 05:45:15 +01:00
|
|
|
};
|
|
|
|
|
2015-03-27 23:46:35 +01:00
|
|
|
buildInputs = [ python ];
|
2014-03-08 05:45:15 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2015-03-27 23:46:35 +01:00
|
|
|
configurePhase = "python scripts/mk_make.py --prefix=$out && cd build";
|
2014-03-08 05:45:15 +01:00
|
|
|
|
|
|
|
# z3's install phase is stupid because it tries to calculate the
|
|
|
|
# python package store location itself, meaning it'll attempt to
|
|
|
|
# write files into the nix store, and fail.
|
|
|
|
soext = if stdenv.system == "x86_64-darwin" then ".dylib" else ".so";
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/lib/${python.libPrefix}/site-packages $out/include
|
2015-03-26 21:19:12 +01:00
|
|
|
cp ../src/api/z3*.h $out/include
|
|
|
|
cp ../src/api/c++/z3*.h $out/include
|
2014-03-08 05:45:15 +01:00
|
|
|
cp z3 $out/bin
|
|
|
|
cp libz3${soext} $out/lib
|
|
|
|
cp libz3${soext} $out/lib/${python.libPrefix}/site-packages
|
|
|
|
cp z3*.pyc $out/lib/${python.libPrefix}/site-packages
|
2015-03-27 23:46:35 +01:00
|
|
|
cp ../src/api/python/*.py $out/lib/${python.libPrefix}/site-packages
|
2014-03-08 05:45:15 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2015-01-23 17:41:55 +01:00
|
|
|
description = "A high-performance theorem prover and SMT solver";
|
2015-03-27 23:46:35 +01:00
|
|
|
homepage = "http://github.com/Z3Prover/z3";
|
|
|
|
license = stdenv.lib.licenses.mit;
|
2014-03-08 05:45:15 +01:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|