Skip to content

Commit

Permalink
z3: move to multiple output packages
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
thoughtpolice committed Jul 12, 2018
1 parent d37c23c commit 54e9f7d
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkgs/applications/science/logic/z3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 54e9f7d

Please sign in to comment.