diff options
author | Austin Seipp <aseipp@pobox.com> | 2018-07-12 15:01:16 -0500 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2018-07-12 15:48:48 -0500 |
commit | 54e9f7dcbea9288fd9cea0dfc37e8deba53a806b (patch) | |
tree | 64e59338616aea74aef9f8d543b2ad6a6c0a532a /pkgs/applications/science/logic | |
parent | d37c23c699f10b9d9bb17a0e8da6f1a76cdd4ec8 (diff) | |
download | nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar.gz nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar.bz2 nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar.lz nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar.xz nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.tar.zst nixlib-54e9f7dcbea9288fd9cea0dfc37e8deba53a806b.zip |
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>
Diffstat (limited to 'pkgs/applications/science/logic')
-rw-r--r-- | pkgs/applications/science/logic/z3/default.nix | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix index 54c9799a01b8..10a526192764 100644 --- a/pkgs/applications/science/logic/z3/default.nix +++ b/pkgs/applications/science/logic/z3/default.nix @@ -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"; |