From 8205e12a453fc941cebc33e6ca9e40a5677406aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Sat, 3 Oct 2020 21:32:22 +0200 Subject: [PATCH 1/2] z3_4_4_0: add old version for Isabelle --- pkgs/applications/science/logic/z3/4.4.0.nix | 41 ++++++++++++++++++++ pkgs/top-level/all-packages.nix | 4 ++ 2 files changed, 45 insertions(+) create mode 100644 pkgs/applications/science/logic/z3/4.4.0.nix diff --git a/pkgs/applications/science/logic/z3/4.4.0.nix b/pkgs/applications/science/logic/z3/4.4.0.nix new file mode 100644 index 000000000000..1e3bcea42ef7 --- /dev/null +++ b/pkgs/applications/science/logic/z3/4.4.0.nix @@ -0,0 +1,41 @@ +{ stdenv, fetchFromGitHub, python }: + +stdenv.mkDerivation rec { + name = "z3-${version}"; + version = "4.4.0"; + + src = fetchFromGitHub { + owner = "Z3Prover"; + repo = "z3"; + rev = "7f6ef0b6c0813f2e9e8f993d45722c0e5b99e152"; + sha256 = "1xllvq9fcj4cz34biq2a9dn2sj33bdgrzyzkj26hqw70wkzv1kzx"; + }; + + 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.x86_64; + maintainers = with stdenv.lib.maintainers; [ thoughtpolice ttuegel ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 96fead21bfab..c1e75cadc83f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26440,6 +26440,10 @@ in }; z3 = callPackage ../applications/science/logic/z3 { python = python2; }; + z3_4_4_0 = callPackage ../applications/science/logic/z3/4.4.0.nix { + python = python2; + stdenv = gcc49Stdenv; + }; z3-tptp = callPackage ../applications/science/logic/z3/tptp.nix {}; tlaplus = callPackage ../applications/science/logic/tlaplus { From d9003bfd568848ec1daa380aa425ee202b87c835 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20K=C4=85dzio=C5=82ka?= Date: Sat, 3 Oct 2020 21:33:53 +0200 Subject: [PATCH 2/2] isabelle: build with z3 4.4.0 Isabelle uses Z3 in a non-forwards-compatible manner, as it needs to consume the proof objects Z3 produces. Building Isabelle with newer Z3 causes errors when trying to build a session that depends on HOL-Library. Try $ isabelle jedit -l HOL-Library Fixes #99399. --- pkgs/top-level/all-packages.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c1e75cadc83f..3b0d0743dcd1 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -26348,6 +26348,7 @@ in }); java = openjdk11; + z3 = z3_4_4_0; }; iprover = callPackage ../applications/science/logic/iprover { };