diff options
author | Frederik Rietdijk <fridh@fridh.nl> | 2019-07-27 09:30:34 +0200 |
---|---|---|
committer | Frederik Rietdijk <freddyrietdijk@fridh.nl> | 2019-07-27 11:52:49 +0200 |
commit | bd47c5721f8a297588620b89cd2ace7a30d3e91d (patch) | |
tree | ac0cf94e1d540fc0f321efbe8cd124cc37ade6ad /pkgs/development/interpreters/python/wrapper.nix | |
parent | c9793b81b8f72dd291e0ba14724bbbf96c2a5309 (diff) | |
download | nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar.gz nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar.bz2 nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar.lz nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar.xz nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.tar.zst nixpkgs-bd47c5721f8a297588620b89cd2ace7a30d3e91d.zip |
Python: introduce NIX_PYTHONEXECUTABLE in order to set sys.executable
This is needed in case of `python.buildEnv` to make sure sys.executable does not point to the unwrapped executable.
Diffstat (limited to 'pkgs/development/interpreters/python/wrapper.nix')
-rw-r--r-- | pkgs/development/interpreters/python/wrapper.nix | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix index d97bef222a1..b437584024f 100644 --- a/pkgs/development/interpreters/python/wrapper.nix +++ b/pkgs/development/interpreters/python/wrapper.nix @@ -14,6 +14,7 @@ let env = let paths = requiredPythonModules (extraLibs ++ [ python ] ) ; pythonPath = "${placeholder "out"}/${python.sitePackages}"; + pythonExecutable = "${placeholder "out"}/bin/${python.executable}"; in buildEnv { name = "${python.name}-env"; @@ -36,7 +37,7 @@ let if [ -f "$prg" ]; then rm -f "$out/bin/$prg" if [ -x "$prg" ]; then - makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs} + makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs} fi fi done |