diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-01 15:20:49 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2016-09-01 18:57:43 +0200 |
commit | 168192f116d2faaab33e4fade4756c8d4690e614 (patch) | |
tree | 23f7e4bc7d62522f0292856a455c4808175403f1 | |
parent | b31870fe133cd13966fe659edf26727fed1cd3d7 (diff) |
python-3.5: Eliminate -dev paths from the runtime closure
This reduces Python's closure size from 200 MiB to 129 MiB. Even better would be to get move tkinter to a separate output or package (since that would get rid of all X11 stuff), but that's a bit harder.
-rw-r--r-- | pkgs/development/interpreters/python/cpython/3.5/default.nix | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 9050679435c6c..a2149ddb8bdb0 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -95,6 +95,17 @@ stdenv.mkDerivation { paxmark E $out/bin/python${majorVersion} ''; + postFixup = '' + # Get rid of retained dependencies on -dev packages, and remove + # some $TMPDIR references to improve binary reproducibility. + for i in $out/lib//python${majorVersion}/_sysconfigdata.py $out/lib/python${majorVersion}/config-${majorVersion}m/Makefile; do + sed -i $i -e "s|-I/nix/store/[^ ']*||g" -e "s|$TMPDIR|/no-such-path|g" + done + + # FIXME: should regenerate this. + rm $out/lib/python${majorVersion}/__pycache__/_sysconfigdata.cpython* + ''; + passthru = rec { zlibSupport = zlib != null; sqliteSupport = sqlite != null; |