python.buildEnv: new argument makeWrapperArgs

`python.buildEnv` would already wrap executables exporting `PYTHONHOME`.
With this change, it is possible to pass in additional arguments to the
underlying `makeWrapper`.
This commit is contained in:
Frederik Rietdijk 2018-10-13 10:56:51 +02:00 committed by Frederik Rietdijk
parent 66f5f1a75b
commit 548ced628d

View File

@ -4,6 +4,8 @@
, postBuild ? "" , postBuild ? ""
, ignoreCollisions ? false , ignoreCollisions ? false
, requiredPythonModules , requiredPythonModules
# Wrap executables with the given argument.
, makeWrapperArgs ? []
, }: , }:
# Create a python executable that knows about additional packages. # Create a python executable that knows about additional packages.
@ -32,7 +34,7 @@ let
if [ -f "$prg" ]; then if [ -f "$prg" ]; then
rm -f "$out/bin/$prg" rm -f "$out/bin/$prg"
if [ -x "$prg" ]; then if [ -x "$prg" ]; then
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" --set PYTHONNOUSERSITE "true" makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set PYTHONHOME "$out" --set PYTHONNOUSERSITE "true" ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
fi fi
fi fi
done done