resholve: use stripped-down python27
This PR strips down the modified `python27` derivation used by `resholve`. The idea is to reduce the possible security issues, and also to make it easier to bootstrap.
This commit is contained in:
@@ -31,6 +31,10 @@
|
||||
, rebuildBytecode ? true
|
||||
, reproducibleBuild ? false
|
||||
, enableOptimizations ? false
|
||||
, strip2to3 ? false
|
||||
, stripConfig ? false
|
||||
, stripIdlelib ? false
|
||||
, stripTests ? false
|
||||
, pythonAttr ? "python${sourceVersion.major}${sourceVersion.minor}"
|
||||
}:
|
||||
|
||||
@@ -318,6 +322,16 @@ in with passthru; stdenv.mkDerivation ({
|
||||
postFixup = ''
|
||||
# Include a sitecustomize.py file. Note it causes an error when it's in postInstall with 2.7.
|
||||
cp ${../../sitecustomize.py} $out/${sitePackages}/sitecustomize.py
|
||||
'' + optionalString strip2to3 ''
|
||||
rm -R $out/bin/2to3 $out/lib/python*/lib2to3
|
||||
'' + optionalString stripConfig ''
|
||||
rm -R $out/bin/python*-config $out/lib/python*/config-*
|
||||
'' + optionalString stripIdlelib ''
|
||||
# Strip IDLE
|
||||
rm -R $out/bin/idle* $out/lib/python*/idlelib
|
||||
'' + optionalString stripTests ''
|
||||
# Strip tests
|
||||
rm -R $out/lib/python*/test $out/lib/python*/**/test{,s}
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
Reference in New Issue
Block a user