Add flag to disable PYTHONNOUSERSITE for wrapped binaries in python environments

This commit is contained in:
Tom McLaughlin
2018-12-06 15:18:59 -08:00
parent 0045164b15
commit a3f24daa7b
3 changed files with 4 additions and 4 deletions

View File

@@ -3,6 +3,7 @@
, extraOutputsToInstall ? []
, postBuild ? ""
, ignoreCollisions ? false
, permitUserSite ? false
, requiredPythonModules
# Wrap executables with the given argument.
, makeWrapperArgs ? []
@@ -34,7 +35,7 @@ let
if [ -f "$prg" ]; then
rm -f "$out/bin/$prg"
if [ -x "$prg" ]; then
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" --set PYTHONNOUSERSITE "true" ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
fi
fi
done