From 4672fa43d95e96fa91bf341d5ec64ca97a4b65cf Mon Sep 17 00:00:00 2001 From: Aistis Raulinaitis Date: Fri, 8 May 2015 23:45:07 -0700 Subject: [PATCH] z3 opt --- lib/maintainers.nix | 1 + .../science/logic/z3_opt/default.nix | 44 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 + 3 files changed, 46 insertions(+) create mode 100644 pkgs/applications/science/logic/z3_opt/default.nix diff --git a/lib/maintainers.nix b/lib/maintainers.nix index 6f4a7be21f6e..6906abd2c78c 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -184,6 +184,7 @@ schmitthenner = "Fabian Schmitthenner "; schristo = "Scott Christopher "; sepi = "Raffael Mancini "; + sheganinans = "Aistis Raulinaitis "; shell = "Shell Turner "; shlevy = "Shea Levy "; simons = "Peter Simons "; diff --git a/pkgs/applications/science/logic/z3_opt/default.nix b/pkgs/applications/science/logic/z3_opt/default.nix new file mode 100644 index 000000000000..b4d8fbc95298 --- /dev/null +++ b/pkgs/applications/science/logic/z3_opt/default.nix @@ -0,0 +1,44 @@ +{ stdenv, fetchFromGitHub, python }: + +# Copied shamelessly from the normal z3 .nix + +stdenv.mkDerivation rec { + name = "z3_opt-${version}"; + version = "4.3.2"; + + src = fetchFromGitHub { + owner = "Z3Prover"; + repo = "z3"; + rev = "9377779e5818b2ca15c4f39921b2ba3a42f948e7"; + sha256 = "15d6hsb61hrm5vy3l2gnkrfnqr68lvspnznm17vyhm61ld33yaff"; + }; + + 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, optimization edition"; + homepage = "http://github.com/Z3Prover/z3"; + license = stdenv.lib.licenses.mit; + platforms = stdenv.lib.platforms.unix; + maintainers = with stdenv.lib.maintainers; [ thoughtpolice sheganinans ]; + }; +} + diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 42533636ed5e..de29fff28e61 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13817,6 +13817,7 @@ let yices = callPackage ../applications/science/logic/yices {}; z3 = callPackage ../applications/science/logic/z3 {}; + z3_opt = callPackage ../applications/science/logic/z3_opt {}; boolector = boolector15; boolector15 = callPackage ../applications/science/logic/boolector {};