diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 9050679435c6..a2149ddb8bdb 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;