python.buildEnv: use NIX_PYTHONPATH

This commit is contained in:
Frederik Rietdijk 2019-07-09 14:34:15 +02:00 committed by Frederik Rietdijk
parent 46409b5c32
commit ec7f569211

View File

@ -13,6 +13,7 @@
let
env = let
paths = requiredPythonModules (extraLibs ++ [ python ] ) ;
pythonPath = "${placeholder "out"}/${python.sitePackages}";
in buildEnv {
name = "${python.name}-env";
@ -35,7 +36,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" ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
fi
fi
done