2015-01-23 16:41:55 +00:00
|
|
|
{ stdenv, fetchurl, python, unzip }:
|
2014-03-08 04:45:15 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "z3-${version}";
|
2015-01-23 16:41:55 +00:00
|
|
|
version = "4.3.2";
|
2014-03-08 04:45:15 +00:00
|
|
|
src = fetchurl {
|
2015-01-23 16:41:55 +00:00
|
|
|
url = "http://download-codeplex.sec.s-msft.com/Download/SourceControlFileDownload.ashx\?ProjectName\=z3\&changeSetId\=cee7dd39444c9060186df79c2a2c7f8845de415b";
|
2014-03-08 04:45:15 +00:00
|
|
|
name = "${name}.zip";
|
2015-01-23 16:41:55 +00:00
|
|
|
sha256 = "0hagy7xm0m52jd6vlrbizkj24mn6c49hkb3r5p66wilvp15ivpbn";
|
2014-03-08 04:45:15 +00:00
|
|
|
};
|
|
|
|
|
2015-01-23 16:41:55 +00:00
|
|
|
buildInputs = [ python unzip ];
|
2014-03-08 04:45:15 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
# The zip file doesn't unpack a directory, just the code itself.
|
|
|
|
unpackPhase = "mkdir ${name} && cd ${name} && unzip $src";
|
2015-01-23 16:41:55 +00:00
|
|
|
|
|
|
|
configurePhase = ''
|
|
|
|
python scripts/mk_make.py --prefix=$out
|
2014-03-08 04:45:15 +00:00
|
|
|
cd build
|
|
|
|
'';
|
|
|
|
|
|
|
|
# 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 20:19:12 +00:00
|
|
|
cp ../src/api/z3*.h $out/include
|
|
|
|
cp ../src/api/c++/z3*.h $out/include
|
2014-03-08 04:45:15 +00: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
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
2015-01-23 16:41:55 +00:00
|
|
|
description = "A high-performance theorem prover and SMT solver";
|
2014-03-08 04:45:15 +00:00
|
|
|
homepage = "http://z3.codeplex.com";
|
2014-05-02 01:09:24 +01:00
|
|
|
license = stdenv.lib.licenses.msrla;
|
2014-03-08 04:45:15 +00:00
|
|
|
platforms = stdenv.lib.platforms.unix;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|