nixpkgs/pkgs/applications/science/logic/z3/default.nix
Austin Seipp 75ab87edc8 nixpkgs: z3 is now MIT licensed.
It's also been moved to GitHub, meaning we can avoid some of the
hackiness in the original expression. This updates the Git revision, but
only so that it contains the proper license (it's otherwise equivalent
to Z3 v4.3.2)

Also, make sure the python API .py files exist besides the .pyc files.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2015-03-28 01:04:06 -05:00

42 lines
1.4 KiB
Nix

{ stdenv, fetchFromGitHub, python }:
stdenv.mkDerivation rec {
name = "z3-${version}";
version = "4.3.2";
src = fetchFromGitHub {
owner = "Z3Prover";
repo = "z3";
rev = "ac21ffebdf1512da2a77dc46c47bde87cc3850f3";
sha256 = "1y86akhpy41wx3gx7r8gvf7xbax7dj36ikj6gqh5a7p6r6maz9ci";
};
buildInputs = [ python ];
enableParallelBuilding = true;
configurePhase = "python scripts/mk_make.py --prefix=$out && 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
cp ../src/api/z3*.h $out/include
cp ../src/api/c++/z3*.h $out/include
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
cp ../src/api/python/*.py $out/lib/${python.libPrefix}/site-packages
'';
meta = {
description = "A high-performance theorem prover and SMT solver";
homepage = "http://github.com/Z3Prover/z3";
license = stdenv.lib.licenses.mit;
platforms = stdenv.lib.platforms.unix;
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
};
}