diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix index e2286c21029..c1e2cd86634 100644 --- a/pkgs/development/interpreters/python/cpython/default.nix +++ b/pkgs/development/interpreters/python/cpython/default.nix @@ -21,6 +21,7 @@ , sha256 , passthruFun , bash +, stripIdlelib ? false }: assert x11Support -> tcl != null @@ -222,6 +223,10 @@ in with passthru; stdenv.mkDerivation { find $out/lib/python*/config-* -type f -print -exec nuke-refs -e $out '{}' + find $out/lib -name '_sysconfigdata*.py*' -print -exec nuke-refs -e $out '{}' + + '' + optionalString stripIdlelib '' + # Strip IDLE (and turtledemo, which uses it) + rm -R $out/bin/idle* $out/lib/python*/{idlelib,turtledemo} + '' + '' # Include a sitecustomize.py file cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py