2021-01-17 00:15:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, python }:
|
2020-10-11 12:50:04 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2022-03-30 09:31:56 +00:00
|
|
|
pname = "z3";
|
2020-10-11 12:50:04 +00:00
|
|
|
version = "4.4.0";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Z3Prover";
|
|
|
|
repo = "z3";
|
|
|
|
rev = "7f6ef0b6c0813f2e9e8f993d45722c0e5b99e152";
|
|
|
|
sha256 = "1xllvq9fcj4cz34biq2a9dn2sj33bdgrzyzkj26hqw70wkzv1kzx";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ python ];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
CXXFLAGS = if stdenv.isDarwin then "-std=gnu++98" else null;
|
|
|
|
|
2020-10-11 12:50:04 +00:00
|
|
|
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.
|
2021-10-14 00:43:12 +00:00
|
|
|
soext = stdenv.hostPlatform.extensions.sharedLibrary;
|
2020-10-11 12:50:04 +00:00
|
|
|
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";
|
2020-11-30 08:33:03 +00:00
|
|
|
homepage = "https://github.com/Z3Prover/z3";
|
2021-01-17 00:15:33 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
platforms = lib.platforms.x86_64;
|
|
|
|
maintainers = with lib.maintainers; [ thoughtpolice ttuegel ];
|
2020-10-11 12:50:04 +00:00
|
|
|
};
|
|
|
|
}
|