python: allow stripping tests

This commit is contained in:
Florian Klink 2019-08-18 22:34:12 +02:00
parent 414cde4df4
commit d03283c029

View File

@ -22,6 +22,7 @@
, passthruFun , passthruFun
, bash , bash
, stripIdlelib ? false , stripIdlelib ? false
, stripTests ? false
}: }:
assert x11Support -> tcl != null assert x11Support -> tcl != null
@ -226,6 +227,9 @@ in with passthru; stdenv.mkDerivation {
'' + optionalString stripIdlelib '' '' + optionalString stripIdlelib ''
# Strip IDLE (and turtledemo, which uses it) # Strip IDLE (and turtledemo, which uses it)
rm -R $out/bin/idle* $out/lib/python*/{idlelib,turtledemo} rm -R $out/bin/idle* $out/lib/python*/{idlelib,turtledemo}
'' + optionalString stripTests ''
# Strip tests
rm -R $out/lib/python*/test $out/lib/python*/**/test{,s}
'' + '' '' + ''
# Include a sitecustomize.py file # Include a sitecustomize.py file
cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py cp ${../sitecustomize.py} $out/${sitePackages}/sitecustomize.py