summary refs log tree commit diff
path: root/pkgs/development/interpreters/python/setup-hook.sh
diff options
context:
space:
mode:
authorDaiderd Jordan <daiderd@gmail.com>2019-03-05 20:25:38 +0100
committerFrederik Rietdijk <freddyrietdijk@fridh.nl>2019-04-28 09:20:41 +0200
commita76e11a8c509f2db5871aced41b46077b66206a2 (patch)
tree49f346a08830b633909d86f2521e0658d99ef39d /pkgs/development/interpreters/python/setup-hook.sh
parent8fa36fc8a18261a2195bc2ae5384a320fe97c6a9 (diff)
downloadnixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar.gz
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar.bz2
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar.lz
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar.xz
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.tar.zst
nixpkgs-a76e11a8c509f2db5871aced41b46077b66206a2.zip
python: make it possible to disable the python setup-hook
Without this it's impossible to use a python binary that depends on a
different python version than what's used during the current build.
Diffstat (limited to 'pkgs/development/interpreters/python/setup-hook.sh')
-rw-r--r--pkgs/development/interpreters/python/setup-hook.sh4
1 files changed, 3 insertions, 1 deletions
diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh
index 77ec9e9ac0b..523df5762fa 100644
--- a/pkgs/development/interpreters/python/setup-hook.sh
+++ b/pkgs/development/interpreters/python/setup-hook.sh
@@ -12,7 +12,9 @@ toPythonPath() {
     echo $result
 }
 
-addEnvHooks "$hostOffset" addPythonPath
+if [ -z "${dontAddPythonPath:-}" ]; then
+    addEnvHooks "$hostOffset" addPythonPath
+fi
 
 # Determinism: The interpreter is patched to write null timestamps when compiling python files.
 # This way python doesn't try to update them when we freeze timestamps in nix store.