z3: move to multiple output packages

The Z3 source code is effectively compiled into two completely separate
objects: the z3 binary file, and the libz3.so library -- but the binary is not
linked against the shared library, it simply incorporates all of the object
files. The Z3 code base results in an ~25MB object on x86_64-linux. As a
result, splitting bin/ and lib/ results in a 50% reduction in closure size.

(The include/ directory is also surprisingly large at .5MB...)

This also splits the python API into a completely separate .python attribute,
as well.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
This commit is contained in:
Austin Seipp 2018-07-12 15:01:16 -05:00
parent d37c23c699
commit 54e9f7dcbe

View File

@ -20,6 +20,20 @@ stdenv.mkDerivation rec {
cd build
'';
postInstall = ''
mkdir -p $dev $lib $python/lib
mv $out/lib/python* $python/lib/
mv $out/lib $lib/lib
mv $out/include $dev/include
# clean up a copy of libz3.so and symlink it instead
rm $python/${python.sitePackages}/z3/lib/libz3.so
ln -s $lib/lib/libz3.so $python/${python.sitePackages}/z3/lib/libz3.so
'';
outputs = [ "out" "lib" "dev" "python" ];
meta = {
description = "A high-performance theorem prover and SMT solver";
homepage = "https://github.com/Z3Prover/z3";